User Tools

Site Tools


sdb:wumpus_game

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
sdb:wumpus_game [2026/02/19 11:36] – created appledogsdb:wumpus_game [2026/02/19 12:49] (current) appledog
Line 2: Line 2:
  
 == About == About
 +* Wumpus draws from 1973 Hunt the Wumpus, with growling clues in grid caves.
 * Originally written by Neo on a C128 simulator when he was 11, as homework for his programming class. * Originally written by Neo on a C128 simulator when he was 11, as homework for his programming class.
 * Ported to Stellar BASIC 1.0 in 2026. * Ported to Stellar BASIC 1.0 in 2026.
 +
 +The history traces back to Gregory Yob, a University of Massachusetts student, who coded the original in FORTRAN IV in spring 1973 on a PDP-10 mainframe. Frustrated by flat-grid "hide-and-seek" games like Hunt the Hurkle (1972) and Mugwump, Yob built a twisty cave system for immersion, drawing from D&D-like exploration. It exploded in popularity via the People's Computer Company newsletter and Creative Computing magazine (1975 BASIC port), becoming one of the first widely shared PC games alongside Hammurabi and Lunar Lander. Ports appeared everywhere -- TRS-80, Apple II, Atari, even modern remakes -- and it influenced roguelikes (ex. NetHack has a wumpus), AI logic puzzles (the "Wumpus World" in Russell & Norvig's AI: A Modern Approach), and Discord's adorable dragon mascot.
 +
 +== Developer's Commentary
 +=== Neo says
 +I wrote this program in about 30 minutes. Its a random small light game.
 +
 +The WUMPUS and the exit door was supposed to start at the walls but I just made it spawn anywhere in the room (to keep the program smaller). It feels weird having a random exit door anywhere, but it's simpler this way.
 +
 +=== Appledog says
 +I made some QOL changes such as making sure the wumpus and the exit don't spawn on top of the player. Mostly I tried not to modify Neo's code too much but there were a few issues because he didn't have access to the system when he wrote the code (!!). For example he didn't know there was no support for negative numbers.
 +
 +Of special note are lines 310 and 330:
 +
 +    310 IF E > 100 THEN GOTO 5000   : REM CAUGHT WRAP-AROUND FROM MOVING WEST OF 0
 +    
 +    330 IF F > 100 THEN GOTO 5200   : REM CAUGHT WRAP-AROUND FROM MOVING SOUTH OF 0
 +
 +The issue here is that Stellar BASIC 1.0 is a TinyBASIC, and therefore it does not support negative numbers. The test here is if it rolls over into negative numbers, it will appear as 65535 or such.
 +
 +Also, the lines such as:
 +
 +    6030 IF I > 100 THEN LET I = A - E
 +    6040 IF J > 100 THEN LET J = B - F
 +
 +are part of an absolute value comparison. You may ask why 100 was chosen as the number to test for the rollover. We could have used 16, 20 or 1000-- any number greater than the biggest possible number on the grid, 15 (i.e. 15-0).
 +
 +The original code did not have rollover detection, and I asked Neo if this was intentional. He said no. So I quickly drafted the code at 5000-5500 to do rollover detection. I also came up with the RAND to move the WUMPUS since Neo's code relied on a differential (which relied on negative numbers). So I did it to (ex. E < A) to compare the position that way. A minor but useful change.
  
 == Program Listing == Program Listing
Line 17: Line 46:
 90 PRINT "GOOD LUCK" 90 PRINT "GOOD LUCK"
 100 LET A = RAND(16) 100 LET A = RAND(16)
-110 IF A = 8 GOTO 100+110 IF A = 8 THEN GOTO 100
 120 LET B = RAND(16) 120 LET B = RAND(16)
-130 IF B = 8 GOTO 120+130 IF B = 8 THEN GOTO 120
 140 LET C = RAND(16) 140 LET C = RAND(16)
 150 LET D = RAND(16) 150 LET D = RAND(16)
Line 104: Line 133:
  
 9001 REM END 9001 REM END
-</codify> +</codify> 
 + 
 +== Bugs 
 +There is a quite rare //(but also quite shiny!)// bug in the code! Oh no! If you can find the bug, let us know and you will have your name added to the WUMPUS GAME HALL OF FAME below: 
 + 
 +=== WUMPUS GAME HALL OF FAME 
 +* Appledog 
 +* Neo
sdb/wumpus_game.1771500990.txt.gz · Last modified: by appledog

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki