xref: /openbsd-src/games/snake/snake.6 (revision 25a24f0b585e636f61cc2cd27ae0cd074d620825)
1*25a24f0bSjsg.\"	$OpenBSD: snake.6,v 1.15 2022/02/18 23:17:14 jsg Exp $
2f43998fdSpjanzen.\"	$NetBSD: snake.6,v 1.5 1995/04/22 08:34:35 cgd Exp $
3f43998fdSpjanzen.\"
4f43998fdSpjanzen.\" Copyright (c) 1980, 1993
5f43998fdSpjanzen.\"	The Regents of the University of California.  All rights reserved.
6f43998fdSpjanzen.\"
7f43998fdSpjanzen.\" Redistribution and use in source and binary forms, with or without
8f43998fdSpjanzen.\" modification, are permitted provided that the following conditions
9f43998fdSpjanzen.\" are met:
10f43998fdSpjanzen.\" 1. Redistributions of source code must retain the above copyright
11f43998fdSpjanzen.\"    notice, this list of conditions and the following disclaimer.
12f43998fdSpjanzen.\" 2. Redistributions in binary form must reproduce the above copyright
13f43998fdSpjanzen.\"    notice, this list of conditions and the following disclaimer in the
14f43998fdSpjanzen.\"    documentation and/or other materials provided with the distribution.
157a09557bSmillert.\" 3. Neither the name of the University nor the names of its contributors
16f43998fdSpjanzen.\"    may be used to endorse or promote products derived from this software
17f43998fdSpjanzen.\"    without specific prior written permission.
18f43998fdSpjanzen.\"
19f43998fdSpjanzen.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20f43998fdSpjanzen.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21f43998fdSpjanzen.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22f43998fdSpjanzen.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23f43998fdSpjanzen.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24f43998fdSpjanzen.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25f43998fdSpjanzen.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26f43998fdSpjanzen.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27f43998fdSpjanzen.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28f43998fdSpjanzen.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29f43998fdSpjanzen.\" SUCH DAMAGE.
30f43998fdSpjanzen.\"
31f43998fdSpjanzen.\"	@(#)snake.6	8.1 (Berkeley) 5/31/93
32f43998fdSpjanzen.\"
33*25a24f0bSjsg.Dd $Mdocdate: February 18 2022 $
34f43998fdSpjanzen.Dt SNAKE 6
35f43998fdSpjanzen.Os
36f43998fdSpjanzen.Sh NAME
37fdba1792Sderaadt.Nm snake
38f43998fdSpjanzen.Nd display chase game
39f43998fdSpjanzen.Sh SYNOPSIS
40f43998fdSpjanzen.Nm snake
413e992fd7Sjmc.Op Fl st
42f43998fdSpjanzen.Op Fl l Ar length
433e992fd7Sjmc.Op Fl w Ar width
44f43998fdSpjanzen.Sh DESCRIPTION
45f43998fdSpjanzen.Nm snake
46f43998fdSpjanzenis a display-based game.
47f43998fdSpjanzenThe object of the game is to make as much money as possible without
483bfc9584Spjanzengetting eaten by the snake.
493bfc9584SpjanzenThe
50f43998fdSpjanzen.Fl l
51f43998fdSpjanzenand
52f43998fdSpjanzen.Fl w
53f43998fdSpjanzenoptions allow you to specify the length and width of the field.
54f43998fdSpjanzenBy default the entire screen (except for the last column) is used.
55f43998fdSpjanzenThe
56f43998fdSpjanzen.Fl s
57f43998fdSpjanzenoption shows all scores.
58fa24ff78SpjanzenThe
59fa24ff78Spjanzen.Fl t
60fa24ff78Spjanzenoption makes the game assume you are on a slow terminal.
61f43998fdSpjanzen.Pp
62f43998fdSpjanzenYou are represented on the screen by an I.
63cf6ebbb3SpjanzenThe snake is 6 squares long and is represented by s's with an S at the head.
64f43998fdSpjanzenThe money is $, and an exit is #.
65f43998fdSpjanzenYour score is posted in the upper left hand corner.
66f43998fdSpjanzen.Pp
67f43998fdSpjanzenYou can move around using the same conventions as
68f43998fdSpjanzen.Xr vi 1 :
69f43998fdSpjanzenthat is, the
70f43998fdSpjanzen.Ic h ,
71f43998fdSpjanzen.Ic j ,
72f43998fdSpjanzen.Ic k ,
73f43998fdSpjanzenand
74f43998fdSpjanzen.Ic l
75f43998fdSpjanzenkeys work, as do the arrow keys.
76f43998fdSpjanzenOther possibilities include:
77f43998fdSpjanzen.Bl -tag -width indent
78f43998fdSpjanzen.It Ic sefc
79f43998fdSpjanzenThese keys are like hjkl but form a directed pad around the d key.
80f43998fdSpjanzen.It Ic HJKL
81f43998fdSpjanzenThese keys move you all the way in the indicated direction to the
823bfc9584Spjanzensame row or column as the money.
833bfc9584SpjanzenThis does
84f43998fdSpjanzen.Em not
85f43998fdSpjanzenlet you jump away from the snake, but rather saves you from having
863bfc9584Spjanzento type a key repeatedly.
87*25a24f0bSjsgThe snake still gets all its turns.
88f43998fdSpjanzen.It Ic SEFC
89f43998fdSpjanzenLikewise for the upper case versions on the left.
90f43998fdSpjanzen.It Ic ATPB
91f43998fdSpjanzenThese keys move you to the four edges of the screen.
92322015dfSjmcTheir position on the keyboard is mnemonic, e.g.\&
93f43998fdSpjanzenP is at the far right of the keyboard.
94f43998fdSpjanzen.It Ic x
95f43998fdSpjanzenThis lets you quit the game at any time.
96f43998fdSpjanzen.It Ic p
97f43998fdSpjanzenSometimes points in a direction you might want to go.
98f43998fdSpjanzen.It Ic w
99f43998fdSpjanzenSpace warp to get out of tight squeezes, at a price.
100f43998fdSpjanzen.El
101f43998fdSpjanzen.Pp
102f43998fdSpjanzenTo earn money, move to the same square the money is on.
103f43998fdSpjanzenA new $ will appear when you earn the current one.
104f43998fdSpjanzenAs you get richer, the snake gets hungrier.
105f43998fdSpjanzenTo leave the game, move to the exit (#).
106f43998fdSpjanzen.Pp
107f43998fdSpjanzenA record is kept of the personal best score of each player.
108f43998fdSpjanzenScores are only counted if you leave at the exit.
109f43998fdSpjanzenGetting eaten by the snake is worth nothing.
110f43998fdSpjanzen.Pp
111f43998fdSpjanzenAs in pinball, matching the last digit of your score to the number
112f43998fdSpjanzenwhich appears after the game is worth a bonus.
113f43998fdSpjanzen.Pp
114f43998fdSpjanzenTo see who wastes time playing snake, run
115f43998fdSpjanzen.Nm snake
116f43998fdSpjanzen.Fl s .
117f527bb56Stb.Sh ENVIRONMENT
118121e3757Sjmc.Bl -tag -width $HOME/.snake.scores
119fa83b613Stb.It Ev LOGNAME
120f527bb56StbName displayed in high score file.
121f43998fdSpjanzen.El
122f527bb56Stb.Sh FILES
123121e3757Sjmc.Bl -tag -width $HOME/.snake.scores
124f527bb56Stb.It Pa $HOME/.snake.scores
125121e3757SjmcDatabase of personal bests.
126f527bb56Stb.\".It Pa $HOME/.snake.log
127f527bb56Stb.\"log of games played
128121e3757Sjmc.El
129f43998fdSpjanzen.Sh BUGS
130f43998fdSpjanzenWhen playing on a small screen,
131f43998fdSpjanzenit's hard to tell when you hit the edge of the screen.
132f43998fdSpjanzen.Pp
133f43998fdSpjanzenThe scoring function takes into account the size of the screen.
134f43998fdSpjanzenA perfect function to do this equitably has not been devised.
135