mirror of
https://github.com/vattam/BSDGames.git
synced 2025-12-21 03:14:50 +00:00
New upstream source
git-svn-id: file:///srv/svn/joey/bsdgames-trunk@5102 a4a2c43b-8ac3-0310-8836-e0e880c912e2
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: main.c,v 1.7 1997/10/12 14:16:26 lukem Exp $ */
|
||||
/* $NetBSD: main.c,v 1.11 1999/09/12 09:02:22 jsm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: main.c,v 1.7 1997/10/12 14:16:26 lukem Exp $");
|
||||
__RCSID("$NetBSD: main.c,v 1.11 1999/09/12 09:02:22 jsm Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -74,6 +74,7 @@ main(ac, av)
|
||||
setregid(getgid(), getgid());
|
||||
|
||||
show_only = FALSE;
|
||||
Num_games = 1;
|
||||
if (ac > 1) {
|
||||
bad_arg = FALSE;
|
||||
for (++av; ac > 1 && *av[0]; av++, ac--)
|
||||
@@ -102,6 +103,9 @@ main(ac, av)
|
||||
else
|
||||
for (sp = &av[0][1]; *sp; sp++)
|
||||
switch (*sp) {
|
||||
case 'A':
|
||||
Auto_bot = TRUE;
|
||||
break;
|
||||
case 's':
|
||||
show_only = TRUE;
|
||||
break;
|
||||
@@ -111,12 +115,16 @@ main(ac, av)
|
||||
case 'a':
|
||||
Start_level = 4;
|
||||
break;
|
||||
case 'n':
|
||||
Num_games++;
|
||||
break;
|
||||
case 'j':
|
||||
Jump = TRUE;
|
||||
break;
|
||||
case 't':
|
||||
Teleport = TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "robots: uknown option: %c\n", *sp);
|
||||
bad_arg = TRUE;
|
||||
@@ -135,6 +143,7 @@ main(ac, av)
|
||||
}
|
||||
|
||||
if (score_wfd < 0) {
|
||||
errno = score_err;
|
||||
warn("%s", Scorefile);
|
||||
warnx("High scores will not be recorded!");
|
||||
sleep(2);
|
||||
@@ -160,16 +169,25 @@ main(ac, av)
|
||||
if (Real_time)
|
||||
signal(SIGALRM, move_robots);
|
||||
do {
|
||||
init_field();
|
||||
for (Level = Start_level; !Dead; Level++) {
|
||||
make_level();
|
||||
play_level();
|
||||
while (Num_games--) {
|
||||
init_field();
|
||||
for (Level = Start_level; !Dead; Level++) {
|
||||
make_level();
|
||||
play_level();
|
||||
if (Auto_bot)
|
||||
sleep(1);
|
||||
}
|
||||
move(My_pos.y, My_pos.x);
|
||||
printw("AARRrrgghhhh....");
|
||||
refresh();
|
||||
if (Auto_bot)
|
||||
sleep(1);
|
||||
score(score_wfd);
|
||||
if (Auto_bot)
|
||||
sleep(1);
|
||||
refresh();
|
||||
}
|
||||
move(My_pos.y, My_pos.x);
|
||||
printw("AARRrrgghhhh....");
|
||||
refresh();
|
||||
score(score_wfd);
|
||||
} while (another());
|
||||
} while (!Auto_bot && another());
|
||||
quit(0);
|
||||
/* NOTREACHED */
|
||||
return(0);
|
||||
|
||||
Reference in New Issue
Block a user