xref: /openbsd-src/games/tetris/tetris.6 (revision f2da64fbbbf1b03f09f390ab01267c93dfd77c4c)
1.\"	$OpenBSD: tetris.6,v 1.20 2015/12/04 19:46:04 tb 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 $Mdocdate: December 4 2015 $
36.Dt TETRIS 6
37.Os
38.Sh NAME
39.Nm tetris
40.Nd the game of tetris
41.Sh SYNOPSIS
42.Nm tetris
43.Op Fl cps
44.Op Fl k Ar keys
45.Op Fl l Ar level
46.Sh DESCRIPTION
47The
48.Nm
49command runs a display-based game.
50The object is to fit shapes together to form complete rows,
51which then vanish.
52When the shapes fill up to the top, the game ends.
53You can optionally select a level of play or custom-select control keys.
54.Pp
55The default level of play is 2.
56.Pp
57The default control keys are as follows:
58.Pp
59.Bl -tag -width "<space>" -compact -offset indent
60.It j
61move left
62.It k
63rotate 1/4 turn counterclockwise
64.It l
65move right
66.It <space>
67drop
68.It p
69pause
70.It q
71quit
72.El
73.Pp
74The options are as follows:
75.Bl -tag -width indent
76.It Fl c
77Classic tetris mode, in which shapes rotate clockwise and are drawn with
78.Dq [] .
79.It Fl k Ar keys
80The default control keys can be changed using the
81.Fl k
82option.
83The
84.Ar keys
85argument must have the six keys in order; remember to quote any
86space or tab characters from the shell.
87For example:
88.sp
89.Dl "tetris -l 2 -k 'jkl pq'"
90.sp
91will play the default game, i.e. level 2 with the default
92control keys.
93The current key settings are displayed at the bottom of the screen
94during play.
95.It Fl l Ar level
96Select a level of play.
97.It Fl p
98Switch on previewing of the shape that will appear next.
99This penalizes your score.
100.It Fl s
101Display the top scores.
102.El
103.Sh PLAY
104At the start of the game, a shape will appear at the top of the screen,
105falling one square at a time.
106The speed at which it falls is determined directly by the level:
107if you select level 2, the blocks will fall twice per second;
108at level 9, they fall 9 times per second.
109(As the game goes on, things speed up,
110no matter what your initial selection.)
111When this shape
112.Dq "touches down"
113on the bottom of the field, another will appear at the top.
114.Pp
115You can move shapes to the left or right, rotate them counterclockwise,
116or drop them to the bottom by pressing the appropriate keys.
117As you fit them together, completed horizontal rows vanish,
118and any blocks above fall down to fill in.
119When the blocks stack up to the top of the screen, the game is over.
120.Sh SCORING
121You get one point for every block you fit into the stack,
122and one point for every space a block falls when you hit the drop key.
123(Dropping the blocks is therefore a good way to increase your score.)
124Completing a row rewards you with a bonus corresponding to the number
125of simultaneous rows completed.
126Your total score is the product of the level of play
127and your accumulated
128.ie t points\(em200
129.el points -- 200
130points on level 3 gives you a score of 600.
131Each player gets at most one entry on any level,
132for a total of nine scores in the high scores file.
133Players who no longer have accounts are limited to one score.
134Also, scores over 5 years old are expired.
135The exception to these conditions is that the highest score on a given
136level is
137.Em always
138kept,
139so that following generations can pay homage to those who have
140wasted serious amounts of time.
141.Pp
142The score list is produced at the end of the game.
143The printout includes each player's overall ranking,
144name, score, and how many points were scored on what level.
145Scores which are the highest on a given level
146are marked with asterisks
147.Dq * .
148.Sh ENVIRONMENT
149.Bl -tag -width $HOME/.tetris.scores
150.It Ev LOGNAME
151Name displayed in high score file.
152.El
153.Sh FILES
154.Bl -tag -width $HOME/.tetris.scores
155.It Pa $HOME/.tetris.scores
156High score file.
157.El
158.Sh AUTHORS
159.An -nosplit
160Adapted from a 1989 International Obfuscated C Code Contest winner by
161.An Chris Torek
162and
163.An Darren F. Provine .
164.Pp
165Manual adapted from the original entry written by
166.An Nancy L. Tinkham
167and
168.An Darren F. Provine .
169.Pp
170Shape previewing code adapted from code by
171.An Hubert Feyrer .
172.Sh BUGS
173The higher levels are unplayable without a fast terminal connection.
174