1 RANDOMIZE VAL(RIGHT$(TIME$,5)):NN=INT(RND(1)*100)+1
10 REM HUNT THE WUMPUS
20 REM
30 REM Computer Types: MOST COMPUTERS
40 REM
50 REM Language Required: BASIC
60 REM
70 REM Approx. Download Time (min.): 6
80 REM
90 REM **************************************
100 REM
110 REM Track down the elusive, but smelly
120 REM
130 REM WUMPUS, while avoiding the hazards
140 REM
150 REM of the cave which he inhabits.
160 REM
170 REM
180 REM *** NOT FOR THE WEAK OF HEART ***
190 REM
200 REM
210 REM
700 FOR I = 1 TO 24
710 PRINT
720 NEXT I
730 REM WUMPUS 1/28/77
740 PRINT"WMP23-HUNT THE WUMPUS"
770 NN=INT(SQR(NN)):FOR II = 1 TO NN:KK=RND(1):NEXT II
780 PRINT
790 PRINT "INSTRUCTIONS(Y OR N)";
800 INPUT I$
810 IF (I$<>"Y") AND (i$<>"y") THEN 830
820 GOSUB 2870
830 REM SET UP CAVE
840 DIM M(8)
850 DIM S(20,3)
860 FOR J=1 TO 20
870 FOR K=1 TO 3
880 READ S(J,K)
890 NEXT K
900 NEXT J
910 DATA 2,5,8,1,3,10,2,4,12,3,5,14,1,4,6
920 DATA 5,7,15,6,8,17,1,7,9,8,10,18,2,9,11
930 DATA 10,12,19,3,11,13,12,14,20,4,13,15,6,14,16
940 DATA 15,17,20,7,16,18,9,17,19,11,18,20,13,16,19
950 REM LOCATE M(J) ARRAY ITEMS
960 REM 1,YOU 2,WUMPUS 3&4,PITS 5&6,BATS 7,BLOCKAGE8,EXIT
970 LET W=0
980 LET F=M1=W
990 FOR J=1 TO 7
1000 LET M(J)=INT(1+RND(1)*20)
1010 NEXT J
1020 REM CHECK FOR CROSSOVERS (IE M(1)=M(2)ETC)
1030 FOR J=1 TO 7
1040 FOR K=J TO 7
1050 IF J=K THEN 1070
1060 IF M(J)=M(K) THEN 970
1070 NEXT K
1080 NEXT J
1090 LET A=5
1100 LET M(8)=M(1)
1110 PRINT
1120 PRINT "ENTRANCE IS IN CAVE ";M(8)
1130 REM MAIN LOOP
1140 IF RND(1)<=.4 THEN 1160
1150 GOSUB 1990
1160 IF RND(1)>=.08 THEN 1190
1170 GOSUB 2530
1180 REM PRINT LOCATION AND HAZARD WARNINGS
1190 PRINT
1200 FOR K=1 TO 3
1210 FOR J=2 TO 6
1220 IF S(M(1),K)<>M(J) THEN 1290
1230 ON J-1 GOTO  1240,1260,1260,1280,1280,1240
1240 PRINT"I SMELL A WUMPUS"
1250 GOTO 1290
1260 PRINT"I FEEL A DRAFT"
1270 GOTO 1290
1280 PRINT"BATS NEARBY"
1290 NEXT J
1300 NEXT K
1310 PRINT"YOU ARE IN CAVE ";M(1)
1320 REM RINGER SUBROUTINES
1330 LET J=INT(RND(1)*40)
1340 IF J=0 OR J>7 THEN 1520
1350 ON J GOTO 1370,1370,1390,1420,1420,1450,1480,1500
1360 GOTO 1520
1370 PRINT"AHA!.WUMPUS TRACKS"
1380 GOTO 1520
1390 PRINT"AHA!..FOUND OLD ARROW, LUCKY YOU"
1400 LET A=A+1
1410 GOTO 1520
1420 PRINT"OOPS, SLIPPED ON SOME LOOSE GRAVEL"
1430 GOSUB 2710
1440 GOTO 1520
1450 PRINT"OOPS, YOU JUST FELL INTO AN UNDERGROUND POOL"
1460 GOSUB 2710
1470 GOTO 1520
1480 PRINT"THIS LOOKS LIKE A NICE CAVE,WHY NOT STOP FOR LUNCH"
1490 GOTO 1520
1500 PRINT"TAKE CARE WITH THAT FLASHLIGHT"
1510 GOTO  1520
1520 PRINT "TUNNELS LEAD TO CAVES ";S(M(1),1);" ";SPC(1);" ";S(M(1),2);" ";SPC(1);" ";S(M(1),3)
1530 PRINT
1540 REM FEARLESS FREDDY STRIKES HERE
1550 IF J<>38 THEN 1590
1560 LET L=M(5)
1570 GOTO 2250
1580 REM CHOOSE OPTION
1590 LET M1=M1+1
1600 PRINT"DO SOMETHING";
1610 INPUT I$
1620 IF (I$="S") OR (I$="s") THEN 1710
1630 IF (I$="A") OR (I$="a") THEN 1960
1640 IF (I$="M") OR (I$="m") THEN 2060
1650 IF ((I$="E")*(M(1)=M(8))=1) OR ((I$="e")*(M(1)=M(8))=1) THEN 3850
1660 IF (I$="H") OR (I$="h") THEN 1680
1670 GOTO 1590
1680 GOSUB 3460
1690 GOTO 1190
1700 REM ARROW ROUTINE
1710 IF A>=1 THEN 1740
1720 PRINT"WHAT WITH?  DUMMY"
1730 GOTO 1140
1740 PRINT "CAVE #";
1750 INPUT L
1760 FOR K=1 TO 3
1770 IF S(M(1),K)=L THEN 1820
1780 NEXT K
1790 PRINT"NOT POSSIBLE"
1800 GOTO 1740
1810 REM SHOOT ARROW
1820 LET A=A-1
1830 IF A>=0 THEN 1860
1840 LET A=0
1850 GOTO 1960
1860 IF L=M(2) THEN 1890
1870 PRINT "MISSED"
1880 GOTO 1950
1890 IF RND(1)>=.8 THEN 1940
1900 PRINT "YOU GOT THE WUMPUS"
1910 LET F=F+1
1920 LET M(2)=0
1930 GOTO 2360
1940 PRINT"YOU WOUNDED THE WUMPUS"
1950 GOSUB 1990
1960 PRINT A;" ARROWS LEFT"
1970 GOTO 1140
1980 REM MOVE WUMPUS ROUTINE
1990 IF W<>1 THEN 2020
2000 LET M(2)=0
2010 RETURN
2020 LET M(2)=S(M(2),(INT(3*RND(1)+1)))
2030 IF (M(1)=M(2))+(L=M(2))+(M(2)=M(7))<>0 THEN 2020
2040 RETURN
2050 REM MOVE ROUTINE
2060 PRINT "WHERE TO";
2070 INPUT L
2080 FOR K=1 TO 3
2090 IF S(M(1),K)=L THEN 2150
2100 NEXT K
2110 IF L=M(1) THEN 2150
2120 PRINT "NOT POSSIBLE"
2130 GOTO 2060
2140 REM CHECK FOR HAZARDS
2150 IF L<>M(2) THEN 2180
2160 PRINT "OOPS! BUMPED A WUMPUS!"
2170 GOTO 2450
2180 IF (L=M(3))+(L=M(4))=0 THEN 2210
2190 PRINT"YYYIIIIEEEE...FELL IN PIT"
2200 GOTO 2500
2210 IF L<>M(7) THEN 2250
2220 PRINT "CAVE ENTRANCE IS BLOCKED"
2230 GOSUB 2710
2240 GOTO 1140
2250 IF (L=M(5))+(L=M(6))=0 THEN 2280
2260 PRINT "ZAP..SUPERBAT SNATCH!"
2270 GOTO 2320
2280 IF L<>M(8) THEN 2300
2290 PRINT "EXIT NEARBY"
2300 LET M(1)=L
2310 GOTO 1140
2320 LET L=INT(1+RND(1)*20)
2330 IF (L=M(1))+(L=M(6))+(L=M(7))<>0 THEN 2320
2340 GOSUB 2710
2350 GOTO 2150
2360 IF RND(1)>=.75 THEN 2410
2370 PRINT "BEWARE OF ITS MATE"
2380 LET J=2
2390 GOSUB 2820
2400 GOTO 1960
2410 LET W=1
2420 PRINT "LAUGH NOW FOR THE WUMPUS' WILL PREVAIL"
2430 GOTO 1140
2440 REM EATEN SUBROUTINE
2450 IF RND(1)>=.75 THEN 2490
2460 GOSUB 1990
2470 GOSUB 2710
2480 GOTO 2300
2490 PRINT"TSK TSK TSK--THE WUMPUS GOT YOU"
2500 PRINT "HA HA HA--YOU LOSE!"
2510 GOTO 3940
2520 REM MOVE EVERYTHING
2530 PRINT"**EARTHQUAKE**"
2540 FOR J=3 TO 7
2550 GOSUB 2820
2560 NEXT J
2570 GOSUB 2710
2580 LET M(2)=INT(RND(1)*20+1)
2590 IF (M(1)=M(2))+(M(2)=M(7))<>0 THEN 2580
2600 REM MOVE CAVE ENTRANCE
2610 IF RND(1)<=.1 THEN 2630
2620 RETURN
2630 LET M(8)=INT(RND(1)*20+1)
2640 FOR J=3 TO 7
2650 IF M(8)<>M(J) THEN 2680
2660 LET M(8)=INT(RND(1)*20+1)
2670 GOTO 2650
2680 NEXT J
2690 RETURN
2700 REM DROPPED ARROWS SUBROUTINE
2710 LET J=INT(RND(1)*10)
2720 IF (J>A)+(A=0)=0 THEN 2740
2730 RETURN
2740 PRINT "DROPPED ARROWS"
2750 IF J<>0 THEN 2780
2760 PRINT "ALL ARROWS FOUND"
2770 RETURN
2780 LET A=A-J
2790 PRINT J;" ARROWS LOST";TAB(20);A;" ARROWS LEFT"
2800 RETURN
2810 REM RANDOM CAVE REARRANGEMENT SUBROUTINE
2820 LET M(J)=INT(RND(1)*20)+1
2830 IF (M(J)=M(1))+(M(J)=M(8))<>0 THEN 2820
2840 RETURN
2850 REM INSTRUCTIONS
2860 PRINT
2870 PRINT "     WELCOME TO HUNT THE WUMPUS"
2880 PRINT:PRINT
2890 PRINT "THE WUMPUS COLONY INHABIT A BURROW OF"
2900 PRINT "20 CAVES. EACH CAVE HAS THREE TUNNELS"
2910 PRINT "LEADING TO OTHER CAVES. THE OBJECTIVE"
2920 PRINT "IS TO DESCEND INTO THE BURROW AND HUNT"
2930 PRINT "WUMPI. AFTER YOU HAVE KILLED AT LEAST"
2940 PRINT "ONE, YOU MUST RETURN TO THE EXIT AND"
2950 PRINT "LEAVE THE BURROW. NOTE THAT THERE MAY"
2960 PRINT "BE MORE THAN ONE WUMPUS IN THE BURROW. "
2970 PRINT
2980 PRINT "YOU HAVE 5 ARROWS."
2990 PRINT"UNDER CONDITIONS OF STRESS, YOU MAY"
3000 PRINT "DROP YOUR ARROWS."
3010 PRINT
3020 PRINT "***SCORING***  YOUR RATING IS A"
3030 PRINT"FUNCTION OF THE NUMBER OF WUMPI SHOT"
3040 PRINT "AND THE TIME SPENT IN THE BURROW"
3050 PRINT:PRINT:PRINT
3060 GOSUB 3790
3070 PRINT"     * * * HAZARDS * * *"
3080 PRINT
3090 PRINT"1---BOTTOMLESS PITS"
3100 PRINT"TWO ROOMS CONTAIN BOTTOMLESS PITS. IF"
3110 PRINT"YOU FALL IN A PIT YOU LOSE."
3120 PRINT
3130 PRINT
3140 PRINT"2---SUPERBATS"
3150 PRINT "TWO ROOMS CONTAIN NESTS OF SUPERBATS."
3160 PRINT "THEY ARE PEACEFUL CREATURES WHEN LEFT"
3170 PRINT"ALONE. SHOULD YOU INADVERTENTLY STUMBLE"
3180 PRINT"ACROSS THEIR NEST YOU WILL BE PICKED UP"
3190 PRINT "AND BE DEPOSITED IN ANOTHER CAVE AT"
3200 PRINT "RANDOM TOO BAD IF IT CONTAINS ANOTHER"
3210 PRINT "HAZARD !!"
3220 PRINT:PRINT:PRINT:PRINT:PRINT
3230 GOSUB 3790
3240 PRINT
3250 PRINT"3---**EARTHQUAKES**"
3260 PRINT"EARTHQUAKES ARE A COMMON OCCURRENCE."
3270 PRINT "SHOULD ONE OCCUR, THE BURROW ENTRANCE"
3280 PRINT "MAY BE BLOCKED AND A NEW ONE OPEN UP."
3290 PRINT"THE GEOGRAPHY OF THE CAVES WILL BE"
3300 PRINT "CHANGED. PITS MAY FILL UP AND A CAVE"
3310 PRINT "MAY BE BLOCKED BY A ROCKFALL. THE BATS"
3320 PRINT "WILL BE ALARMED AND MAY SEEK OUT A NEW"
3330 PRINT "CAVE. THE WUMPUS WILL ALSO BECOME"
3340 PRINT "ALARMED AND MAY MOVE TO A NEW CAVE."
3350 PRINT
3360 PRINT"4---WUMPUS"
3370 PRINT "THE WUMPUS IS NOT BOTHERED BY ANY"
3380 PRINT "HAZARDS (IT HAS SUCKERS ON ITS FEET AND"
3390 PRINT "IS TOO BIG FOR A BAT TO LIFT). THE"
3400 PRINT "WUMPUS IS MOVING IN THE CAVES LOOKING"
3410 PRINT "FOR FOOD. IT NORMALLY EATS A SPECIES"
3420 PRINT "OF MUSHROOM, BUT MAY EAT YOU SHOULD YOU"
3430 PRINT "ENTER THE CAVE IN WHICH IT IS FEEDING"
3440 PRINT:PRINT:PRINT
3450 GOSUB 3790
3460 PRINT
3470 PRINT "      EACH TURN YOU MAY:"
3480 PRINT:PRINT
3490 PRINT " M-MOVE TO AN ADJACENT CAVE THROUGH A"
3500 PRINT "   CONNECTING TUNNEL"
3510 PRINT
3520 PRINT " S-SHOOT AN ARROW THRU A TUNNEL TO TRY"
3530 PRINT "   AND HIT THE WUMPUS. IT IS BIG ENOUGH"
3540 PRINT "   SO THAT AN ARROW ENTERING THE CAVE"
3550 PRINT "   THAT IT IS OCCUPYING, WILL HIT IT."
3560 PRINT
3570 PRINT " A-CHECK ON NUMBER OF ARROWS LEFT"
3580 PRINT
3590 PRINT " E-EXIT FROM THE CAVES IF YOU ARE IN"
3600 PRINT "   THE ENTRANCE CAVE"
3610 PRINT
3620 PRINT " H-ASK FOR INSTRUCTIONS"
3630 PRINT:PRINT:PRINT
3640 GOSUB 3790
3650 PRINT "      * * * WARNINGS * * *"
3660 PRINT:PRINT
3670 PRINT "WHEN YOU ARE 1 CAVE AWAY FROM A HAZARD"
3680 PRINT "YOU WILL BE WARNED AS FOLLOWS:"
3690 PRINT
3700 PRINT "    WUMPUS.....I SMELL A WUMPUS"
3710 PRINT "    BATS.......BATS NEARBY"
3720 PRINT "    PIT........I FEEL A DRAFT"
3730 PRINT
3740 PRINT "IF YOU TRY TO ENTER A CAVE BLOCKED BY"
3750 PRINT "A FALL, OR IF YOU RETURN TO THE"
3760 PRINT "ENTRANCE CAVE, YOU WILL BE NOTIFIED"
3770 PRINT
3780 RETURN
3790 PRINT "TO CONTINUE, TYPE ANY CHARACTER"
3800 INPUT I$
3810 PRINT
3820 PRINT
3830 RETURN
3840 REM END GAME
3850 PRINT "OUT OF THE CAVES"
3860 IF F<=0 THEN 3880
3870 PRINT "GOOD HUNTING"
3880 LET W=INT((F*1000)/M1)
3890 PRINT "YOUR RATING IS ";W
3900 IF F<>0 THEN 3920
3910 PRINT"BETTER LUCK NEXT TIME"
3920 PRINT
3930 PRINT "IN SPITE OF YOUR INABILITY !!"
3940 PRINT "DO YOU WANT TO TRY AGAIN ?"
3950 INPUT I$
3960 IF (I$="Y") OR (I$="y") THEN RESTORE:CLEAR:GOTO 740
3970 END
