Wed Aug 5 04:03:47 2009 UTC ()
Use getopt instead of hand-rolled options code. Document all the arguments
and options. Don't allow the previously undocumented method to change the
maximum number of scores kept per user to be used on the system-wide high
score file. Sort options list in the man page. Bump its date.


(dholland)
diff -r1.29 -r1.30 src/games/robots/main.c
diff -r1.14 -r1.15 src/games/robots/robots.6

cvs diff -r1.29 -r1.30 src/games/robots/main.c (switch to unified diff)

--- src/games/robots/main.c 2009/07/20 06:43:18 1.29
+++ src/games/robots/main.c 2009/08/05 04:03:47 1.30
@@ -1,237 +1,235 @@ @@ -1,237 +1,235 @@
1/* $NetBSD: main.c,v 1.29 2009/07/20 06:43:18 dholland Exp $ */ 1/* $NetBSD: main.c,v 1.30 2009/08/05 04:03:47 dholland Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1980, 1993 4 * Copyright (c) 1980, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors 15 * 3. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software 16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission. 17 * without specific prior written permission.
18 * 18 *
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE. 29 * SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33#ifndef lint 33#ifndef lint
34__COPYRIGHT("@(#) Copyright (c) 1980, 1993\ 34__COPYRIGHT("@(#) Copyright (c) 1980, 1993\
35 The Regents of the University of California. All rights reserved."); 35 The Regents of the University of California. All rights reserved.");
36#endif /* not lint */ 36#endif /* not lint */
37 37
38#ifndef lint 38#ifndef lint
39#if 0 39#if 0
40static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93"; 40static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
41#else 41#else
42__RCSID("$NetBSD: main.c,v 1.29 2009/07/20 06:43:18 dholland Exp $"); 42__RCSID("$NetBSD: main.c,v 1.30 2009/08/05 04:03:47 dholland Exp $");
43#endif 43#endif
44#endif /* not lint */ 44#endif /* not lint */
45 45
46#include <ctype.h> 46#include <ctype.h>
47#include <curses.h> 47#include <curses.h>
48#include <err.h> 48#include <err.h>
49#include <errno.h> 49#include <errno.h>
50#include <fcntl.h> 50#include <fcntl.h>
51#include <signal.h> 51#include <signal.h>
52#include <stdlib.h> 52#include <stdlib.h>
53#include <time.h> 53#include <time.h>
54#include <unistd.h> 54#include <unistd.h>
55#include "robots.h" 55#include "robots.h"
56 56
57extern const char *Scorefile; 57extern const char *Scorefile;
58extern int Max_per_uid; 58extern int Max_per_uid;
59 59
60int 60int
61main(int ac, char **av) 61main(int argc, char **argv)
62{ 62{
63 const char *sp; 63 const char *word;
64 bool bad_arg; 
65 bool show_only; 64 bool show_only;
66 int score_wfd; /* high score writable file descriptor */ 65 int score_wfd; /* high score writable file descriptor */
67 int score_err = 0; /* hold errno from score file open */ 66 int score_err = 0; /* hold errno from score file open */
 67 int maximum = 0;
 68 char ch;
 69 int i;
68 70
69 score_wfd = open(Scorefile, O_RDWR); 71 score_wfd = open(Scorefile, O_RDWR);
70 if (score_wfd < 0) 72 if (score_wfd < 0)
71 score_err = errno; 73 score_err = errno;
72 else if (score_wfd < 3) 74 else if (score_wfd < 3)
73 exit(1); 75 exit(1);
74 76
75 /* Revoke setgid privileges */ 77 /* Revoke setgid privileges */
76 setgid(getgid()); 78 setgid(getgid());
77 79
78 show_only = false; 80 show_only = false;
79 Num_games = 1; 81 Num_games = 1;
80 if (ac > 1) { 82
81 bad_arg = false; 83 while ((ch = getopt(argc, argv, "Aajnrst")) != -1) {
82 for (++av; ac > 1 && *av[0]; av++, ac--) 84 switch (ch) {
83 if (av[0][0] != '-') 85 case 'A':
84 if (isdigit((unsigned char)av[0][0])) 86 Auto_bot = true;
85 Max_per_uid = atoi(av[0]); 87 break;
86 else { 88 case 'a':
87 Scorefile = av[0]; 89 Start_level = 4;
88 if (score_wfd >= 0) 90 break;
89 close(score_wfd); 91 case 'j':
90 score_wfd = open(Scorefile, O_RDWR); 92 Jump = true;
91 if (score_wfd < 0) 93 break;
92 score_err = errno; 94 case 'n':
 95 Num_games++;
 96 break;
 97 case 'r':
 98 Real_time = true;
 99 break;
 100 case 's':
 101 show_only = true;
 102 break;
 103 case 't':
 104 Teleport = true;
 105 break;
 106 default:
 107 errx(1,
 108 "Usage: robots [-Aajnrst] [maximum] [scorefile]");
 109 break;
 110 }
 111 }
 112
 113 for (i = optind; i < argc; i++) {
 114 word = argv[i];
 115 if (isdigit((unsigned char)word[0])) {
 116 maximum = atoi(word);
 117 } else {
 118 Scorefile = word;
 119 Max_per_uid = maximum;
 120 if (score_wfd >= 0)
 121 close(score_wfd);
 122 score_wfd = open(Scorefile, O_RDWR);
 123 if (score_wfd < 0)
 124 score_err = errno;
93#ifdef FANCY 125#ifdef FANCY
94 sp = strrchr(Scorefile, '/'); 126 word = strrchr(Scorefile, '/');
95 if (sp == NULL) 127 if (word == NULL)
96 sp = Scorefile; 128 word = Scorefile;
97 if (strcmp(sp, "pattern_roll") == 0) 129 if (strcmp(word, "pattern_roll") == 0)
98 Pattern_roll = true; 130 Pattern_roll = true;
99 else if (strcmp(sp, "stand_still") == 0) 131 else if (strcmp(word, "stand_still") == 0)
100 Stand_still = true; 132 Stand_still = true;
101 if (Pattern_roll || Stand_still) 133 if (Pattern_roll || Stand_still)
102 Teleport = true; 134 Teleport = true;
103#endif 135#endif
104 } 
105 else 
106 for (sp = &av[0][1]; *sp; sp++) 
107 switch (*sp) { 
108 case 'A': 
109 Auto_bot = true; 
110 break; 
111 case 's': 
112 show_only = true; 
113 break; 
114 case 'r': 
115 Real_time = true; 
116 break; 
117 case 'a': 
118 Start_level = 4; 
119 break; 
120 case 'n': 
121 Num_games++; 
122 break; 
123 case 'j': 
124 Jump = true; 
125 break; 
126 case 't': 
127 Teleport = true; 
128 break; 
129 
130 default: 
131 fprintf(stderr, "robots: unknown option: %c\n", *sp); 
132 bad_arg = true; 
133 break; 
134 } 
135 if (bad_arg) { 
136 exit(1); 
137 /* NOTREACHED */ 
138 } 136 }
139 } 137 }
140 138
141 if (show_only) { 139 if (show_only) {
142 show_score(); 140 show_score();
143 exit(0); 141 exit(0);
144 /* NOTREACHED */ 142 /* NOTREACHED */
145 } 143 }
146 144
147 if (score_wfd < 0) { 145 if (score_wfd < 0) {
148 errno = score_err; 146 errno = score_err;
149 warn("%s", Scorefile); 147 warn("%s", Scorefile);
150 warnx("High scores will not be recorded!"); 148 warnx("High scores will not be recorded!");
151 sleep(2); 149 sleep(2);
152 } 150 }
153 151
154 if (!initscr()) 152 if (!initscr())
155 errx(0, "couldn't initialize screen"); 153 errx(0, "couldn't initialize screen");
156 signal(SIGINT, quit); 154 signal(SIGINT, quit);
157 cbreak(); 155 cbreak();
158 noecho(); 156 noecho();
159 nonl(); 157 nonl();
160 if (LINES != Y_SIZE || COLS != X_SIZE) { 158 if (LINES != Y_SIZE || COLS != X_SIZE) {
161 if (LINES < Y_SIZE || COLS < X_SIZE) { 159 if (LINES < Y_SIZE || COLS < X_SIZE) {
162 endwin(); 160 endwin();
163 printf("Need at least a %dx%d screen\n", 161 printf("Need at least a %dx%d screen\n",
164 Y_SIZE, X_SIZE); 162 Y_SIZE, X_SIZE);
165 exit(1); 163 exit(1);
166 } 164 }
167 delwin(stdscr); 165 delwin(stdscr);
168 stdscr = newwin(Y_SIZE, X_SIZE, 0, 0); 166 stdscr = newwin(Y_SIZE, X_SIZE, 0, 0);
169 } 167 }
170 168
171 srandom(time(NULL)); 169 srandom(time(NULL));
172 if (Real_time) 170 if (Real_time)
173 signal(SIGALRM, move_robots); 171 signal(SIGALRM, move_robots);
174 do { 172 do {
175 while (Num_games--) { 173 while (Num_games--) {
176 init_field(); 174 init_field();
177 for (Level = Start_level; !Dead; Level++) { 175 for (Level = Start_level; !Dead; Level++) {
178 make_level(); 176 make_level();
179 play_level(); 177 play_level();
180 if (Auto_bot) 178 if (Auto_bot)
181 sleep(1); 179 sleep(1);
182 } 180 }
183 move(My_pos.y, My_pos.x); 181 move(My_pos.y, My_pos.x);
184 printw("AARRrrgghhhh...."); 182 printw("AARRrrgghhhh....");
185 refresh(); 183 refresh();
186 if (Auto_bot) 184 if (Auto_bot)
187 sleep(1); 185 sleep(1);
188 score(score_wfd); 186 score(score_wfd);
189 if (Auto_bot) 187 if (Auto_bot)
190 sleep(1); 188 sleep(1);
191 refresh(); 189 refresh();
192 } 190 }
193 Num_games = 1; 191 Num_games = 1;
194 } while (!Auto_bot && another()); 192 } while (!Auto_bot && another());
195 quit(0); 193 quit(0);
196 /* NOTREACHED */ 194 /* NOTREACHED */
197 return(0); 195 return(0);
198} 196}
199 197
200/* 198/*
201 * quit: 199 * quit:
202 * Leave the program elegantly. 200 * Leave the program elegantly.
203 */ 201 */
204void 202void
205quit(int dummy __unused) 203quit(int dummy __unused)
206{ 204{
207 endwin(); 205 endwin();
208 exit(0); 206 exit(0);
209 /* NOTREACHED */ 207 /* NOTREACHED */
210} 208}
211 209
212/* 210/*
213 * another: 211 * another:
214 * See if another game is desired 212 * See if another game is desired
215 */ 213 */
216bool 214bool
217another(void) 215another(void)
218{ 216{
219 int y; 217 int y;
220 218
221#ifdef FANCY 219#ifdef FANCY
222 if ((Stand_still || Pattern_roll) && !Newscore) 220 if ((Stand_still || Pattern_roll) && !Newscore)
223 return true; 221 return true;
224#endif 222#endif
225 223
226 if (query("Another game?")) { 224 if (query("Another game?")) {
227 if (Full_clear) { 225 if (Full_clear) {
228 for (y = 1; y <= Num_scores; y++) { 226 for (y = 1; y <= Num_scores; y++) {
229 move(y, 1); 227 move(y, 1);
230 clrtoeol(); 228 clrtoeol();
231 } 229 }
232 refresh(); 230 refresh();
233 } 231 }
234 return true; 232 return true;
235 } 233 }
236 return false; 234 return false;
237} 235}

