Blob


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