Blame


1 11a5e2cf 2024-01-16 benni .\" $NetBSD: tetris.6,v 1.18 2023/07/01 10:51:35 nia Exp $
2 11a5e2cf 2024-01-16 benni .\"
3 11a5e2cf 2024-01-16 benni .\" Copyright (c) 1992, 1993
4 11a5e2cf 2024-01-16 benni .\" The Regents of the University of California. All rights reserved.
5 11a5e2cf 2024-01-16 benni .\"
6 11a5e2cf 2024-01-16 benni .\" This code is derived from software contributed to Berkeley by
7 11a5e2cf 2024-01-16 benni .\" Nancy L. Tinkham and Darren F. Provine.
8 11a5e2cf 2024-01-16 benni .\"
9 11a5e2cf 2024-01-16 benni .\" Redistribution and use in source and binary forms, with or without
10 11a5e2cf 2024-01-16 benni .\" modification, are permitted provided that the following conditions
11 11a5e2cf 2024-01-16 benni .\" are met:
12 11a5e2cf 2024-01-16 benni .\" 1. Redistributions of source code must retain the above copyright
13 11a5e2cf 2024-01-16 benni .\" notice, this list of conditions and the following disclaimer.
14 11a5e2cf 2024-01-16 benni .\" 2. Redistributions in binary form must reproduce the above copyright
15 11a5e2cf 2024-01-16 benni .\" notice, this list of conditions and the following disclaimer in the
16 11a5e2cf 2024-01-16 benni .\" documentation and/or other materials provided with the distribution.
17 11a5e2cf 2024-01-16 benni .\" 3. Neither the name of the University nor the names of its contributors
18 11a5e2cf 2024-01-16 benni .\" may be used to endorse or promote products derived from this software
19 11a5e2cf 2024-01-16 benni .\" without specific prior written permission.
20 11a5e2cf 2024-01-16 benni .\"
21 11a5e2cf 2024-01-16 benni .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 11a5e2cf 2024-01-16 benni .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 11a5e2cf 2024-01-16 benni .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 11a5e2cf 2024-01-16 benni .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 11a5e2cf 2024-01-16 benni .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 11a5e2cf 2024-01-16 benni .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 11a5e2cf 2024-01-16 benni .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 11a5e2cf 2024-01-16 benni .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 11a5e2cf 2024-01-16 benni .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 11a5e2cf 2024-01-16 benni .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 11a5e2cf 2024-01-16 benni .\" SUCH DAMAGE.
32 11a5e2cf 2024-01-16 benni .\"
33 11a5e2cf 2024-01-16 benni .\" @(#)tetris.6 8.1 (Berkeley) 5/31/93
34 11a5e2cf 2024-01-16 benni .\"
35 11a5e2cf 2024-01-16 benni .Dd July 1, 2023
36 11a5e2cf 2024-01-16 benni .Dt TETRIS 6
37 11a5e2cf 2024-01-16 benni .Os
38 11a5e2cf 2024-01-16 benni .Sh NAME
39 11a5e2cf 2024-01-16 benni .Nm tetris
40 11a5e2cf 2024-01-16 benni .Nd the game of tetris
41 11a5e2cf 2024-01-16 benni .Sh SYNOPSIS
42 11a5e2cf 2024-01-16 benni .Nm
43 11a5e2cf 2024-01-16 benni .Op Fl bps
44 11a5e2cf 2024-01-16 benni .Op Fl k Ar keys
45 11a5e2cf 2024-01-16 benni .Op Fl l Ar level
46 11a5e2cf 2024-01-16 benni .Sh DESCRIPTION
47 11a5e2cf 2024-01-16 benni The
48 11a5e2cf 2024-01-16 benni .Nm
49 11a5e2cf 2024-01-16 benni command is a display-based game.
50 11a5e2cf 2024-01-16 benni The object is to fit the shapes together forming complete rows,
51 11a5e2cf 2024-01-16 benni which then vanish.
52 11a5e2cf 2024-01-16 benni When the shapes fill up to the top, the game ends.
53 11a5e2cf 2024-01-16 benni You can optionally select a level of play, or custom-select control keys.
54 11a5e2cf 2024-01-16 benni .Pp
55 11a5e2cf 2024-01-16 benni The default level of play is 2.
56 11a5e2cf 2024-01-16 benni .Pp
57 11a5e2cf 2024-01-16 benni The default control keys are as follows:
58 11a5e2cf 2024-01-16 benni .Pp
59 11a5e2cf 2024-01-16 benni .Bl -tag -width "xxspacexx" -compact -offset indent
60 11a5e2cf 2024-01-16 benni .It j
61 11a5e2cf 2024-01-16 benni move left
62 11a5e2cf 2024-01-16 benni .It k
63 11a5e2cf 2024-01-16 benni rotate 1/4 turn counterclockwise
64 11a5e2cf 2024-01-16 benni .It l
65 11a5e2cf 2024-01-16 benni move right
66 11a5e2cf 2024-01-16 benni .It Aq space
67 11a5e2cf 2024-01-16 benni drop
68 11a5e2cf 2024-01-16 benni .It p
69 11a5e2cf 2024-01-16 benni pause
70 11a5e2cf 2024-01-16 benni .It q
71 11a5e2cf 2024-01-16 benni quit
72 11a5e2cf 2024-01-16 benni .It n
73 11a5e2cf 2024-01-16 benni down
74 11a5e2cf 2024-01-16 benni .El
75 11a5e2cf 2024-01-16 benni .Pp
76 11a5e2cf 2024-01-16 benni The options are as follows:
77 11a5e2cf 2024-01-16 benni .Bl -tag -width indent
78 11a5e2cf 2024-01-16 benni .It Fl b
79 11a5e2cf 2024-01-16 benni By default, shapes are displayed colorfully if the user's CRT supports color.
80 11a5e2cf 2024-01-16 benni The
81 11a5e2cf 2024-01-16 benni .Fl b
82 11a5e2cf 2024-01-16 benni option can be used to restore the traditional black-and-white behavior.
83 2e032d40 2024-03-01 benni .It Fl f
84 2e032d40 2024-03-01 benni By default, the fallrate is staying constant.
85 2e032d40 2024-03-01 benni With this option, the fallrate increases over time.
86 11a5e2cf 2024-01-16 benni .It Fl k
87 11a5e2cf 2024-01-16 benni The default control keys can be changed using the
88 11a5e2cf 2024-01-16 benni .Fl k
89 11a5e2cf 2024-01-16 benni option.
90 11a5e2cf 2024-01-16 benni The
91 11a5e2cf 2024-01-16 benni .Ar keys
92 11a5e2cf 2024-01-16 benni argument must have the seven keys in order, and, remember to quote any
93 11a5e2cf 2024-01-16 benni space or tab characters from the shell.
94 11a5e2cf 2024-01-16 benni For example:
95 11a5e2cf 2024-01-16 benni .Pp
96 11a5e2cf 2024-01-16 benni .Dl "tetris -l 2 -k 'jkl pqn'"
97 11a5e2cf 2024-01-16 benni .Pp
98 11a5e2cf 2024-01-16 benni will play the default games, i.e. level 2 and with the default
99 11a5e2cf 2024-01-16 benni control keys.
100 11a5e2cf 2024-01-16 benni The current key settings are displayed at the bottom of the screen
101 11a5e2cf 2024-01-16 benni during play.
102 11a5e2cf 2024-01-16 benni .It Fl l
103 11a5e2cf 2024-01-16 benni Select a level of play.
104 11a5e2cf 2024-01-16 benni .It Fl s
105 11a5e2cf 2024-01-16 benni Display the top scores.
106 11a5e2cf 2024-01-16 benni .It Fl p
107 11a5e2cf 2024-01-16 benni Switch on previewing of the shape that will appear next.
108 11a5e2cf 2024-01-16 benni .El
109 11a5e2cf 2024-01-16 benni .Sh PLAY
110 11a5e2cf 2024-01-16 benni At the start of the game, a shape will appear at the top of the screen,
111 11a5e2cf 2024-01-16 benni falling one square at a time.
112 11a5e2cf 2024-01-16 benni The speed at which it falls is determined directly by the level:
113 11a5e2cf 2024-01-16 benni if you select level 2, the blocks will fall twice per second;
114 11a5e2cf 2024-01-16 benni at level 9, they fall 9 times per second.
115 11a5e2cf 2024-01-16 benni (As the game goes on, things speed up,
116 11a5e2cf 2024-01-16 benni no matter what your initial selection.)
117 11a5e2cf 2024-01-16 benni When this shape
118 11a5e2cf 2024-01-16 benni .Dq touches down
119 11a5e2cf 2024-01-16 benni on the bottom of the field, another will appear at the top.
120 11a5e2cf 2024-01-16 benni .Pp
121 11a5e2cf 2024-01-16 benni You can move shapes to the left or right, rotate them counterclockwise,
122 11a5e2cf 2024-01-16 benni or drop them to the bottom by pressing the appropriate keys.
123 11a5e2cf 2024-01-16 benni As you fit them together, completed horizontal rows vanish,
124 11a5e2cf 2024-01-16 benni and any blocks above fall down to fill in.
125 11a5e2cf 2024-01-16 benni When the blocks stack up to the top of the screen, the game is over.
126 11a5e2cf 2024-01-16 benni .Sh SCORING
127 11a5e2cf 2024-01-16 benni You get one point for every block you fit into the stack,
128 11a5e2cf 2024-01-16 benni and one point for every space a block falls when you hit the drop key.
129 11a5e2cf 2024-01-16 benni (Dropping the blocks is therefore a good way to increase your score.)
130 11a5e2cf 2024-01-16 benni Your total score is the product of the level of play
131 11a5e2cf 2024-01-16 benni and your accumulated
132 11a5e2cf 2024-01-16 benni .ie t points\(em200
133 11a5e2cf 2024-01-16 benni .el points -- 200
134 11a5e2cf 2024-01-16 benni points on level 3 gives you a score of 600.
135 11a5e2cf 2024-01-16 benni Each player gets at most one entry on any level,
136 11a5e2cf 2024-01-16 benni for a total of nine scores in the high scores file.
137 11a5e2cf 2024-01-16 benni Players who no longer have accounts are limited to one score.
138 11a5e2cf 2024-01-16 benni Also, scores over 5 years old are expired.
139 11a5e2cf 2024-01-16 benni The exception to these conditions is that the highest score on a given
140 11a5e2cf 2024-01-16 benni level is
141 11a5e2cf 2024-01-16 benni .Em always
142 11a5e2cf 2024-01-16 benni kept,
143 11a5e2cf 2024-01-16 benni so that following generations can pay homage to those who have
144 11a5e2cf 2024-01-16 benni wasted serious amounts of time.
145 11a5e2cf 2024-01-16 benni .Pp
146 11a5e2cf 2024-01-16 benni The score list is produced at the end of the game.
147 11a5e2cf 2024-01-16 benni The printout includes each player's overall ranking,
148 11a5e2cf 2024-01-16 benni name, score, and how many points were scored on what level.
149 11a5e2cf 2024-01-16 benni Scores which are the highest on a given level
150 11a5e2cf 2024-01-16 benni are marked with asterisks
151 11a5e2cf 2024-01-16 benni .Dq * .
152 11a5e2cf 2024-01-16 benni .Sh ENVIRONMENT
153 11a5e2cf 2024-01-16 benni .Nm
154 11a5e2cf 2024-01-16 benni honors the informal standard
155 11a5e2cf 2024-01-16 benni .Dv NO_COLOR .
156 11a5e2cf 2024-01-16 benni When it is set in the environment, no color will be used.
157 11a5e2cf 2024-01-16 benni .Sh FILES
158 11a5e2cf 2024-01-16 benni .Bl -tag -width /var/games/tetris.scoresxx
159 11a5e2cf 2024-01-16 benni .It /var/games/tetris.scores
160 11a5e2cf 2024-01-16 benni high score file
161 11a5e2cf 2024-01-16 benni .El
162 11a5e2cf 2024-01-16 benni .Sh AUTHORS
163 11a5e2cf 2024-01-16 benni .An -nosplit
164 11a5e2cf 2024-01-16 benni Adapted from a 1989 International Obfuscated C Code Contest winner by
165 11a5e2cf 2024-01-16 benni .An Chris Torek
166 11a5e2cf 2024-01-16 benni and
167 11a5e2cf 2024-01-16 benni .An Darren F. Provine .
168 11a5e2cf 2024-01-16 benni .Pp
169 11a5e2cf 2024-01-16 benni Manual adapted from the original entry written by
170 11a5e2cf 2024-01-16 benni .An Nancy L. Tinkham
171 11a5e2cf 2024-01-16 benni and
172 11a5e2cf 2024-01-16 benni .An Darren F. Provine .
173 11a5e2cf 2024-01-16 benni .Pp
174 11a5e2cf 2024-01-16 benni Code for previewing next shape added by
175 11a5e2cf 2024-01-16 benni .An Hubert Feyrer
176 11a5e2cf 2024-01-16 benni in 1999.
177 11a5e2cf 2024-01-16 benni .Sh BUGS
178 11a5e2cf 2024-01-16 benni The higher levels are unplayable without a fast terminal connection.