projects
/
open-adventure.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e9aff25
)
Boolify some logical variables.
author
Eric S. Raymond
<esr@thyrsus.com>
Mon, 19 Jun 2017 16:49:07 +0000
(12:49 -0400)
committer
Eric S. Raymond
<esr@thyrsus.com>
Mon, 19 Jun 2017 17:21:15 +0000
(13:21 -0400)
advent.h
patch
|
blob
|
history
main.c
patch
|
blob
|
history
diff --git
a/advent.h
b/advent.h
index f578eb0a4818ebf78e02967c4e8322c2a62bc6f6..0bf87bb7f7991bc0214a4fe1a0c42cf12a794f86 100644
(file)
--- a/
advent.h
+++ b/
advent.h
@@
-32,9
+32,9
@@
struct game_t {
long chloc2;
long clock1;
long clock2;
long chloc2;
long clock1;
long clock2;
- long clshnt;
- long closed;
- long closng;
+ bool clshnt; /* has player read the clue in the endgame? */
+ bool closed; /* whether we're all the way closed */
+ bool closng; /* whether it's closing time yet */
long conds;
long detail;
long dflag;
long conds;
long detail;
long dflag;
@@
-45,22
+45,22
@@
struct game_t {
long iwest;
long knfloc;
long limit;
long iwest;
long knfloc;
long limit;
- long lmwarn;
+ bool lmwarn; /* has player been warned about lamp going dim? */
long loc;
long newloc;
long loc;
long newloc;
- long novice;
+ bool novice; /* asked for instructions at start-up? */
long numdie;
long oldloc;
long oldlc2;
long oldobj;
long numdie;
long oldloc;
long oldlc2;
long oldobj;
- long panic;
+ bool panic; /* has player found out he's trapped in the cave? */
long saved;
long tally;
long thresh;
long trndex;
long trnluz;
long turns;
long saved;
long tally;
long thresh;
long trndex;
long trnluz;
long turns;
- long wzdark;
+ bool wzdark; /* whether the loc he's leaving was dark */
long zzword;
long abbrev[LOCSIZ + 1];
long atloc[LOCSIZ + 1];
long zzword;
long abbrev[LOCSIZ + 1];
long atloc[LOCSIZ + 1];
diff --git
a/main.c
b/main.c
index c7c58e3e480244a2bb3198917aaef716ed09010b..c1272c4281ae0b14b8edb10851ca209535d62baf 100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-131,16
+131,6
@@
int main(int argc, char *argv[])
linenoiseHistorySetMaxLen(350);
linenoiseHistorySetMaxLen(350);
- /* Logical variables:
- *
- * game.closed says whether we're all the way closed
- * game.closng says whether it's closing time yet
- * game.clshnt says whether he's read the clue in the endgame
- * game.lmwarn says whether he's been warned about lamp going dim
- * game.novice says whether he asked for instructions at start-up
- * game.panic says whether he's found out he's trapped in the cave
- * game.wzdark says whether the loc he's leaving was dark */
-
/* Initialize our LCG PRNG with parameters tested against
* Knuth vol. 2. by the original authors */
game.lcg_a = 1093;
/* Initialize our LCG PRNG with parameters tested against
* Knuth vol. 2. by the original authors */
game.lcg_a = 1093;