/* 635 PRINT "BATS NEARBY!" */
/* 640 NEXT K */
/* 645 NEXT J */
- for (k = 0; k < 3; k++)
+ for (j = WUMPUS; j < LOCS; j++)
{
- int room = cave[loc[YOU]][k];
-
- if (room == loc[WUMPUS])
- (void) puts("I SMELL A WUMPUS!");
- else if (room == loc[PIT1] || room == loc[PIT2])
- (void) puts("I FEEL A DRAFT");
- else if (room == loc[BATS1] || room == loc[BATS2])
- (void) puts("BATS NEARBY!");
+ for (k = 0; k < 3; k++)
+ {
+ if (cave[loc[YOU]][k] != loc[j])
+ continue;
+
+ if (j == WUMPUS)
+ (void) puts("I SMELL A WUMPUS!");
+ else if (j == PIT1 || j == PIT2)
+ (void) puts("I FEEL A DRAFT");
+ else if (j == BATS1 || j == BATS2)
+ (void) puts("BATS NEARBY!");
+ }
}
/* 650 PRINT "YOU ARE IN ROOM "L(1) */