Creepy Caverns
- Type
- Game
- Category
- Arcade adventure (treasure hunt and monster battle)
- Author
- Anthony Ramos
- Published in
- Antic, August 1984 (Vol. 3, No. 4)
- Year
- 1984
- Language
- Atari BASIC
- Requirements
- 32K RAM with disk (the magazine also gave a two-part method for 16K cassette systems), Atari BASIC, joystick in port 1
About the program
The evil Megawump has gathered a horde of monsters that raid the villages at night and hoard their loot in musty caverns. Your job is to go in, take back as much treasure as you can, and collect the magic objects you need to kill the Megawump. Every cavern holds two monsters: pythons, trolls or hydras, each worse than the last and each worth 1,000 points dead. Bags of gold are worth 50 and jewels 80.
Anthony Ramos was 16 and about to be a senior at Brookside High School in Sheffield Lake, Ohio. He had bought his Atari 400 with money from a summer job. He told Antic that he'd used every programming technique he knew in Creepy Caverns, "some of them courtesy of Antic".
Typing it in
The listing below has one correction: on the original Antic disk the last number in line 4410 was corrupted, which made the line unenterable and stopped the game with ERROR 17. Here it reads PLOT 14,23, as printed in the magazine (see "Changes from the published listing").
The only special characters are inverse-video words ({inv}…{/inv}: press the Atari key before and after) in lines 1010, 4000, 4415, 5042 and 5175. The magazine printed the program as two listings so that 16K cassette owners could type and check each half separately. The disk version below is the merged program.
How to play
When "PRESS START" appears, wait until START flashes, then press it. Move with the joystick. Red quivers hold five "smart" arrows that steer themselves to the nearest monster. Orange quivers hold five "dumb" arrows that fly straight. Also hidden in the caverns are a gold amulet (protection from the Megawump's lightning), a gold key, and a magic chest that the key opens to give you the sword.
The bottom line shows your smart and dumb arrows, the key and the sword. Use the left and right arrow keys to move the pointer to the item you want, push the stick to aim and press the button. To kill the Megawump, shoot it with three dumb arrows, then use the sword once it changes colour. The space bar pauses (any key resumes), and ESC restarts.
How it works
- Numbers as variables. Line 10 sets
O=0,N=1,P=2,B=3,G=4,L=6,F=8andN0=10, and the rest of the program uses those names instead of numbers to save memory. - Two character sets. Lines 5050–5066 build two half-size GRAPHICS 1 fonts eight pages below the top of memory, with different monster frames. Flipping location 756 between them (line 20) animates the creatures.
- Built only once. Line 5045 checks a byte of the font area. If the fonts are still there from an earlier run, it skips the slow setup.
- Moving with LOCATE. Line 30 turns the joystick into X and Y steps with logical expressions, and
LOCATEchecks what's in the way: rock, gold (character 174), a jewel (173), the key (186) or the amulet (187).
Changes from the published listing
| Line | As published | Now | Why |
|---|---|---|---|
| 4410 | …:PLOT 14,1.15713E-101 |
…:PLOT 14,23 |
The constant was corrupted on the Antic disk; restored from the printed magazine. Atari BASIC rejected the line and the game stopped with ERROR 17. |
Listing
10 G=4:F=8:B=3:O=0:N=1:P=2:N0=10:L=6:DIM C(36,B),SA(B),DA(B),MO(P,5):SM=PEEK(106)-F:POKE 53277,B:GOTO 5000
11 X=B+PEEK(53770)/18.22:Y=B+PEEK(53770)/15:LOCATE X,Y,Z:IF Z<>32 THEN 11
12 PLOT X,Y:RETURN
20 POKE 756,SM+P:XR=O:YR=O:J=STICK(O):IF J=15 THEN 100
30 XR=(J<F AND J>G)-(J<12 AND J>F):YR=(J=9 OR J=13 OR J=5)-(J=N0 OR J=14 OR J=L):LOCATE XP+XR,YP+YR,Z
32 IF Z=32 THEN 60
35 IF Z=143 THEN XR=O:YR=O:SOUND O,100,12,12:FOR T=N TO 25:NEXT T:SOUND O,O,O,O:GOTO 100
40 IF Z=174 THEN SCO=SCO+50:POKE 1535+YO,PEEK(1535+YO)-N:FOR T=15 TO O STEP -0.8:SOUND 0,35,G,T:NEXT T:SOUND O,O,O,O
45 IF Z=173 THEN SCO=SCO+80:POKE 1571+YO,PEEK(1571+YO)-N:FOR T=15 TO O STEP -N:SOUND O,N0,N0,T:NEXT T
50 IF Z<>186 THEN 55
51 COLOR 186:PLOT F,23:FOR T=N TO G:SOUND O,180-T*40,N0,T*B:FOR X=N TO 12:NEXT X:NEXT T:SOUND O,O,O,O:KE=O
55 IF Z=187 THEN COLOR 187:PLOT 11,23:FOR T=-N0 TO N0 STEP N:SOUND O,121,N0,N0-ABS(T):SOUND N,81,N0,N0-ABS(T):NEXT T:AM=O
56 POSITION F,O:? #L;SCO
60 IF NOT QUPOS THEN 100
61 IF (XP+XR)<>(QUPOS-48)/F OR YP+YR<>11 THEN 100
62 SAT=SAT+(SA>-N)*5:DAT=DAT+(DA>-N)*5:POSITION P,23:? #L;SAT:POSITION 5,23:? #L;DAT:POKE 53250,O:QUPOS=O
63 IF SA>-N THEN SA(SA)=O
64 IF DA>-N THEN DA(DA)=O
65 FOR T=140 TO 60 STEP -N0:SOUND O,T,N0,N0:A=A:SOUND O,O,O,O:FOR X=N TO F:NEXT X:NEXT T
100 COLOR 32:PLOT XP,YP:XP=XP+XR:YP=YP+YR:COLOR 159+(J>F AND J<12)*65-(J=15):PLOT XP,YP
102 IF PEEK(764)=255 THEN 150
103 IF PEEK(764)=33 THEN 103
104 IF PEEK(764)=28 THEN POKE 764,255:RUN
105 COLOR O:PLOT N+PO*B,23:PO=PO+(PEEK(764)=7)-(PEEK(764)=L):PO=PO+(PO<O)-(PO=5):POKE 764,O:COLOR 5:PLOT N+PO*B,23
110 SOUND O,100,N0,F:FOR T=N TO N0:NEXT T:SOUND O,O,O,O:POKE 764,255
150 IF STRIG(O) THEN 300
155 IF SW OR KE OR PO<>P OR XP<>(CHPOS-48)/F OR NOT PEEK(SM*256-223+YP*F) THEN 179
156 SOUND O,255,N0,O:SOUND N,254,N0,O:POKE 53768,N:CL=SM*256-224+YP*F:POKE CL,63:POKE CL+N,66:POKE CL+P,130
160 X=255:SW=N:COLOR 189:PLOT 14,23:FOR T=175 TO 160 STEP -0.15:POKE 710,X:X=X-N:POKE 53761,T:POKE 53763,T:NEXT T
179 IF PO=G THEN COLOR 189:PLOT XP,YP
180 SETCOLOR P,N,N0:IF STICK(O)=15 OR PO>N OR NOT PO AND NOT SAT OR AX OR AY OR PO=N AND DAT=O THEN 299
185 J=STICK(O):XR=(J>G AND J<F)-(J<12 AND J>F):YR=(J=9 OR J=13 OR J=5)-(J=N0 OR J=14 OR J=L)
200 IF PO OR NOT SAT THEN 210
205 SAT=SAT-N:POSITION P,23:? #L;SAT;" ";:AX=XP:AY=YP:POKE 708,52:GOSUB 250
206 FOR T=O TO N:IF MO(T,O)<100 THEN MA=T:GOTO 300
208 NEXT T
210 IF DAT THEN DAT=DAT-N:POSITION 5,23:? #L;DAT;" ";:AX=XP:AY=YP:POKE 708,40:AV=XR:AW=YR:GOSUB 250
240 GOTO 299
250 FOR T=15 TO O STEP -0.8:SOUND O,227,12,T:NEXT T:SOUND O,O,O,O:RETURN
299 AC=32+PEEK(1784+AV+AW*B)
300 IF NOT (AX+AY) THEN 350
310 IF PEEK(708)<>52 THEN 330
315 AV=SGN(MO(MA,O)-AX):AW=SGN(MO(MA,N)-AY):AC=32+PEEK(1784+AV+AW*B)
330 IF AX+AV<>XP OR AY+AW<>YP THEN COLOR AZ:PLOT AX,AY:AX=AX+AV:AY=AY+AW:LOCATE AX,AY,AZ:COLOR AC:PLOT AX,AY
340 IF AV=O AND AW=O OR AZ=143 OR AX=O OR AX=19 OR AY=N OR AY=22 THEN COLOR AZ:PLOT AX,AY:AX=O:AY=O:AZ=32
345 IF MO(O,O)<>AX AND MO(O,N)<>AY AND MO(N,O)<>AX AND MO(N,N)<>AY THEN 350
346 FOR T=O TO N:IF (MO(T,O)<>AX OR MO(T,N)<>AY) AND (MO(T,O)<>AX+AV OR MO(T,N)<>AY+AW) THEN NEXT T:GOTO 350
347 MO(T,O)=100:MO(T,N)=100:COLOR 32:PLOT AX,AY:PLOT AX+AV,AW+AY:SCO=SCO+1000:FOR X=15 TO O STEP -0.5
348 SOUND O,60-X*P,F,F:NEXT X:SOUND O,O,O,O:AZ=32:POSITION F,O:? #L;SCO:AX=O:AY=O:POKE 1607+YO,PEEK(1607+YO)-N:NEXT T
350 POKE 756,SM:IF MO( NOT (W),O)<>100 OR NOT AM THEN W= NOT W
355 IF MO(W,O)=100 THEN 450
360 X=MO(W,O):Y=MO(W,N):IF ABS(X-XP)>MR OR ABS(Y-YP)>MR THEN 380
370 MO(W,P)=SGN(XP-X):MO(W,B)=SGN(YP-Y):GOTO 400
380 MO(W,5)=MO(W,5)-N:IF MO(W,5)>O THEN 400
385 MO(W,5)=PEEK(53770)/64:MO(W,P)=INT(PEEK(53770)/86)-N:MO(W,B)=INT(PEEK(53770)/86)-N
400 COLOR 32:PLOT X,Y:X=X+MO(W,P):Y=Y+MO(W,B):LOCATE X,Y,V
405 IF V=143 OR X=O OR X=19 OR Y=N OR Y=22 THEN X=X-MO(W,P):Y=Y-MO(W,B)
410 Z=MC-(MC=N0 AND MO(W,P)=N):COLOR Z:PLOT X,Y:MO(W,O)=X:MO(W,N)=Y
450 IF MW<>YO OR NOT SW THEN 550
455 POSITION MWX,MWY:? #L;" ":POSITION MWX,MWY+N:? #L;" ":MWX=MWX+SGN(XP-MWX):MWY=MWY+SGN(YP-MWY)
456 POKE 708,104+MWC*48:GOSUB 800:FOR T=15 TO O STEP -0.5:SOUND O,50,O,T:NEXT T
460 IF PEEK(53770)>16 THEN 480
465 COLOR 90:PLOT MWX,MWY:DRAWTO XP,YP:FOR T=O TO P:POKE 711,O:POKE 709,O:POKE 712,140:X=COS(O)
466 POKE 711,14:POKE 709,140:POKE 712,O:X=COS(O):NEXT T:POKE 711,PEEK(1643+YO)
470 COLOR O:PLOT MWX,MWY:DRAWTO XP,YP:GOSUB 800:FOR T=15 TO O STEP -0.2:SOUND O,120-T*F,F,T
471 NEXT T:IF AM THEN 610
480 IF ABS(MWX-XP)<P AND ABS(MWY-YP)<P AND XP>=MWX AND YP>=MWY THEN 580
482 IF NOT PO OR (AX<>MWX AND AX<>MWX+N) OR (AY<>MWY AND AY<>MWY+N) THEN 550
483 MWC=MWC-(MWC>O):FOR T=O TO 15:SOUND O,20,P,T:NEXT T:SCO=SCO+5000:AX=O:AY=O:AZ=32:SOUND O,O,O,O
550 IF MO(O,O)=XP AND MO(O,N)=YP OR MO(N,O)=XP AND MO(N,N)=YP THEN 600
552 IF XP>O AND XP<19 AND YP>N AND YP<22 THEN 20
555 YO=YO-(XP=O)+(XP=19)-L*(YP=N)+L*(YP=22):XP=XP-18*(XP=19)+18*(XP=O):YP=YP-20*(YP=22)+20*(YP=N)
556 AX=O:AY=O:GOSUB 4000:GOTO 20
580 IF PO=G AND NOT STRIG(O) AND NOT MWC THEN 1000
582 GOTO 605
600 IF MO( NOT W,O)=100 AND NOT AM THEN 20
605 AX=O:AY=O:AZ=32:IF YO<>MW THEN COLOR MC:PLOT XP,YP
606 FOR T=15 TO O STEP -0.4:SOUND O,80,O,T:SOUND N,100,O,T:POKE 712,T:NEXT T
610 POKE 53768,N:RESTORE 680:FOR T=N TO 11:READ X,Y:POKE 53761,O:POKE 53763,O
615 A= NOT A:POKE 756,SM+A*P:POKE 53760,X:POKE 53762,X+N:POKE 53761,170:POKE 53763,170
620 FOR Z=N TO Y*25:NEXT Z:NEXT T:EX=EX-N:XP=N0:YP=20:IF EX>-N THEN GOSUB 4000:GOTO 20
630 POSITION 5,N0:? #L;"GAME OVER":SOUND O,O,O,O:SOUND N,O,O,O:POSITION O,16:POKE 77,128:GOTO 5042
680 DATA 108,3,108,2,108,1,108,3,91,2,96,1,96,2,108,1,108,2,114,1,108,3
800 POSITION MWX,MWY:? #L;"\]":POSITION MWX,MWY+N:? #L;"^_":RETURN
1000 COLOR 189:PLOT XP,YP:SOUND O,255,N0,O:SOUND N,254,N0,O:POKE 53768,N:FOR T=160 TO 175 STEP 0.15:POKE 53761,T
1005 POKE 53763,T:NEXT T:SOUND N,O,O,O:FOR T=15 TO O STEP -0.3:SOUND O,120-T*F,O,T:POKE 708,T:NEXT T:Z=PEEK(560)
1006 FOR T=-N0 TO N0:FOR X=O TO L:POKE 560,Z:Y=Y*P:POKE 560,Z-N0+ABS(T):Y=Y/P:NEXT X:SOUND O,60,O,N0-ABS(T)
1008 NEXT T:POKE 708,54
1010 ? #L;"{CLEAR} SCORE{inv}%{/inv}":POSITION B,N0:? #L;"%%you {inv}did{/inv} {inv}IT{/inv}!!":FOR T=N TO 50:SCO=SCO+500:POSITION N0,O:? #L;SCO
1015 FOR X=L TO O STEP -N:SOUND O,21,4,X:NEXT X:SOUND N,121,N0,G:SOUND P,81,N0,(T>=N0)*G
1020 SOUND B,60,N0,(T>=20)*G:NEXT T:FOR X=B TO O STEP -N:FOR T=O TO P:POKE 53763+T*P,160+X:NEXT T:NEXT X:GOTO 5042
4000 ? #L;"{CLEAR}":POKE 559,O:SOUND O,O,O,O:SOUND N,O,O,O:RESTORE INT(5176+C(YO,P)+C(YO,O)*P):COLOR 143:POKE 623,G
4010 POKE 77,O:FOR T=N TO 11:READ X:IF X THEN PLOT X,T:DRAWTO O,T
4011 NEXT T:RESTORE 5176+C(YO,P)+C(YO,N)*P
4020 FOR T=N TO 11:READ X:IF X THEN PLOT 19-X,T:DRAWTO 19,T
4021 NEXT T:RESTORE 5176+C(YO,B)+C(YO,O)*P
4030 FOR T=N TO 11:READ X:IF X THEN PLOT X,23-T:DRAWTO O,23-T
4031 NEXT T:RESTORE 5176+C(YO,B)+C(YO,N)*P
4040 FOR T=N TO 11:READ X:IF X THEN PLOT 19-X,23-T:DRAWTO 19,23-T
4041 NEXT T:COLOR 174:IF PEEK(1535+YO) THEN FOR T=N TO PEEK(1535+YO):GOSUB 11:NEXT T
4050 IF PEEK(1571+YO) THEN COLOR 173:FOR T=N TO PEEK(1571+YO):GOSUB 11:NEXT T
4060 MO(O,O)=100:MO(N,O)=100:IF YO=MW OR NOT (PEEK(1607+YO)) THEN 4130
4100 FOR T=O TO PEEK(1607+YO)-N:X=L+INT(F*RND(O))
4105 Y=F+INT(F*RND(O)):LOCATE X,Y,A:IF A=32 THEN MO(T,O)=X:MO(T,N)=Y:NEXT T:GOTO 4130
4110 GOTO 4105
4130 IF AM=YO THEN COLOR 187:GOSUB 11
4140 IF KE=YO THEN COLOR 186:GOSUB 11
4150 IF CH<>YO THEN POKE 53251,O:GOTO 4200
4155 IF SW THEN POKE 53251,CHPOS:GOTO 4200
4160 FOR T=SN-176 TO SN-88:POKE T,O:NEXT T:A=SN-176+INT(PEEK(53770)/25.5)*F
4170 FOR T=O TO 7:POKE A+T,PEEK(SN+224+T):NEXT T:POKE 707,198
4180 CHPOS=80+INT(PEEK(53770)/25.5)*F:POKE 53251,CHPOS
4200 SA=-N:DA=-N:FOR T=O TO P:IF SA(T)=YO THEN SA=T
4210 IF DA(T)=YO THEN DA=T
4300 NEXT T:IF SA+DA=-P THEN POKE 53250,O:GOTO 4400
4310 FOR T=O TO 7:POKE SN-392+T,PEEK(SN+472+T):NEXT T:QUPOS=80+INT(N0*RND(O))*F:POKE 706,38+(SA>-N)*14
4320 POKE 53250,QUPOS
4400 POKE 711,PEEK(1643+YO):POKE 709,86-(YO>12)*30+(YO>24)*142:POSITION P,23:? #L;SAT:POSITION 5,23:? #6;DAT
4410 COLOR ( NOT KE)*186:PLOT F,23:COLOR ( NOT AM)*187:PLOT 11,23:COLOR SW*189:PLOT 14,23
4412 MR=G+P*(YO>12)+B*(YO>24):MC=N0+(YO>12)+(YO>24):IF EX THEN COLOR 190:PLOT 18,O:DRAWTO 19-EX,O
4415 POSITION P,O:? #L;"{inv}score%{/inv}";SCO:POKE 559,62:COLOR 5:PLOT N+PO*B,23:MO(O,5)=N:MO(N,5)=N
4420 IF NOT SW OR YO<>MW THEN RETURN
4430 POKE 708,O:MWX=N+(18-XP):MWY=N+(21-YP):GOSUB 800:DATA 108,121,108,121,136,144,162,173,162
4450 POKE 53768,N:POKE 53761,167:POKE 53763,167:RESTORE 4430:FOR T=N TO B:READ X:POKE 53760,X:POKE 53762,X+N
4460 FOR Y=N TO 20+60*(T=B):NEXT Y:NEXT T
4465 POKE 53764,B:FOR T=O TO 15 STEP 0.3:POKE 708,240+T:POKE 53765,64+T:NEXT T:POKE 53765,O:POKE 708,248
4470 COLOR 143:PLOT O,N:DRAWTO 19,N:PLOT O,22:DRAWTO 19,22:GOSUB 4990
4480 PLOT O,N:DRAWTO O,22:PLOT 19,22:DRAWTO 19,N:GOSUB 4990
4500 FOR T=N TO L:READ X:POKE 53760,X:POKE 53762,X+N:FOR Y=N TO 50+150*(T>G):NEXT Y:NEXT T
4510 MWC=B:SOUND O,O,O,O:SOUND N,O,O,O:SOUND P,O,O,O:RETURN
4990 POKE 53764,40:FOR T=15 TO O STEP -0.5:POKE 53765,T:NEXT T:X=P^B:RETURN
5000 GRAPHICS 17:POKE 756,SM:POKE 708,52:SN=SM*256:POKE 709,38:POKE 710,26:POKE 711,198:? #L;" CREEPY CAVERNS"
5005 POKE 54279,SM-F:? #L;" BY TONY RAMOS":POSITION O,14
5042 ? #L:? #L;" 5 LIVES per game {inv}PRESS{/inv} START {inv}TO{/inv} {inv}BEGIN{/inv}";
5045 IF PEEK(SN+991)=56 THEN POKE 53279,F:GOTO 5095
5050 TRAP 40000:FOR T=O TO 7:POKE SN+T,O:POKE SN+512+T,O:NEXT T:FOR T=264 TO 471:POKE SN+T,PEEK(57344+T)
5060 POKE SN+512+T,PEEK(57344+T):NEXT T:RESTORE 5000:FOR T=O TO 63:READ X:POKE SN+8+T,X:POKE SN+520+T,X:NEXT T
5061 FOR T=64 TO 103:READ X,Y:POKE SN+8+T,X:POKE SN+520+T,Y:NEXT T:FOR T=104 TO 239:READ X:POKE SN+8+T,X
5062 POKE SN+520+T,X:IF T=120 THEN T=200
5063 NEXT T:FOR T=240 TO 255:READ X,Y:POKE SN+8+T,X:POKE SN+520+T,Y:NEXT T:POKE 53279,8
5064 FOR S=0 TO 1:FOR T=480 TO 511:READ X:POKE SN+T+S*512,X:NEXT T:NEXT S
5065 FOR T=472 TO 479:READ X:POKE SN+T,X:POKE SN+512+T,X:NEXT T
5066 FOR T=0 TO 79:READ X:POKE SN+128+T,X:POKE SN+640+T,X:NEXT T
5067 DATA 0,33,67,254,67,33,0,0,224,192,160,16,8,6,7,2,16,56,84,16,16,16,56,108,7,3,5,8,16,96,224,64,0,132
5068 DATA 194,127,194,132,0,0,64,224,96,16,8,5,3,7,54,28,8,8,8,42,28,8,2,7,6,8,16,160,192,224
5069 DATA 3,3,37,5,119,7,84,146,84,186,84,170,220,238,136,68,192,192,164,160,238,224,42,73,42,93,42,85,59,119
5070 DATA 17,34,56,56,84,84,254,254,186,186,186,186,40,40,104,44,12,96,124,124,186,186,214,214,214,214,124,124
5071 DATA 186,186,170,170,170,68,0,16,68,146,40,84,0,0,56,56,108,84,40,56,16,16,108,56,16,56,124,190,222,124
5072 DATA 255,239,255,251,255,191,255,253,0,0,2,5,255,229,162,0,60,66,66,36,24,60,60,24
5073 DATA 0,124,190,193,191,155,91,63,64,96,48,58,30,12,30,6,56,56,16,56,84,16,40,108,24,24,24,24,16,16,52,24
5074 DATA 88,24,16,16,104,16,76,24,24,24,24,24,8,8,44,24,26,24,8,8,22,8,50,24
5075 DATA 12,4,3,7,37,38,110,111,24,16,229,243,211,186,190,231,127,51,38,12,30,30,0,0
5076 DATA 242,240,112,48,32,32,120,124,24,8,167,175,203,93,125,231,48,32,192,224,164,100,118,246,79,15,14
5077 DATA 12,4,4,30,62,254,204,100,48,120,120,0,0,12,58,58,60,60,56,56,56
5078 DATA 56,124,206,198,198,230,124,56,24,56,120,24,24,24,56,124,124,206,102,6,124,224,192,254,60,102,14,24,12
5079 DATA 102,198,124,14,236,108,108,204,254,12,30,62,112,96,124,6,102,206,124,60,102,206,192,252,206,230,124
5080 DATA 126,198,12,12,24,24,48,120,120,204,230,124,206,194,102,60,120,204,198,230,126,6,204,120
5094 RESTORE 5185:FOR T=O TO F:READ X:POKE 1780+T,X:NEXT T
5095 POKE 708,T:T=T-0.75+255*(T<N):IF PEEK(53279)<>L THEN 5095
5175 SETCOLOR O,B,G:POSITION G,22:? #L;"%{inv}GET{/inv} {inv}READY{/inv}!":SOUND N,255,N0,F:SOUND O,254,N0,F:POKE 53768,N
5176 DATA 9,9,7,6,6,4,5,3,2,1,1
5177 DATA 7,7,6,5,4,5,3,2,2,1,1
5178 DATA 9,9,7,5,5,4,2,3,1,0,0
5179 DATA 7,7,5,3,4,2,2,1,1,0,0
5181 FOR T=N TO 36:C(T,O)=((T-N)/L<>INT((T-N)/L)):C(T,N)=(T/L<>INT(T/L)):C(T,P)=(T>L):C(T,B)=(T<31):NEXT T
5185 DATA 2,3,4,1,0,5,8,7,6
5190 FOR T=N TO 30:X=INT(G*RND(O)):Y=INT(36*RND(O))+N:K=Y-(X=O)+(X=N)-(X=P)*L+L*(X=B):IF K<N OR K>36 THEN 5200
5192 ZZ=O:IF Y/L=INT(Y/L) THEN 5200
5194 Q=(X=O)+P*(X=B)+B*(X=P):R=C(Y,O)+C(Y,N)+C(Y,P)+C(Y,B):S=C(K,O)+C(K,N)+C(K,P)+C(K,B):IF R>N AND S>N THEN ZZ=N
5195 IF ZZ=N AND (R=N OR S=N) AND C(Y,X)=N THEN 5200
5196 IF ZZ=N AND (R<B OR S<B) AND (Y<7 OR Y>30) THEN 5200
5197 IF ZZ=N THEN ZZ=O:C(Y,X)=O:C(K,Q)=O
5200 NEXT T:FOR T=N TO 72:POKE 1535+T,(PEEK(53770)/32):NEXT T:FOR T=O TO 35:POKE 1608+T,P:NEXT T
5210 MW=INT(L*L*RND(O))+N:YO=INT(L*L*RND(O)+N):IF ABS(YO-MW)<18 THEN 5210
5220 AM=INT(L*L*RND(O))+N:KE=INT(L*L*RND(O))+N:CH=INT(L*L*RND(O))+N:IF KE=CH OR AM=MW OR CH=MW THEN 5220
5221 POKE 1607+MW,O:FOR T=N TO 36:POKE 1643+T,P+INT(254*RND(O)):NEXT T
5225 SC=PEEK(88)+PEEK(89)*256
5230 FOR T=N TO L:IF T/P=INT(T/P) THEN DA(T/P-N)=N+(T-N)*L+INT(L*RND(O)):GOTO 5235
5231 SA(T/P-0.5)=N+(T-N)*L+INT(L*RND(O))
5235 NEXT T:PO=O:SAT=O:DAT=O:SCO=O:XP=N0:SW=O:YP=19:EX=G:GOSUB 4000:GOTO 20
Download
The original program from the Antic disk, to LOAD or ENTER instead of typing it: CREEPCAV.BAS.
Credits
- Program listing: Creepy Caverns — program listing (Antic, August 1984 (Vol. 3, No. 4)) — Anthony Ramos
- Picture: The first cavern: bags of gold and jewels, guarded by pythons and trolls. — Anthony Ramos (program); screenshot by the site
- Antic, August 1984 - Vol. 3 No. 4: scan of the printed magazine, Creepy Caverns, by Anthony Ramos, pp. 64ff — Anthony Ramos; Internet Archive, 1984
- Antic disk, August 1984 - Vol. 3 No. 4: CREEPCAV.BAS (detokenized listing) — Anthony Ramos, 1984