cvs diff -r1.14 -r1.15 src/games/robots/robots.6 (switch to unified diff)

--- src/games/robots/robots.6 2009/04/09 03:52:54 1.14
+++ src/games/robots/robots.6 2009/08/05 04:03:47 1.15
@@ -1,156 +1,169 @@ @@ -1,156 +1,169 @@
1.\" $NetBSD: robots.6,v 1.14 2009/04/09 03:52:54 joerg Exp $ 1.\" $NetBSD: robots.6,v 1.15 2009/08/05 04:03:47 dholland Exp $
2.\" 2.\"
3.\" Copyright (c) 1991, 1993 3.\" Copyright (c) 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors 14.\" 3. Neither the name of the University nor the names of its contributors
15.\" may be used to endorse or promote products derived from this software 15.\" may be used to endorse or promote products derived from this software
16.\" without specific prior written permission. 16.\" without specific prior written permission.
17.\" 17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE. 28.\" SUCH DAMAGE.
29.\" 29.\"
30.\" @(#)robots.6 8.1 (Berkeley) 5/31/93 30.\" @(#)robots.6 8.1 (Berkeley) 5/31/93
31.\" 31.\"
32.Dd May 31, 1993 32.Dd August 4, 2009
33.Dt ROBOTS 6 33.Dt ROBOTS 6
34.Os 34.Os
35.Sh NAME 35.Sh NAME
36.Nm robots 36.Nm robots
37.Nd fight off villainous robots 37.Nd fight off villainous robots
38.Sh SYNOPSIS 38.Sh SYNOPSIS
39.Nm 39.Nm
40.Op Fl Asjtan 40.Op Fl Aajnrst
 41.Op Ar maximum
41.Op Ar scorefile 42.Op Ar scorefile
42.Sh DESCRIPTION 43.Sh DESCRIPTION
43.Nm 44.Nm
44pits you against evil robots, who are trying to kill you (which is why 45pits you against evil robots, who are trying to kill you (which is why
45they are evil). 46they are evil).
46Fortunately for you, even though they are evil, they are not very bright 47Fortunately for you, even though they are evil, they are not very bright
47and have a habit of bumping into each other, thus destroying themselves. 48and have a habit of bumping into each other, thus destroying themselves.
48In order to survive, you must get them to kill each other off, since you 49In order to survive, you must get them to kill each other off, since you
49have no offensive weaponry. 50have no offensive weaponry.
50.Pp 51.Pp
51Since you are stuck without offensive weaponry, you are endowed with one 52Since you are stuck without offensive weaponry, you are endowed with one
52piece of defensive weaponry: a teleportation device. 53piece of defensive weaponry: a teleportation device.
53When two robots run into each other or a junk pile, they die. 54When two robots run into each other or a junk pile, they die.
54If a robot runs into you, you die. 55If a robot runs into you, you die.
55When a robot dies, you get 10 points, and when all the robots die, 56When a robot dies, you get 10 points, and when all the robots die,
56you start on the next field. 57you start on the next field.
57This keeps up until they finally get you. 58This keeps up until they finally get you.
58.Pp 59.Pp
59Robots are represented on the screen by a 60Robots are represented on the screen by a
60.Sq \&+ , 61.Sq \&+ ,
61the junk heaps from their collisions by a 62the junk heaps from their collisions by a
62.Sq \(** , 63.Sq \(** ,
63and you 64and you
64(the good guy) 65(the good guy)
65by a 66by a
66.Sq @ . 67.Sq @ .
67.Pp 68.Pp
68The commands are: 69The commands are:
69.Bl -tag -width indent -compact 70.Bl -tag -width indent -compact
70.It Ic h 71.It Ic h
71move one square left 72move one square left
72.It Ic l 73.It Ic l
73move one square right 74move one square right
74.It Ic k 75.It Ic k
75move one square up 76move one square up
76.It Ic j 77.It Ic j
77move one square down 78move one square down
78.It Ic y 79.It Ic y
79move one square up and left 80move one square up and left
80.It Ic u 81.It Ic u
81move one square up and right 82move one square up and right
82.It Ic b 83.It Ic b
83move one square down and left 84move one square down and left
84.It Ic n 85.It Ic n
85move one square down and right 86move one square down and right
86.It Ic \&. 87.It Ic \&.
87(also space) do nothing for one turn 88(also space) do nothing for one turn
88.It Ic HJKLBNYU 89.It Ic HJKLBNYU
89run as far as possible in the given direction 90run as far as possible in the given direction
90.It Ic \*[Gt] 91.It Ic \*[Gt]
91do nothing for as long as possible 92do nothing for as long as possible
92.It Ic t 93.It Ic t
93teleport to a random location 94teleport to a random location
94.It Ic w 95.It Ic w
95wait until you die or they all do 96wait until you die or they all do
96.It Ic q 97.It Ic q
97quit 98quit
98.It Ic ^L 99.It Ic ^L
99redraw the screen 100redraw the screen
100.El 101.El
101.Pp 102.Pp
102All commands can be preceded by a count. 103All commands can be preceded by a count.
103.Pp 104.Pp
104If you use the 105If you use the
105.Sq Ic w 106.Sq Ic w
106command and survive to the next level, you will get a bonus of 10% 107command and survive to the next level, you will get a bonus of 10%
107for each robot which died after you decided to wait. 108for each robot which died after you decided to wait.
108If you die, however, you get nothing. 109If you die, however, you get nothing.
109For all other commands, the program will save you from typos 110For all other commands, the program will save you from typos
110by stopping short of being eaten. 111by stopping short of being eaten.
111However, with 112However, with
112.Sq Ic w 113.Sq Ic w
113you take the risk of dying by miscalculation. 114you take the risk of dying by miscalculation.
114.Pp 115.Pp
115Only five scores are allowed per user on the score file. 116Only five scores are allowed per user on the score file.
116If you make it into the score file, you will be shown the list at the end 117If you make it into the score file, you will be shown the list at the end
117of the game. 118of the game.
118If an alternative score file is specified, that will be used instead of the 119If an alternative score file is named on the command line, that file
119standard file for scores. 120will be used instead of the standard file for scores.
 121The score file must be created empty beforehand, e.g. with
 122.Xr touch 1 .
 123If the argument
 124.Ar maximum ,
 125which must be a number, is provided when a score file is first used,
 126the value given will be used as the maximum number of scores to keep
 127per user instead of the default five.
 128This value is a property of the score file and cannot be changed later.
120.Pp 129.Pp
121The options are 130The options are
122.Bl -tag -width indent 131.Bl -tag -width indent
123.It Fl s 132.It Fl A
124Don't play, just show the score file. 133Auto-bot mode.
 134Lets the game play itself.
 135.It Fl a
 136Advance into the higher levels directly, skipping the lower, easier levels.
125.It Fl j 137.It Fl j
126Jump, 138Jump,
127.Em i.e. , 139.Em i.e. ,
128when you run, don't show any intermediate positions; only show things at 140when you run, don't show any intermediate positions; only show things at
129the end. 141the end.
130This is useful on slow terminals. 142This is useful on slow terminals.
 143.It Fl n
 144Increase the number of games played by one; that is, automatically
 145choose to play again one time per usage of this option.
 146.It Fl r
 147Play in real time; that is, if you do nothing for a few seconds the
 148game will assume you meant to do nothing and move the robots.
 149.It Fl s
 150Don't play, just show the score file.
131.It Fl t 151.It Fl t
132Teleport automatically when you have no other option. 152Teleport automatically when you have no other option.
133This is a little disconcerting until you get used to it, and then it is 153This is a little disconcerting until you get used to it, and then it is
134very nice. 154very nice.
135.It Fl a 
136Advance into the higher levels directly, skipping the lower, easier levels. 
137.It Fl A 
138Auto-bot mode. 
139Lets the game play itself. 
140.It Fl n 
141Increase the number of games played by one. 
142.El 155.El
143.Sh FILES 156.Sh FILES
144.Bl -tag -width /var/games/robots_roll -compact 157.Bl -tag -width /var/games/robots_roll -compact
145.It Pa /var/games/robots_roll 158.It Pa /var/games/robots_roll
146the score file 159The score file.
147.El 160.El
148.Sh AUTHORS 161.Sh AUTHORS
149.An Ken Arnold 162.An Ken Arnold
150.An Christos Zoulas 163.An Christos Zoulas
151(autobot mode) 164(autobot mode)
152.Sh BUGS 165.Sh BUGS
153Bugs? 166Bugs?
154You 167You
155.Em crazy , 168.Em crazy ,
156man?!? 169man?!?