10  ON ERROR GOTO 20:GOTO 50
20 IF ERR=53 THEN PRINT "FILE NOT FOUND. PLEASE RE-ENTER.":IF AZ=1 THEN RESUME 5490 ELSE RESUME 5590
30 IF ERR=52 OR ERR=64 THEN PRINT "BAD FILE NAME. PLEASE RE-ENTER":IF AZ=1 THEN RESUME 5490 ELSE RESUME 5590
40 PRINT "AN ERROR CODE";ERR;"HAS OCURRED IN LINE";ERL;". TERMINATING ...":END
50  KEY OFF:PRINT "PLEASE TURN YOUR CAPS LOCK ON NOW. IF YOU DON'T, YOUR INPUT WILL NOT BE"
60 PRINT "RECOGNIZED."
70 PRINT:PRINT "THIS GWBASIC PORT OF THIS PROGRAM WAS DONE BY JAYSON SMITH(JAYBIRD@PLOVER.NET)."
80 PRINT "RELEASE 1. SERIAL NUMBER 000409"
90 PRINT "PRESS ANY KEY TO CONTINUE."
100 A$=INKEY$:IF A$="" THEN 100
110 RANDOMIZE TIMER
120 CLS
130 DIM T(10):DIM N(100):DIM S(100):DIM E(100):DIM W(100):RX=-32000
140 DIM BT(12):DIM CS(54):DIM CR(52):DIM GC(100):G4=1
150 FOR X=1 TO 52:CS(X)=0:CR(X)=0:NEXT 
160 FOR X=1 TO 4:FOR Y=1 TO 13
170 Z=INT(RND(1)*52+1):IF CS(Z)>0 THEN 170
180 CS(Z)=X:CR(Z)=Y+1:NEXT Y,X 
190 CLS :PRINT:PRINT:PRINT "THE GREAT ESCAPE":PRINT " ","BY DELTON T. HORN"
200 FOR X=1 TO 100:N(X)=0:S(X)=0:E(X)=0:W(X)=0:NEXT 
210 FOR X=1 TO 3:Y=INT(RND(1)*10+1):N(Y)=1:NEXT 
220 FOR X=1 TO 65:Y=INT(RND(1)*90+1):Z=Y+10:N(Z)=1:S(Y)=1:NEXT 
230 PRINT:PRINT "YOU ARE LOST IN A GIANT MAZE OF 100 ROOMS!"
240 FOR X=1 TO 73:Y=INT(RND(1)*99+1):Z=Y+1:E(Z)=1:W(Y)=1:NEXT 
250 VH=INT(RND(1)*100)+1
260 PRINT "THE EXIT IS TO THE NORTH."
270 FOR X=1 TO 10:YY=INT(RND(1)*100+1):BT(X)=YY
280 Y=X*10:Z=Y-9:E(Z)=0:W(Y)=0:NEXT 
290 PRINT:PRINT "FIND YOUR WAY OUT ---";
300 FOR X=1 TO 10:T(X)=INT(RND(1)*100+1):NEXT 
310 FOR X=1 TO 100:Y=INT(RND(1)*17+1)
320 IF Y>10 THEN Y=0
330 GC(X)=Y:NEXT 
340 PRINT " IF YOU CAN !!!":PRINT 
350 T5=INT(RND(1)*100+1):K1=INT(RND(1)*60+1)+30:IF T5=K1 THEN 350
360 HA=0:W1=INT(RND(1)*100+1):W2=INT(RND(1)*100+1):IF W1=W2 THEN 360
370 G4=G4+1:MF=100:SC=INT(RND(1)*100+1):RB=INT(RND(1)*100+1):IF SC=RB THEN 370
380 DF=1:MC=INT(RND(1)*40+1)+10:MG=INT(RND(1)*50+1)+10:GF=INT(RND(1)*50+1)+40
390 IF(MC=MG) OR(MC=GF) OR(RB=MC) OR(RB=MG) THEN 380
400 BX=0:BB=INT(RND(1)*100+1):G1=INT(RND(1)*100+1):BN=INT(RND(1)*100+1):IF G1=BN THEN 400
410 PRINT "IF YOU GET STUCK YOU CAN USE A SECRET PASSAGEWAY BY ENTERING ";
420 CC=1:H=0:BT=150:BR=INT(RND(1)*70+1)+30
430 P=INT(RND(1)*50+1)+40:M=1:V2=0:GH=INT(RND(1)*20+1)+10
440 LM=INT(RND(1)*100+1):IF LM=GH THEN 440
450 PRINT "'X' AS YOUR MOVE."
460 LQ=INT(RND(1)*40+1)+60:QW=ABS(LQ-P):IF QW<15 THEN 460
470 ML=INT(RND(1)*90+1)+10:L2=INT(RND(1)*80+1)+6:IF L2=ML THEN 470
480 V=INT(RND(1)*100+1):IF V=P THEN 480
490 PRINT "A SECRET PASSAGEWAY WILL COUNT AS 10 MOVES."
500 N=0:GN=INT(RND(1)*90+1)+10.6:LH=0:LQ=INT(RND(1)*45+1)+55:SW=INT(RND(1)*100+1)
510 PD=INT(RND(1)*100+1):K=INT(RND(1)*40+1)+60:S=INT(RND(1)*90+1)+10
520 PRINT:PRINT "WOULD YOU LIKE TO TRY A HARD GAME?"
530 I$=INKEY$:IF I$="" THEN 530
540 IF I$="Y" THEN GOSUB 4440
550 IF P>100 THEN P=INT(RND(1)*10+1)+90
560 CLS :PRINT:PRINT:PRINT "MOVE #";M;" ";
570 IF LH=0 THEN PRINT "YOU ARE NOW IN ROOM #";P:GOTO 590
580 PRINT 
590 O=0:FOR U=1 TO 10:IF BT(U)=P THEN O=1:NEXT 
600 IF O=1 THEN GOSUB 4470
610 IF V>100 THEN V=INT(RND(1)*20+1)+80
620 PRINT 
630 IF TR=0 THEN 660
640 PRINT "YOU ARE CARRYING ";TR;" GOLD COIN";:IF TR>1 THEN PRINT "S":GOTO 660
650 PRINT 
660 IF V<>INT(V) THEN 730
670 GOSUB 4610:IF V=P THEN 1770
680 PRINT "HE MOVES TO FIND YOU!":W=INT(RND(1)*10+1)
690 IF V>P THEN V=V-W:GOTO 710
700 V=V+W
701 IF V<1 THEN V=INT(RND(1)*10)+1
702 IF V>100 THEN V=INT(RND(1)*10)+91
710 GOSUB 4610
720 IF V=P THEN 1770
730 PRINT:IF BX=0 THEN 760
740 PRINT "YOU ARE CARRYING A MYSTERIOUSLY TICKING BOX."
750 IF BX<=M THEN 2020
760 IF SC=0 THEN PRINT "YOU ARE CARRYING A SCREWDRIVER."
770 IF SW=0 THEN PRINT "YOU ARE CARRYING A SAW."
780 IF BN=P THEN GOSUB 4970
790 IF BN=0 THEN GOSUB 5010
800 IF K1=0 THEN PRINT "YOU ARE CARRYING A KEY."
810 IF BB=P THEN GOSUB 4700
820 IF SC=P THEN PRINT "YOU JUST FOUND A SCREWDRIVER.":SC=0
830 IF K1=P THEN PRINT "YOU JUST FOUND A KEY":K1=0
840 IF GC(P)=0 THEN 880
850 PRINT "YOU JUST FOUND ";GC(P);" GOLD COIN";
860 IF GC(P)>1 THEN PRINT "S";
870 PRINT "!":TR=TR+GC(P):GC(P)=0
880 IF SW=P THEN GOSUB 4740
890 IF GN<1 THEN GOSUB 4820
900 IF INT(GN)=P THEN GOSUB 4780
910 IF K=P THEN GOSUB 4860
920 IF TR=P THEN PRINT "YOUR GOLD COINS ARE MAGICALLY DOUBLED!":TR=2*TR
930 IF LM=P THEN 2050
940 IF L2=P THEN 2240
950 X=INT(RND(1)*45+1):IF((X>40) AND(LH=0)) OR((X>30) AND(LH=1)) THEN GOSUB 4940
960 IF N>0 AND N<=M THEN PRINT "IT'S TOO LATE!":GOTO 1920
970 IF N>0 THEN PRINT "YOU MUST FIND THE FIRST AID KIT WITHIN ";N-M;" MOVES."
980 IF P=PD THEN 2410
990 IF P=- PD THEN PRINT "THERE IS A DEAD PUPPY DOG IN THIS ROOM."
1000 IF BT=P THEN GOSUB 5060
1010 IF DF=P THEN GOSUB 5100
1020 IF MF=P THEN GOSUB 5120
1030 DF=DF+1:MF=MF-.5
1040 IF P=GF THEN GOSUB 5150
1050 IF P=S THEN GOSUB 2590
1060 IF P=- RB THEN PRINT "THERE IS A PILE OF USELESS METALLIC JUNK ON THE FLOOR."
1070 IF P=RB THEN 2700
1080 IF P=MG THEN 3250
1090 IF P=MC THEN 3430
1100 IF P=GH THEN 3710
1110 IF P=G1 THEN 3860
1120 IF P=W1 THEN 4130
1130 IF P=W2 THEN 4160
1140 IF P=T5 THEN 4280
1150 IF P=- T5 THEN PRINT "THERE IS AN EMPTY TREASURE CHEST HERE."
1160 IF LQ=0 THEN 1170
1170 IF LQ=P THEN GOSUB 5370:GOTO 1190
1180 IF LQ=0 THEN 1190 ELSE GOSUB 5420
1190 IF(BT>0) AND(BT<25) THEN PRINT "YOUR FLASHLIGHT IS GETTING DIM."
1200 VS=INT(RND(1)*7+1):IF(VS>5) AND(V=int(v)) THEN PRINT "THE VILLAIN IS NOW LURKING IN ROOM #";V
1210 GOSUB 5200
1220 IF VH=P THEN PRINT "YOU FOUND THE VILLAIN'S TREASURE TROVE!" ELSE 1250
1230 IF V2=0 THEN PRINT "UNFORTUNATELY FOR YOU, IT CONTAINS NO COINS.":GOTO 1250
1240 PRINT "YOU FOUND";V2;"COINS IN HIS HIDE-OUT!":TR=TR+V2:V2=0
1250 PRINT:PRINT " *** AVAILABLE EXITS ***"
1260 PRINT 
1270 IF BT<1 THEN PRINT "????",:GOTO 1320
1280 IF N(P)=1 THEN PRINT "NORTH ";
1290 IF S(P)=1 THEN PRINT "SOUTH ";
1300 IF E(P)=1 THEN PRINT "EAST ";
1310 IF W(P)=1 THEN PRINT "WEST ";
1320 IF SW=0 THEN PRINT "CUT NEW EXIT ";
1330 PRINT 
1340 PRINT:PRINT " ",:PRINT "YOUR MOVE";:M$=INPUT$(1)
1350 PRINT 
1360 M=M+1
1370 IF M$="X" THEN 1510
1380 IF(M$="N") AND(N(P)=1) THEN 1530
1390 IF(M$="S") AND(S(P)=1) THEN 1550
1400 IF(M$="E") AND(E(P)=1) THEN 1560
1410 IF(M$="W") AND(W(P)=1) THEN 1580
1420 IF(M$="C") AND(SW=0) THEN 1590
1430 IF M$="A" THEN 5490
1440 IF M$="L" THEN 5590
1445 IF M$="Q" THEN 5700
1450 HA=HA+1:PRINT "YOU JUST RAN INTO A WALL, KLUTZ!"
1460 IF HA<50 THEN 570
1470 PRINT "YOU HAVE WALKED INTO SO MANY WALLS, YOU SUFFER BRAIN DAMAGE!"
1480 IF N>0 THEN 1920
1490 N=M+75:PRINT "YOU MUST FIND THE FIRST AID KIT WITHIN 75 MOVES OR YOU WILL LAPSE INTO A PERMANENT COMA."
1500 GOTO 570
1510 PRINT:PRINT " SECRET PASSAGEWAY":PRINT:PRINT 
1520 BT=BT-9:FOR X=1 TO 222:NEXT X:P=INT(RND(1)*100+1):M=M+9:GOTO 550
1530 P=P-10:IF P<1 THEN 1730
1540 GOTO 550
1550 P=P+10:GOTO 550
1560 P=P+1
1570 GOTO 550
1580 P=P-1:IF P<1 THEN 1730 ELSE 550
1590 PRINT "WHICH WALL DO YOU CUT A HOLE IN?":Q$=INPUT$(1)
1600 IF(Q$="N") OR(Q$="S") OR(Q$="E") OR(Q$="W") THEN 1620
1610 PRINT "THERE IS NO SUCH WALL.":GOTO 1250
1620 X=INT(RND(1)*20+1):IF X>15 THEN 1690
1630 IF Q$="N" THEN N(P)=1
1640 IF Q$="S" THEN S(P)=1
1650 IF Q$="E" THEN E(P)=1
1660 IF Q$="W" THEN W(P)=1
1670 IF X>9 THEN 1710
1680 GOTO 1250
1690 PRINT "THE SAW BREAKS BEFORE YOU MAKE AN OPENING LARGE ENOUGH TO CRAWL THROUGH."
1700 SW=- 1:GOTO 1250
1710 PRINT "THE SAW BREAKS JUST AS YOU FINISH CUTTING THE NEW EXIT."
1720 SW=- 1:GOTO 1250
1730 PRINT " ","YOU MADE IT!!!"
1740 PRINT "IT TOOK YOU ";M;" MOVES,":PRINT "AND YOU GOT OUT WITH ";TR;" COINS!"
1750 GOTO 1950
1760 END
1770 IF GN<1 THEN 1820
1780 IF H=1 THEN 1870
1790 PRINT "HE CAPTURES YOU AND THROWS YOU THROUGH A SECRET PASSAGEWAY!"
1800 IF TR>0 THEN PRINT "HE ALSO STEALS ALL OF YOUR GOLD COINS!":V2=V2+TR:TR=0
1810 P=INT(RND(1)*10+1)+90:GOTO 730
1820 PRINT "DO YOU SHOOT AT HIM?":Q$=INPUT$(1)
1830 X=0:IF Q$="Y" THEN 1850
1840 GOTO 1790
1850 GOSUB 4640:H=1:IF X>6 THEN 2010
1860 PRINT "YOU MISSED!":GOTO 1780
1870 PRINT "HE PULLS OUT HIS OWN GUN AND SHOOTS AT YOU!":FOR X=1 TO 222:NEXT 
1880 PRINT " ","*** BANG! ***":FOR X=1 TO 222:NEXT :PRINT:X=INT(RND(1)*10+1)
1890 IF X>7 THEN 1910
1900 PRINT "WHEW! HE MISSED!":GOTO 1790
1910 PRINT "HE GOT YOU!":PRINT 
1920 PRINT "YOU ARE DECEASED...":PRINT 
1930 PRINT:PRINT "YOU SURVIVED ";M;" MOVES,":PRINT "AND HAD ";TR;" GOLD COINS."
1940 RT=-64000!:GOTO 1960
1950 RT=INT((TR/M)*100)-M:PRINT "YOUR SCORE THIS TIME WAS ";RT
1960 IF RT<RX THEN PRINT "CURRENT HIGH SCORE IS" ;RX:GOTO 1990
1970 PRINT "PREVIOUS HIGH SCORE WAS ";RX:RX=RT
1990 PRINT "PLAY GAME #";G4;"?":Q$=INPUT$(1):IF Q$="Y" THEN TR=0:GOTO 150
2000 IF Q$="N" THEN PRINT "GOODBYE. HOPE YOU HAD FUN.":END 
2005 PRINT "INVALID RESPONSE.":GOTO 1990
2010 PRINT "GOT 'EM!!":V=V-.5:GOTO 730
2020 PRINT "THE TIME BOMB IN THE MYSTERIOUSLY TICKING BOX EXPLODES!"
2030 FOR X=1 TO 222:NEXT :PRINT " ","KA--";
2040 FOR X=1 TO 234:NEXT :PRINT "BOOM!!":PRINT:GOTO 1920
2050 GOSUB 4890
2060 IF Q$="Y" THEN 2080
2070 GOTO 940
2080 LM=LM+INT(RND(1)*5+1):ML=INT(RND(1)*9+1)
2090 IF(ML=1) AND(GN<1) THEN 2080
2100 IF ML=1 THEN PRINT "YOU ARE TRANSPORTED TO THE ROOM WITH THE GUN.":P=INT(GN) :GOTO 2220
2110 IF ML=2 THEN PRINT "YOU ARE TRANSPORTED TO THE ROOM WITH THE FIRST AID KIT.":P=K:GOTO 2220
2120 IF(ML=3) AND(SW<1) THEN 2080
2130 IF ML=3 THEN PRINT "YOU ARE TRANSPORTED TO THE ROOM WITH THE SAW.":P=SW:GOTO 2220
2135 IF ML=4 AND V<>INT(V) THEN 2080
2140 IF ML=4 THEN PRINT "THE VILLAIN IS PLACED IN ROOM #100.":V=100
2150 IF ML=5 THEN P=INT(RND(1)*20+1):PRINT "YOU ARE TRANSPORTED TO ROOM #";P:GOTO 2220
2160 IF(ML=6) AND(GH=0) THEN 2080
2170 IF ML=6 THEN PRINT "THE GHOST HAS BEEN EXORCISED.":GH=0
2180 IF ML=7 THEN PRINT "YOUR MOVE COUNT HAS BEEN REDUCED.":M=INT(M-INT(RND(1)*M/4+1)):GOTO 2220
2190 IF(ML=8) AND(LH=0) THEN 2080
2200 IF ML=8 THEN PRINT "A MAP APPEARS.":LH=0:GOTO 2220
2210 IF ML=9 THEN PRINT "A SET OF SPARE BATTERIES APPEARS.":BT=BT+100
2215 GOTO 950
2220 PRINT "PRESS RETURN":INPUT "",Q$
2230 M=M+1:GOTO 550
2240 GOSUB 4890
2250 IF Q$="Y" THEN 2270
2260 GOTO 950
2270 L2=0:ML=INT(RND(1)*12+1)
2275 IF ML=1 AND DF=101 THEN 2270
2280 IF ML=1 THEN PRINT "DAME FORTUNE IS DEAD.":DF=101
2285 IF ML=2 AND MF=0 THEN 2270
2290 IF ML=2 THEN PRINT "MISS FORTUNE IS DEAD.":MF=0
2295 IF ML=3 AND LQ=0 THEN 2270
2300 IF ML=3 THEN PRINT "THE LEPRECHAUN IS DEAD.":LQ=0
2305 IF V<>INT(V) AND ML=4 THEN 2270
2310 IF ML=4 THEN PRINT "THE VILLAIN IS DEAD.":V=V+.5
2315 IF ML=5 AND RB<1 THEN 2270
2320 IF ML=5 THEN PRINT "THE ROBOT'S BATTERIES ARE DEAD.":RB=0
2325 IF ML=6 AND MG=0 THEN 2270
2330 IF ML=6 THEN PRINT "THE MAD GAMBLER IS DEAD.":MG=0
2335 IF ML=7 AND GH=0 THEN 2270
2340 IF ML=7 THEN PRINT "THE GHOST HAS BEEN RETURNED TO ITS GRAVE.":GH=0
2345 IF ML=8 AND MC=0 THEN 2270
2350 IF ML=8 THEN PRINT "THE EVIL MERCHANT IS DEAD.":MC=0
2355 IF ML=9 AND PD<1 THEN 2270
2360 IF ML=9 THEN PRINT "THE PUPPY DOG IS DEAD.":PD=- PD
2365 IF ML=10 AND G1=0 THEN 2270
2370 IF ML=10 THEN PRINT "THE GORILLA IS DEAD.":G1=0
2375 IF ML=11 AND GF=0 THEN 2270
2380 IF ML=11 THEN PRINT "THE GOOD FAIRY IS DEAD.":GF=0
2390 IF ML=12 THEN 1920
2400 GOTO 950
2410 PRINT "THERE IS A PUPPY DOG IN THIS ROOM.":X=INT(RND(1)*10+1)
2420 IF X>7 THEN PRINT " ","WOOF! WOOF!"
2430 IF GN>.99 THEN 2500
2440 PRINT "DO YOU SHOOT THE PUPPY DOG?":Q$=INPUT$(1):
2450 IF Q$="Y" THEN 2470
2460 GOTO 2500
2470 PRINT "OH, YOU ARE A MEAN PERSON.":GOSUB 4640
2480 IF(X>0) AND(X<7) THEN PD=- PD:GOTO 980
2490 PRINT "YOU MISSED. ":Y=10
2500 X=INT(RND(1)*Y+1):IF X<4 THEN 2530
2510 IF X<7 THEN PRINT "THE PUPPY DOG WAGS ITS CUTE LI'L TAIL."
2520 GOTO 990
2530 PRINT "THE PUPPY DOG BITES YOU!":IF N>0 THEN 2550
2540 N=100+M:GOTO 2570
2550 X=N-M:IF X<4 THEN 1920
2560 N=M+INT(X/2)
2570 PRINT "YOU MUST FIND THE FIRST AID KIT WITHIN ";N-M;"MOVES."
2580 GOTO 990
2590 PRINT "THERE IS A SNAKE IN THIS ROOM.":PRINT " ";"HSSSS...":PRINT 
2600 IF GN<1 THEN 2650
2610 PRINT "YOU ARE BITTEN!":IF N>0 THEN 1920
2620 PRINT "THERE IS SOME ANTITOXEN IN THE FIRST AID KIT. YOU MUST FIND IT WITHIN 50 MOVES OR DIE.":N=M+50
2630 X=INT(RND(1)*10+1):IF X>5 THEN PRINT "THE SNAKE SLITHERS OFF.":S=INT(RND(1)*100+1)
2640 GOTO 1060
2650 PRINT "DO YOU TRY TO SHOOT THE SNAKE?":Q$=INPUT$(1)
2660 IF Q$="Y" THEN GOSUB 4640:GOTO 2680
2670 GOTO 2610
2680 IF X>5 THEN PRINT "YOU MISSED!":GOTO 2610
2690 PRINT "GOT 'EM!":S=0:GOTO 1060
2700 PRINT "THERE IS AN EIGHT FOOT TALL ROBOT IN THIS ROOM!"
2710 PRINT " ","* BEEP *"," ","*BEEP *":PRINT 
2720 RG=INT(RND(1)*50+1):M=M+1
2730 PRINT " WHAT DO YOU DO?":PRINT "X -- USE SECRET PASSAGEWAY"
2740 IF BN=0 THEN PRINT "F -- FEED BANANAS TO ROBOT"
2750 IF GN<1 THEN PRINT "S -- SHOOT ROBOT"
2760 PRINT "P -- PUSH PAST ROBOT TO NEAREST EXIT"
2770 IF SC=0 THEN PRINT "D -- DISMANTLE ROBOT"
2780 IF TR>0 THEN PRINT "G -- GIVE SOME GOLD COINS TO THE ROBOT"
2790 PRINT "C -- CRY":PRINT "E -- EAT ROBOT"
2800 PRINT "YOUR SELECTION?":Q$=INPUT$(1)
2810 IF Q$="X" THEN 1510
2820 IF(Q$="F") AND(BN=0) THEN 2900
2830 IF(Q$="S") AND(GN<1) THEN 2930
2840 IF Q$="P" THEN 2970
2850 IF(SC=0) AND(Q$="D") THEN 3090
2860 IF(TR>0) AND(Q$="G") THEN 3120
2870 IF Q$="C" THEN 3200
2880 IF Q$="E" THEN 3230
2890 PRINT "THAT IS NOT AN ACCEPTABLE ACTION.":GOTO 2730
2900 PRINT "THE ROBOT TAKES THE BANANAS IN ITS GRIPPER....";
2910 FOR X=1 TO 232:NEXT :PRINT "AND SQUEEZES THEM INTO A DISGUSTING PULP."
2920 FOR X=1 TO 246:NEXT :PRINT:PRINT "ROBOTS DO NOT EAT BANANAS.":GOTO 2730
2930 GOSUB 4640:IF X=0 THEN 2730
2940 PRINT "THE BULLET BOUNCES OFF THE ROBOT'S METALLIC HIDE WITHOUT EVEN DENTING IT."
2950 IF X<9 THEN 2730
2960 PRINT "BUT IT HITS YOU ON THE RICHOCHET!":GOTO 1920
2970 PRINT "THE ROBOT WILL NOT LET YOU PUSH BY.":PRINT "IT BREAKS YOUR ";
2980 X=INT(RND(1)*7+1):IF X=1 THEN PRINT "ARM":Y=100:XY=5
2990 IF X=2 THEN PRINT "LEG":Y=75:XY=8
3000 IF X=3 THEN PRINT "NOSE":Y=80:XY=6
3010 IF X=4 THEN PRINT "THUMB":Y=150:XY=2
3020 IF X=5 THEN PRINT "BACK":Y=35:XY=17
3030 IF X=6 THEN PRINT "NECK":Y=30:XY=20
3040 IF X=7 THEN PRINT "BIG TOE":Y=150:XY=3
3050 IF N>0 THEN 3080
3060 N=Y+M:PRINT "YOU MUST FIND THE FIRST AID KIT WITHIN ";N-M;" MOVES."
3070 GOTO 2730
3080 N=N-XY:IF N<M THEN 1920 ELSE 2730
3090 PRINT "THE SCREWDRIVER COMES IN HANDY. YOU SOONREDUCE THE ROBOT TO"
3100 PRINT "A HEAP OF USELESS JUNK.":RB=- RB
3110 GOTO 1080
3120 PRINT "HOW MANY COINS DO YOU OFFER TO THE ROBOT?":INPUT "",X
3130 IF X>TR THEN 3170
3140 TR=TR-X:PRINT "THE ROBOT TAKES ";X;" GOLD COINS AND ";
3150 IF X>RG THEN PRINT "LEAVES":RB=- RB:GOTO 1080
3160 PRINT "BLINKS A FEW LIGHTS AT YOU.":GOTO 2730
3170 PRINT "YOU DO NOT HAVE ";X;" COINS!"
3180 TR=0:PRINT "THE ROBOT TAKES THE COINS YOU DO HAVE."
3190 PRINT "THEN IT BREAKS YOUR";:GOTO 2980
3200 PRINT "CRYING WILL DO YOU NO GOOD."
3210 PRINT "DID YOU THINK THE ROBOT WOULD TAKE PITY ON YOU?"
3220 PRINT "HA! IT HAS A HEART OF TIN.":GOTO 2730
3230 PRINT "YOU CAN'T EAT A ROBOT, YOU SILLY PERSON.":X=INT(RND(1)*12+1)+1
3240 PRINT "YOU ONLY SUCCEED IN BREAKING ";X;" TEETH.":GOTO 2730
3250 PRINT "YOU JUST MET UP WITH THE MAD GAMBLER!":PRINT 
3260 INPUT "PLEASE PRESS 'RETURN'",Q$:CLS :IF TR>10 THEN 3290
3270 PRINT "BECAUSE YOU HAVE SO FEW COINS, HE HAS NO INTEREST IN YOU. HE THROWS YOU THROUGH A TRAP DOOR.":P=INT(RND(1)*20+1)+80
3280 INPUT "PLEASE PRESS 'RETURN'",Q$:M=M+1:GOTO 560
3290 PRINT "MAD GAMBLER:HE-HE-HEE! GREETINGS, MY PIGEON! WE SHALL PLAY A LITTLE HIGH CARD. IF YOU DRAW THE HIGH CARD, I'LL LET YOU EXIT NORTH, AND I'LL DOUBLE"
3300 PRINT "YOUR GOLD COINS. BUT IF I WIN, I GET HALF YOUR COINS, AND WE PLAY AGAIN."
3310 FOR X=1 TO 234:NEXT :PRINT:PRINT "YOU DRAW -- ";
3320 GOSUB 5270
3330 X1=CS(CC):X2=CR(CC):CC=CC+1
3340 GOSUB 5270
3350 Y1=CS(CC):Y2=CR(CC):CC=CC+1
3360 IF X1>Y1 THEN 3400
3370 IF(X1=Y1) AND(X2>Y2) THEN 3400
3380 PRINT " YOU LOSE!!!":PRINT "MAD GAMBLER:HA! HA! HA!":TR=INT(TR/2):IF TR<8 THEN 3270
3390 PRINT "LET'S PLAY AGAIN, PIGEON.":INPUT "PRESS 'RETURN' TO DRAW ",Q$:GOTO 3310
3400 PRINT " YOU WIN!!!":PRINT "MAD GAMBLER:RATS!"
3410 P=P-10:TR=TR*2:INPUT "PRESS 'RETURN' T''O EXIT TO NORTH ",Q$
3420 GOTO 550
3430 PRINT "YOU ENCOUNTER AN EVIL MERCHANT.":IF TR<10 THEN 3270
3440 PRINT "EVIL MERCHANT:WELL, MY FRIEND -- YOU MAY EXIT TO THE SOUTH, OR YOU CAN BARGAIN WITH ME FOR AN EXIT TO THE NORTH. DO YOU WANT TO BARGAIN";
3450 Q$=INPUT$(1)
3460 IF Q$="Y" THEN 3500
3470 PRINT:PRINT "EVIL MERCHANT:I'M SORRY WE COULDN'T DO BUSINESS TOGETHER."
3480 PRINT:INPUT "PRESS 'RETURN' TO EXIT TO THE SOUTH ",Q$
3490 P=P+10:GOTO 550
3500 X=INT(RND(1)*TR+1):CO=TR
3510 PRINT:PRINT "EVIL MERCHANT:MAKE ME AN OFFER MY FRIEND.(ENTER 0 TO END BARGAINING)"
3520 PRINT "YOUR OFFER?":INPUT "",Y:IF Y=0 THEN 3470
3530 IF Y>TR THEN 3570
3540 IF Y<X THEN 3610
3550 PRINT "EVIL MERCHANT:ALL RIGHT. I'LL ACCEPT THAT, MY FRIEND."
3560 P=P-10:INPUT "PRESS 'RETURN' TO EXIT TO THE NORTH ",Q$:TR=TR-Y:GOTO 550
3570 PRINT "EVIL MERCHANT:BAH! YOU DO NOT HAVE":PRINT Y;" GOLD COINS!"
3580 PRINT " I DO NOT ENJOY BEING CHEATED!":PRINT 
3590 PRINT "HE TAKES WHAT COINS YOU DO HAVE AND THROWS YOU THROUGH A TRAP DOOR!"
3600 TR=0:P=INT(RND(1)*20+1)+80:INPUT " PRESS 'RETURN' ",Q$:GOTO 550
3610 PRINT "EVIL MERCHANT:";:XY=INT(RND(1)*7+1)
3620 IF XY=1 THEN PRINT "BAH! AN EXIT TO THE NORTH IS WORTH AT LEAST ";CO
3630 IF XY=2 THEN PRINT "NO, DO I LOOK LIKE THE KIND OF MAN WHO WOULD ACCEPT ";Y;"?"
3640 IF XY=3 THEN PRINT "BAH! CHICKEN FEED."
3650 IF XY=4 THEN PRINT "NO. I WANT ";CO;" AT THE VERY LEAST."
3660 IF XY=5 THEN PRINT CO;" MIGHT BE REASONABLE, BUT NOT ";Y
3670 IF XY=6 THEN PRINT "NO. MAKE ME A REASONABLE OFFER."
3680 IF XY=7 THEN PRINT "NEVER WOULD I SELL AN EXIT TO THE NORTH FOR A MERE ";Y
3690 CO=CO-INT(RND(1)*10+1):IF CO<X THEN CO=X
3700 GOTO 3510
3710 PRINT:PRINT " ","BOO!":PRINT 
3720 PRINT "THIS ROOM IS HAUNTED BY A GHOST!"
3730 IF GN<1 THEN 3790
3740 PRINT "YOUR MOVE?":M$=INPUT$(1)
3750 M=M+1:IF M$="X" THEN 1510
3760 IF(M$="N") OR(M$="S") OR(M$="E") OR(M$="W") THEN 3780
3765 IF M$="A" OR M$="L" OR M$="Q" THEN PRINT"THE GHOST WILL NOT LET YOU DO THAT.":GOTO 3740
3770 PRINT "WHAT???":GOTO 3740
3780 PRINT "THE GHOST WILL NOT LET YOU GO THAT WAY.":GOTO 3740
3790 PRINT "DO YOU SHOOT AT THE GHOST?":Q$=INPUT$(1)
3800 IF Q$="Y" THEN 3820
3810 GOTO 3740
3820 GOSUB 4640
3830 IF X=0 THEN 3740
3840 PRINT "THE BULLET PASSES HARMLESSLY THROUGH THE GHOST."
3850 PRINT "IT'S STILL THERE.":GOTO 3790
3860 PRINT "A GORILLA IS IN THIS ROOM!"
3880 IF BN=0 THEN 4080
3885 IF GN<1 THEN 4000
3890 X=M+3
3900 PRINT "YOUR MOVE?":M$=INPUT$(1)
3910 M=M+1:IF M$="X" THEN 1510
3920 IF(M$="N") OR(M$="S") OR(M$="E") OR(M$="W") THEN 3950
3925 IF M$="A" OR M$="L" OR M$="Q" THEN PRINT "THE GORILLA WILL NOT LET YOU DO THAT.":GOTO 3900
3930 PRINT "WHAT?":IF M=X THEN 3970
3940 GOTO 3900
3950 PRINT "THE GORILLA WILL NOT LET YOU GO THAT WAY."
3960 IF M<X THEN 3900
3970 PRINT "ANNOYED BY YOUR FOOLING AROUND, THE GORRILLA WHUPS YOU UPSIDE THE HEAD --- AND THIS MONKEY IS STRONG!"
3980 IF N>0 THEN 1920
3990 N=M+50:PRINT "YOU MUST FIND THE FIRST AID KIT WITHIN 50 MOVES!":GOTO 3900
4000 PRINT "DO YOU SHOOT AT THE GORILLA?":Q$=INPUT$(1)
4010 IF Q$="Y" THEN 4030
4020 GOTO 3880
4030 GOSUB 4640
4040 IF X>5 THEN 4070
4050 PRINT "HA! YOU GOT THE BIG APE!"
4060 G1=0:GOTO 1120
4070 GOTO 3970
4080 PRINT "DO YOU TRY FEEDING THE BANANAS TO THE GORILLA?":Q$=INPUT$(1)
4090 IF Q$="Y" THEN 4110
4100 GOTO 3890
4110 PRINT "THE GORILLA LEAVES. HAPPILY MUNCHING ON THE BANANAS."
4120 BN=- 1:G1=0:GOTO 1120
4130 PRINT " A WICKED WITCH REARRANGES SOME OF THE TRAP DOORS IN THE BUILDING!"
4140 Y=INT(RND(1)*9+1)+1:FOR X=1 TO Y:T(X)=INT(RND(1)*100+1):NEXT 
4150 GOTO 1130
4160 PRINT " A WICKED WITCH REARRANGES SOME OF THE DOORS IN THE BUILDING!"
4170 FOR X=1 TO 75:Y=INT(RND(1)*80+1)+10:XY=INT(RND(1)*5+1)
4180 IF XY=1 THEN N(Y)=0
4190 IF XY=2 THEN S(Y)=0
4200 IF XY=3 THEN E(Y)=0
4210 IF XY=4 THEN W(Y)=0
4220 Y=INT(RND(1)*80+1)+10:XY=INT(RND(1)*4+1)
4230 IF XY=1 THEN N(Y)=1
4240 IF XY=2 THEN S(Y)=1
4250 IF XY=3 THEN E(Y)=1
4260 IF XY=4 THEN W(Y)=1
4270 NEXT :GOTO 1140
4280 PRINT "THERE IS A TREASURE CHEST IN THIS ROOM."
4290 PRINT "BUT IT IS LOCKED.": IF K1=0 THEN 4400
4300 IF GN<1 THEN 4320
4310 GOTO 1160
4320 PRINT "DO YOU TRY TO SHOOT THE LOCK OFF?":Q$=INPUT$(1) 
4330 IF Q$="Y" THEN 4350
4340 GOTO 4300
4350 GOSUB 4640
4360 IF X<7 THEN 4300
4370 PRINT "THE TREASURE CHEST IS OPEN!!":TX=INT(RND(1)*888+1)
4380 PRINT "IT CONTAINS ";TX;" GOLD COINS!"
4390 T5=-T5:TR=TR+TX:TX=0:GOTO 1160
4400 PRINT "DO YOU TRY USING THE KEY?":Q$=INPUT$(1)
4410 IF Q$="Y" THEN 4370
4420 GOTO 1160
4440 LH=1:FOR X=1 TO 5:BT(X)=0:NEXT 
4450 L2=0:DF=50:GF=0
4460 FOR X=1 TO 45:YX=INT(RND(1)*80+1)+10:N(YX)=0:NEXT :RETURN
4470 IF M<10 THEN RETURN
4480 PRINT:PRINT "THERE IS A VENDING MACHINE IN THIS ROOM. INSERT 25 COINS FOR FRESH BATTERIES!"
4490 PRINT "DO YOU USE THE MACHINE?":Q$=INPUT$(1) 
4500 IF Q$="Y" THEN 4530
4510 PRINT "OK."
4520 RETURN
4530 IF TR<25 THEN 4560
4540 TR=TR-25:BT=125:PRINT "YOU NOW HAVE A FRESH SET OF BATTERIES."
4550 RETURN
4560 IF TR>10 THEN 4590
4570 PRINT "FOR TRYING TO CHEAT THE MACHINE, YOU ARE SENT TO ROOM #100!"
4580 TR=0:P=100:RETURN
4590 TR=0:PRINT "THE MACHINE EATS ALL YOUR COINS. BUT DOESN'T GIVE YOU ANYTHING BECAUSE YOU DID NOT MEET THE PRICE."
4600 RETURN
4610 W=ABS(V-P):PRINT "VILLIAN IS ";W;" ROOM";
4620 IF(W=0) OR(W>1) THEN PRINT "S";
4630 PRINT " AWAY FROM YOU.":PRINT:RETURN
4640 IF GN<.1 THEN 4680
4650 PRINT:PRINT "*** BANG! ***":PRINT 
4660 X=INT(RND(1)*10+1):GN=GN-.1
4670 RETURN
4680 PRINT:PRINT "*** CLICK ***":PRINT 
4690 X=0:RETURN
4700 PRINT "THERE IS A MYSTERIOUSLY TICKING BOX IN THIS ROOM.":PRINT 
4710 PRINT "DO YOU PICK IT UP?":Q$=INPUT$(1)
4720 IF Q$="Y" THEN BB=0:BX=M+100
4730 RETURN
4740 PRINT "THERE IS A SAW LYING IN THE CORNER.":PRINT 
4750 PRINT "DO YOU PICK IT UP?":Q$=INPUT$(1)
4760 IF Q$="Y" THEN SW=0
4770 RETURN
4780 PRINT "THERE IS A GUN ON THE FLOOR HERE.":PRINT 
4790 PRINT "DO YOU PICK IT UP?":Q$=INPUT$(1)
4800 IF Q$="Y" THEN GN=GN-INT(GN)
4810 RETURN
4820 PRINT "YOU ARE CARRYING A GUN WITH "; INT(GN*10);
4830 PRINT " BULLET";:IF GN=.1 THEN PRINT ".":GOTO 4850
4840 PRINT "S!"
4850 RETURN
4860 PRINT "THERE IS A FIRST AID KIT IN THIS ROOM."
4870 IF N>0 THEN PRINT " ","YOU ARE SAVED!!"
4880 N=0:RETURN
4890 PRINT "THERE IS A MAGIC LAMP CHAINED TO THE WALL.":PRINT 
4900 PRINT "DO YOU RUB THE LAMP?":Q$=INPUT$(1)
4910 IF Q$="Y" THEN 4930
4920 RETURN
4930 CLS :PRINT:PRINT:PRINT "*POOF! *":PRINT:PRINT "THE LAMP VANISHES.":RETURN
4940 IF LH=1 THEN 4960
4950 PRINT "OH OH. YOU JUST LOST YOUR MAP.":LH=1:RETURN
4960 PRINT "HEY! YOU JUST FOUND A MAP.":LH=0:RETURN
4970 PRINT "YOU JUST FOUND A BUNCH OF BANANAS."
4980 PRINT "DO YOU PICK THEM UP?":Q$=INPUT$(1)
4990 IF Q$="Y" THEN BN=0
5000 RETURN
5010 PRINT "YOU ARE CARRYING A BUNCH OF BANANAS. DO YOU WANT TO EAT THEM";
5020 Q$=INPUT$(1):IF Q$="Y" THEN 5040
5030 RETURN
5040 BN=- 1:PRINT:PRINT " ","BURP":PRINT:IF N=0 THEN RETURN
5050 N=N+50:RETURN
5060 PRINT "THERE IS A BATTERY RECHARGER IN THE ROOM."
5070 IF BT<10 THEN BT=100:GOTO 5090
5080 BT=BT+50
5090 RETURN
5100 PRINT "YOU JUST RAN INTO DAME FORTUNE!":TR=TR+100
5110 P=INT(RND(1)*20+1):RETURN
5120 PRINT "YOU JUST RAN INTO MISS FORTUNE!":P=100
5130 IF TR>0 THEN TR=INT(TR/2)
5140 RETURN
5150 PRINT "A GOOD FAIRY PLANTS MORE GOLD COINS THROUGHOUT THE BUILDING!"
5160 PRINT:GF=0:FOR X=1 TO 100:Y=INT(RND(1)*12+1):IF Y>10 THEN Y=0
5170 GC(X)=GC(X)+Y:NEXT :GC(P)=0:RETURN
5180 PRINT "THE BATTERIES IN YOUR FLASHLIGHT ARE DEAD."
5190 PRINT "YOU CAN NOT SEE WHERE YOU ARE GOING.":RETURN
5200 FOR X=1 TO 10:IF T(X)=P THEN 5220
5210 NEXT :RETURN
5220 PRINT "YOU JUST FELL THROUGH A TRAP DOOR!"
5230 IF P>80 THEN 5260
5240 Y=INT(RND(150)+1):XY=P+Y:IF XY>100 THEN 5240
5250 P=P+Y:GOTO 5210
5260 P=INT(RND(1)*20+1)+80:GOTO 5210
5270 IF CR(CC)<11 THEN PRINT CR(CC);
5280 IF CR(CC)=11 THEN PRINT "JACK";
5290 IF CR(CC)=12 THEN PRINT "QUEEN";
5300 IF CR(CC)=13 THEN PRINT "KING";
5310 IF CR(CC)=14 THEN PRINT "ACE";
5320 PRINT " OF ";:IF CS(CC)=1 THEN PRINT "SPADES"
5330 IF CS(CC)=2 THEN PRINT "DIAMONDS"
5340 IF CS(CC)=3 THEN PRINT "CLUBS"
5350 IF CS(CC)=4 THEN PRINT "HEARTS"
5360 RETURN
5370 PRINT "YOU JUST CAUGHT THE LEPRECHAUN!"
5380 IF TR<10 THEN TR=50:GOTO 5400
5390 TR=INT(TR*2.5)
5400 LQ=INT(RND(1)*60+1)+40:X=ABS(LQ-P):IF X<20 THEN 5400
5410 RETURN
5420 X=ABS(LQ-P):PRINT "THE LEPRECHAUN IS ";X;" ROOM";
5430 IF X>1 THEN PRINT "S AWAY":GOTO 5450
5440 PRINT " AWAY"
5450 PRINT "BUT THEN HE MOVES."
5460 LQ=LQ+INT(RND(1)*5+1):IF LQ>100 THEN LQ=INT(RND(1)*60+1)+30
5480 RETURN
5490 CLS:AZ=1:PRINT "ENTER A FILE NAME TO SAVE GAME IN. DO NOT INCLUDE A .ESC EXTENTION.":INPUT "",F$
5500 F$=F$+".ESC"
5510 OPEN F$ FOR OUTPUT AS 1
5520 FOR I=1 TO 100:PRINT#1,N(I);CHR$(13);S(I);CHR$(13);E(I);CHR$(13);W(I);CHR$(13);GC(I):NEXT 
5530 FOR I=1 TO 10:PRINT#1,T(I):NEXT 
5540 FOR I=1 TO 12:PRINT#1,BT(I):NEXT 
5550 FOR I=1 TO 54:PRINT#1,CS(I):NEXT 
5560 FOR I=1 TO 52:PRINT#1,CR(I):NEXT 
5570 PRINT#1,TR;M;P;LH;BT;V;BX;SC;SW;BN;K1;BB;N;PB;RB;T5;HA;V2;RX;GH;G4;K;DF;MF;LQ;MC;MG;G1;GF;S;W1;W2
5580 M=M-1:AZ=0:PRINT "SAVE PROCESS COMPLETE.":CLOSE:GOTO 1340
5590 CLS:AZ=2:PRINT "ENTER FILE TO LOAD. DO NOT INCLUDE THE .ESC EXTENTION.":INPUT "",F$
5600 F$=F$+".ESC"
5610 OPEN F$ FOR INPUT AS 1
5620 FOR I=1 TO 100:INPUT#1,N(I),S(I),E(I),W(I),GC(I):NEXT 
5630 FOR I=1 TO 10:INPUT#1,T(I):NEXT 
5640 FOR I=1 TO 12:INPUT#1,BT(I):NEXT 
5650 FOR I=1 TO 54:INPUT#1,CS(I):NEXT 
5660 FOR I=1 TO 52:INPUT#1,CR(I):NEXT 
5670 INPUT#1,TR,M,P,LH,BT,V,BX,SC,SW,BN,K1,BB,N,PB,RB,T5,HA,V2,RX,GH,G4,K,DF,MF,LQ,MC,MG,G1,GF,S,W1,W2
5680 AZ=0:PRINT "RESTORE PROCESS COMPLETE.":CLOSE:GOTO 570
5700 PRINT "ARE YOU SURE YOU WANT TO QUIT THIS GAME?"
5710 I$=INPUT$(1)
5720 IF I$="N" THEN M=M-1:GOTO 1340
5730 IF I$="Y" THEN PRINT "GOODBYE. HOPE YOU HAD FUN.":END
5740 PRINT "INVALID RESPONSE":GOTO 5700
