xref: /netbsd-src/games/tetris/tetris.6 (revision d92552c3ea104e1b0b9116663d6c92428934d388)
1*d92552c3Snia.\"	$NetBSD: tetris.6,v 1.18 2023/07/01 10:51:35 nia Exp $
2aaeacec8Scgd.\"
3fece8b50Scgd.\" Copyright (c) 1992, 1993
4fece8b50Scgd.\"	The Regents of the University of California.  All rights reserved.
5fece8b50Scgd.\"
6fece8b50Scgd.\" This code is derived from software contributed to Berkeley by
7fece8b50Scgd.\" Nancy L. Tinkham and Darren F. Provine.
8fece8b50Scgd.\"
9fece8b50Scgd.\" Redistribution and use in source and binary forms, with or without
10fece8b50Scgd.\" modification, are permitted provided that the following conditions
11fece8b50Scgd.\" are met:
12fece8b50Scgd.\" 1. Redistributions of source code must retain the above copyright
13fece8b50Scgd.\"    notice, this list of conditions and the following disclaimer.
14fece8b50Scgd.\" 2. Redistributions in binary form must reproduce the above copyright
15fece8b50Scgd.\"    notice, this list of conditions and the following disclaimer in the
16fece8b50Scgd.\"    documentation and/or other materials provided with the distribution.
17e5aeb4eaSagc.\" 3. Neither the name of the University nor the names of its contributors
18fece8b50Scgd.\"    may be used to endorse or promote products derived from this software
19fece8b50Scgd.\"    without specific prior written permission.
20fece8b50Scgd.\"
21fece8b50Scgd.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22fece8b50Scgd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23fece8b50Scgd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24fece8b50Scgd.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25fece8b50Scgd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26fece8b50Scgd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27fece8b50Scgd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28fece8b50Scgd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29fece8b50Scgd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30fece8b50Scgd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31fece8b50Scgd.\" SUCH DAMAGE.
32fece8b50Scgd.\"
33fece8b50Scgd.\"	@(#)tetris.6	8.1 (Berkeley) 5/31/93
34fece8b50Scgd.\"
35*d92552c3Snia.Dd July 1, 2023
36fece8b50Scgd.Dt TETRIS 6
37fece8b50Scgd.Os
38fece8b50Scgd.Sh NAME
39fece8b50Scgd.Nm tetris
40fece8b50Scgd.Nd the game of tetris
41fece8b50Scgd.Sh SYNOPSIS
42fece8b50Scgd.Nm
43990812d6Spgoyette.Op Fl bps
44fece8b50Scgd.Op Fl k Ar keys
45fece8b50Scgd.Op Fl l Ar level
46fece8b50Scgd.Sh DESCRIPTION
47fece8b50ScgdThe
48fece8b50Scgd.Nm
49cde3d9a6Sdhollandcommand is a display-based game.
50fece8b50ScgdThe object is to fit the shapes together forming complete rows,
51fece8b50Scgdwhich then vanish.
52fece8b50ScgdWhen the shapes fill up to the top, the game ends.
53fece8b50ScgdYou can optionally select a level of play, or custom-select control keys.
54fece8b50Scgd.Pp
55fece8b50ScgdThe default level of play is 2.
56fece8b50Scgd.Pp
57fece8b50ScgdThe default control keys are as follows:
58fece8b50Scgd.Pp
59c91d8d6bSwiz.Bl -tag -width "xxspacexx" -compact -offset indent
60fece8b50Scgd.It j
61fece8b50Scgdmove left
62fece8b50Scgd.It k
63fece8b50Scgdrotate 1/4 turn counterclockwise
64fece8b50Scgd.It l
65fece8b50Scgdmove right
66c91d8d6bSwiz.It Aq space
67fece8b50Scgddrop
68fece8b50Scgd.It p
69fece8b50Scgdpause
70fece8b50Scgd.It q
71fece8b50Scgdquit
722343aabbSmrg.It n
732343aabbSmrgdown
74fece8b50Scgd.El
75fece8b50Scgd.Pp
76fece8b50ScgdThe options are as follows:
77fece8b50Scgd.Bl -tag -width indent
78990812d6Spgoyette.It Fl b
7968006fcaSpgoyetteBy default, shapes are displayed colorfully if the user's CRT supports color.
8068006fcaSpgoyetteThe
81990812d6Spgoyette.Fl b
8268006fcaSpgoyetteoption can be used to restore the traditional black-and-white behavior.
83fece8b50Scgd.It Fl k
84fece8b50ScgdThe default control keys can be changed using the
85b3f39d1bSmikel.Fl k
86b3f39d1bSmikeloption.
87fece8b50ScgdThe
88fece8b50Scgd.Ar keys
892343aabbSmrgargument must have the seven keys in order, and, remember to quote any
90fece8b50Scgdspace or tab characters from the shell.
91fece8b50ScgdFor example:
92076a2da7Swiz.Pp
932343aabbSmrg.Dl "tetris -l 2 -k 'jkl pqn'"
94076a2da7Swiz.Pp
95fece8b50Scgdwill play the default games, i.e. level 2 and with the default
96fece8b50Scgdcontrol keys.
97fece8b50ScgdThe current key settings are displayed at the bottom of the screen
98fece8b50Scgdduring play.
99fece8b50Scgd.It Fl l
100fece8b50ScgdSelect a level of play.
101fece8b50Scgd.It Fl s
102fece8b50ScgdDisplay the top scores.
1036cfbee59Shubertf.It Fl p
1046cfbee59ShubertfSwitch on previewing of the shape that will appear next.
105fece8b50Scgd.El
106fece8b50Scgd.Sh PLAY
107fece8b50ScgdAt the start of the game, a shape will appear at the top of the screen,
108fece8b50Scgdfalling one square at a time.
109fece8b50ScgdThe speed at which it falls is determined directly by the level:
110fece8b50Scgdif you select level 2, the blocks will fall twice per second;
111fece8b50Scgdat level 9, they fall 9 times per second.
112fece8b50Scgd(As the game goes on, things speed up,
113fece8b50Scgdno matter what your initial selection.)
114fece8b50ScgdWhen this shape
115c91d8d6bSwiz.Dq touches down
116fece8b50Scgdon the bottom of the field, another will appear at the top.
117fece8b50Scgd.Pp
118fece8b50ScgdYou can move shapes to the left or right, rotate them counterclockwise,
119fece8b50Scgdor drop them to the bottom by pressing the appropriate keys.
120fece8b50ScgdAs you fit them together, completed horizontal rows vanish,
121fece8b50Scgdand any blocks above fall down to fill in.
122fece8b50ScgdWhen the blocks stack up to the top of the screen, the game is over.
123fece8b50Scgd.Sh SCORING
124fece8b50ScgdYou get one point for every block you fit into the stack,
125fece8b50Scgdand one point for every space a block falls when you hit the drop key.
126fece8b50Scgd(Dropping the blocks is therefore a good way to increase your score.)
127fece8b50ScgdYour total score is the product of the level of play
128fece8b50Scgdand your accumulated
129fece8b50Scgd.ie t points\(em200
130fece8b50Scgd.el points -- 200
131fece8b50Scgdpoints on level 3 gives you a score of 600.
132fece8b50ScgdEach player gets at most one entry on any level,
133fece8b50Scgdfor a total of nine scores in the high scores file.
134fece8b50ScgdPlayers who no longer have accounts are limited to one score.
135fece8b50ScgdAlso, scores over 5 years old are expired.
136fece8b50ScgdThe exception to these conditions is that the highest score on a given
137fece8b50Scgdlevel is
138fece8b50Scgd.Em always
139fece8b50Scgdkept,
140fece8b50Scgdso that following generations can pay homage to those who have
141fece8b50Scgdwasted serious amounts of time.
142fece8b50Scgd.Pp
143fece8b50ScgdThe score list is produced at the end of the game.
144fece8b50ScgdThe printout includes each player's overall ranking,
145fece8b50Scgdname, score, and how many points were scored on what level.
146fece8b50ScgdScores which are the highest on a given level
147fece8b50Scgdare marked with asterisks
148fece8b50Scgd.Dq * .
149*d92552c3Snia.Sh ENVIRONMENT
150*d92552c3Snia.Nm
151*d92552c3Sniahonors the informal standard
152*d92552c3Snia.Dv NO_COLOR .
153*d92552c3SniaWhen it is set in the environment, no color will be used.
154fece8b50Scgd.Sh FILES
155fece8b50Scgd.Bl -tag -width /var/games/tetris.scoresxx
156fece8b50Scgd.It /var/games/tetris.scores
157fece8b50Scgdhigh score file
158fece8b50Scgd.El
159fece8b50Scgd.Sh AUTHORS
160076a2da7Swiz.An -nosplit
161fece8b50ScgdAdapted from a 1989 International Obfuscated C Code Contest winner by
162076a2da7Swiz.An Chris Torek
163076a2da7Swizand
164076a2da7Swiz.An Darren F. Provine .
165fece8b50Scgd.Pp
166076a2da7SwizManual adapted from the original entry written by
167076a2da7Swiz.An Nancy L. Tinkham
168076a2da7Swizand
169076a2da7Swiz.An Darren F. Provine .
170f42c52beShubertf.Pp
171076a2da7SwizCode for previewing next shape added by
172076a2da7Swiz.An Hubert Feyrer
173076a2da7Swizin 1999.
174d9f5a9dfSwiz.Sh BUGS
175d9f5a9dfSwizThe higher levels are unplayable without a fast terminal connection.
176