Magic-number elimination.

This commit is contained in:
Eric S. Raymond 2017-06-06 21:06:16 -04:00
parent e4f8218d9c
commit 3b8122ae3a
3 changed files with 4 additions and 3 deletions

View file

@ -198,7 +198,7 @@ L9128: RSPEAK(SPK);
RSPEAK(6); RSPEAK(6);
DSTROY(OGRE); DSTROY(OGRE);
K=0; K=0;
for (I=1; I<=5; I++) { for (I=1; I < PIRATE; I++) {
if(DLOC[I] == LOC) { if(DLOC[I] == LOC) {
K=K+1; K=K+1;
DLOC[I]=61; DLOC[I]=61;

View file

@ -3,6 +3,7 @@
#define LINESIZE 100 #define LINESIZE 100
#define NDWARVES 6 #define NDWARVES 6
#define PIRATE NDWARVES /* must be NDWARVES-1 when zero-origin */
typedef struct lcg_state typedef struct lcg_state
{ {

2
init.c
View file

@ -330,7 +330,7 @@ L1106: /*etc*/ ;
CHLOC=114; CHLOC=114;
CHLOC2=140; CHLOC2=140;
for (I=1; I<=6; I++) { for (I=1; I<=NDWARVES; I++) {
DSEEN[I]=false; DSEEN[I]=false;
} /* end loop */ } /* end loop */
DFLAG=0; DFLAG=0;