Skip to content

Commit

Permalink
Merge pull request #83 from ruv/patch-1
Browse files Browse the repository at this point in the history
Fix a bug in examples/wumpus.p4
  • Loading branch information
SirWumpus authored Nov 29, 2024
2 parents 0a26e74 + 7530a92 commit ef3b784
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/wumpus.p4
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,15 @@ CREATE shoot-path 5 CELLS ALLOT
;

: shoot-distance ( -- dist )
BEGIN
0 BEGIN ( dist-wrong ) DROP
." NO. OF ROOMS(1-5) " PAD /PAD ACCEPT \ S: len
DROP 0 S>D PAD /PAD >NUMBER 2DROP D>S \ S: dist
DUP 1 6 WITHIN \ S: dist bool
UNTIL \ S: dist
;

: shoot-room ( -- room )
BEGIN
0 BEGIN ( room-wrong ) DROP
." ROOM# " PAD /PAD ACCEPT \ S: len
DROP 0 S>D PAD /PAD >NUMBER 2DROP D>S \ S: room
DUP 1 max_rooms WITHIN \ S: room bool
Expand Down

0 comments on commit ef3b784

Please sign in to comment.