projects
/
wumpus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix two minor bugs.
[wumpus.git]
/
wumpus.c
diff --git
a/wumpus.c
b/wumpus.c
index 21e56e8eb82c9791cd93a06cdc69031318fb7d60..8b3cc47354eab835e2b27ea8fcb2a9ebaceb4d21 100644
(file)
--- a/
wumpus.c
+++ b/
wumpus.c
@@
-1,7
+1,7
@@
/*
* wumpus.c --- a faithful translation of the classic "Hunt The Wumpus" game.
*
/*
* wumpus.c --- a faithful translation of the classic "Hunt The Wumpus" game.
*
- * Translator: Eric S. Raymond <e
ric
@snark.thyrsus.com>
+ * Translator: Eric S. Raymond <e
sr
@snark.thyrsus.com>
* Version: $Id$
*
* This was the state of the art 20 years ago, in 1972. We've come a long
* Version: $Id$
*
* This was the state of the art 20 years ago, in 1972. We've come a long
@@
-342,9
+342,7
@@
badrange:
/* this simulates logic at 895 in the BASIC code */
check_shot();
/* this simulates logic at 895 in the BASIC code */
check_shot();
- if (finished == NOT)
- goto ammo;
- else
+ if (finished != NOT)
return;
}
return;
}
@@
-511,7
+509,8
@@
goodmove:
/* 1145 RETURN */
/* 1150 END */
(void) puts("ZAP--SUPER BAT SNATCH! ELSEWHEREVILLE FOR YOU!");
/* 1145 RETURN */
/* 1150 END */
(void) puts("ZAP--SUPER BAT SNATCH! ELSEWHEREVILLE FOR YOU!");
- loc[YOU] = FNA();
+ scratchloc = loc[YOU] = FNA();
+ goto goodmove;
}
}
}
}
@@
-521,10
+520,10
@@
char *argv[];
{
int c;
{
int c;
- if (strcmp(argv[1], "-s") == 0)
- srand(ato
l
(argv[2]));
+ if (
argc >= 2 &&
strcmp(argv[1], "-s") == 0)
+ srand(ato
i
(argv[2]));
else
else
- srand(time((long *) 0));
+ srand(
(int)
time((long *) 0));
/* 15 PRINT "INSTRUCTIONS (Y-N)"; */
/* 20 INPUT I$ */
/* 15 PRINT "INSTRUCTIONS (Y-N)"; */
/* 20 INPUT I$ */