110 LOMEM: 24576: FOR X = 1 TO 16: READ P,D: NEXT : FOR X = 800 TO 813: READ Y: POKE X,Y: NEXT : FOR X = 832 TO 848: READ Y: POKE X,Y: NEXT : POKE 850,0: POKE 851,0: ONERR GOTO 2970
120 GOTO 2990
130 IF DS = 1 THEN SC = 3
140 IF DS = 3 THEN SC = 2
150 ON SH GOSUB 160,190,160,160,200,210,220,230,190,240,190: RETURN
160 Z = A +SC *(SC +1):W = B +8 -SC
170 HPLOT Z,W TO Z +12 *SC,W TO Z +12 *SC,W +30 *SC TO Z,W +30 *SC TO Z,W TO Z -2 *SC,W -2 *SC TO Z +10 *SC,W -2 *SC TO Z +12 *SC,W: HPLOT Z -2 *SC,W -2 *SC TO Z -2 *SC,W +28 *SC TO Z,W +30 *SC
180 HPLOT Z +2 *SC,B +13 *SC TO Z +10 *SC,B +13 *SC TO Z +10 *SC,B +15 *SC TO Z +2 *SC,B +15 *SC TO Z +2 *SC,B +13 *SC: RETURN
190 HPLOT A -5 *SC,B +20 *SC TO A,B TO A +5 *SC,B +20 *SC TO A,B +15 *SC TO A -5 *SC,B +20 *SC: HPLOT A,B +12 *SC TO A,B +20 *SC: RETURN
200 HPLOT A -3,B +2 TO A +3,B +2 TO A -3,B +6 TO A,B TO A +3,B +6 TO A -3,B +2: RETURN
210 HPLOT A,B +7 TO A +20,B +7 TO A +10,B TO A,B +7: RETURN
220 W = B -5:ZZ = A -5: HPLOT ZZ,W TO ZZ +8,W +6 TO ZZ +5,W TO ZZ +9,W +5 TO ZZ,W +9 TO ZZ +8,W: RETURN
230 HPLOT A,B +2 TO A +14 *SC,B +2: HPLOT A +3 *SC,B +1 TO A +11 *SC,B +1: HPLOT A +5 *SC,B TO A +9 *SC,B: RETURN
240 HPLOT A +1,B +1 TO A +9,B +1 TO A +9,B +9 TO A +1,B +9 TO A +1,B +1: RETURN
250 OP = PD:PD = PDL(0): IF OP < >PD THEN HCOLOR= 0: HPLOT 140,158 TO LX,150:LX = 127 + INT(PD/255 *25): HCOLOR= 3: HPLOT 140,158 TO LX,150:SI = LX -140
260 RETURN
270 X = INT( RND(1) *10): IF RP(X) < >1 THEN 400
280 DD = 400: ON X GOTO 290,300,310,320,330,340,350,360,370
410 GOSUB 250:A$ = "":FR = FRE(0): IF PEEK( -16287) <128 THEN 470
420 HCOLOR= 6: POKE 839,0: POKE 845,60: CALL 832:FX = LX:FY = 150:SF = SF +1:OX = FX:OY = FY:FY = P3:DS = 1:Y = FY:FX = LX +SI *(150 -FY)/P5: IF FX >1 AND FX <267 THEN HPLOT OX,OY TO FX,FY:OX = FX:OY = FY: GOTO 1940
430 GOTO 460
440 FY = P2:DS = 3: GOTO 1970
450 FY = P1:DS = 4:Y = FY:FX = LX +SI *(150 -FY)/P5: IF FX >1 AND FX <267 THEN HPLOT OX,OY TO FX,FY:OX = FX:OY = FY: GOTO 2020
460 EN = EN -500: GOSUB 900: HCOLOR= 0: HPLOT LX,150 TO OX,OY: GOSUB 250
470 IF PEEK( -16287) >127 THEN 420
480 IF RND(1) >.96 THEN 700
490 ADJ = 1:KEY = PEEK(49152): IF KEY <128 THEN 270
500 GET A$: IF A$ = " " THEN 1430
510 IF A$ < >"M" OR ME < = 0 THEN 640
520 ME = ME -1:EN = EN -1600: POKE 839,0: POKE 845,50: FOR Z = 1 TO 2: CALL 832: HPLOT 0,0: CALL 62454: HCOLOR= 2: CALL 832: HPLOT 0,0: CALL 62454: HCOLOR= 5: NEXT : CALL 832
530 F2 = 1: FOR Z = 1 TO 9: ON Z GOTO 540,550,560,570,580,590,600,610,620
540 FX = 131:FY = P3: GOTO 1940
550 FX = 131:FY = P2: GOTO 1970
560 FX = 128:FY = P1: GOTO 2020
570 FX = 59:FY = P2: GOTO 1970
580 FX = 221: GOTO 1970
590 FX = 32:FY = P1: GOTO 2020
600 FX = 92: GOTO 2020
610 FX = 176: GOTO 2020
620 FX = 248: GOTO 2020
630 NEXT :F2 = PEEK(49168):F2 = 0: GOTO 1160
640 IF A$ = CHR$(27) THEN T1$ = " STATUS REPORT ": POKE 801,0: POKE 806,8: CALL 800: GOSUB 2670: CALL 800
650 IF VAL(A$) >0 AND VAL(A$) <9 THEN HCOLOR= 0: GOSUB 1260:DI = VAL(A$): GOSUB 1210
660 IF A$ < >"Q" THEN 270
670 TEXT : HOME : VTAB (12): HTAB (4): FLASH : PRINT "DO YOU REALLY WANT TO QUIT <Y/N>?";: FOR X = 1 TO 3: POKE 801,0: POKE 806,10: CALL 800: POKE 801,200: POKE 806,15: CALL 800: NEXT
680 NORMAL : GET AN$: IF AN$ < >"Y" THEN POKE -16302,0: POKE -16299,0: POKE -16304,0: GOTO 270
730 IF RND(1) <.30 THEN HCOLOR= 3: HPLOT X +P4,Y +P4 TO X +P4,158: HCOLOR= 5:A = X +9:B = 152: GOSUB 220: CALL 800: HCOLOR= 0: HPLOT X +P4,Y +P4 TO X +P4,158: GOSUB 220: HCOLOR= 3:DA = DA +600
740 CALL 800: HCOLOR= 0:A = X:B = Y: GOSUB 210: IF X >19 AND X <242 THEN 770
750 X = PEEK(49168): FOR X = 1 TO 2: POKE 801,0: POKE 806,10: CALL 800: POKE 801,200: POKE 806,15: CALL 800: NEXT :TR = TR +1
1160 HGR2 : POKE -16302,0:PD = -1: HCOLOR= 1: HPLOT 1,0 TO 279,0 TO 279,159 TO 1,159 TO 1,0
1170 HCOLOR= 2:HX = 1: HPLOT HX,50:HX = 0: FOR X = 1 TO 10:HY = INT( RND(1) *10):HX = HX +28: HPLOT TO HX -1,50 -HY: NEXT : HCOLOR= 1: HPLOT HX -1,50 -HY: HCOLOR= 3
1180 FR = FRE(0): HCOLOR= 3: HPLOT 1,50: FOR X = 28 TO 280 STEP 28:B = 22 - INT( RND(1) *22):SH = 5:A = X -20 +( INT( RND(1) *10)): GOSUB 200: NEXT : HCOLOR= 3
1190 HCOLOR= 3: HPLOT 1,161 TO 279,161 TO 279,191 TO 1,191 TO 1,161: HPLOT 40,161 TO 40,191: HPLOT 249,161 TO 249,191: HPLOT 264,161 TO 264,191: HPLOT 250,168 TO 278,168: HPLOT 250,176 TO 278,176: HPLOT 250,184 TO 278,184
1220 X = PX -R1:Y = PY -R2: IF X = >0 AND Y = >0 THEN SH = 10:A = 9:B = 165: GOSUB 240: GOTO 1260
1230 IF X = >0 AND Y <0 THEN SH = 10:A = 9:B = 175: GOSUB 240: GOTO 1260
1240 IF X <0 AND Y = >0 THEN SH = 10:A = 18:B = 165: GOSUB 240: GOTO 1260
1250 SH = 10:A = 18:B = 175: GOSUB 240
1260 ON DI GOSUB 1270,1280,1290,1300,1310,1320,1330,1340: RETURN
1270 HPLOT 20,176 TO 20,166: RETURN
1280 HPLOT 20,176 TO 30,166: RETURN
1290 HPLOT 20,176 TO 30,176: RETURN
1300 HPLOT 20,176 TO 30,186: RETURN
1310 HPLOT 20,176 TO 20,186: RETURN
1320 HPLOT 20,176 TO 10,186: RETURN
1330 HPLOT 20,176 TO 10,176: RETURN
1340 HPLOT 20,176 TO 10,166: RETURN
1350 Y = 171: HCOLOR= 1: HPLOT 45,Y TO 65,167 TO 55,175 TO 75,Y:X = 84 +EN/99999 *159: HPLOT 85,Y TO X,Y: HPLOT 243,171
1360 Y = 181: HCOLOR= 5: FOR X = 45 TO 75 STEP 6: HPLOT X,Y TO X +3,Y: NEXT :X = 85 +DA/99999 *158: HPLOT 85,Y TO X,Y: HPLOT 243,Y: IF ME <1 THEN 1390
1370 HCOLOR= 6:X1 = 253:X2 = 260:Y = 165:E = ME: IF ME >4 THEN E = 4
1380 FOR X = 1 TO E: HPLOT X1,Y TO X2,Y:Y = Y +7: NEXT
1390 IF ME <5 THEN HCOLOR= 3: GOTO 1410
1400 X1 = 268:X2 = 275:Y = 165:E = ME -4: FOR X = 1 TO E: HPLOT X1,Y TO X2,Y:Y = Y +7: NEXT : HCOLOR= 3: IF F5 = 1 THEN RETURN
1410 IF S1 = 1 THEN GOSUB 1520: GOSUB 1210: GOTO 270
1420 GOSUB 1530: GOSUB 1210: GOTO 270
1430 POKE 801,30: POKE 806,25: CALL 800:EN = EN -300: ON DI GOTO 1440,1450,1460,1470,1480,1490,1500,1510
1440 XI = 0:YI = 1: GOTO 1160
1450 XI = 1:YI = 1: GOTO 1160
1460 XI = 1:YI = 0: GOTO 1160
1470 XI = 1:YI = -1: GOTO 1160
1480 XI = 0:YI = -1: GOTO 1160
1490 XI = -1:YI = -1: GOTO 1160
1500 XI = -1:YI = 0: GOTO 1160
1510 XI = -1:YI = 1: GOTO 1160
1520 IF A$ < >"M" THEN PX = PX +XI:PY = PY -YI
1530 FOR X = 1 TO 9:RP(X) = 0: NEXT : IF PX <1 THEN PX = 20
1540 IF PX >20 THEN PX = 1
1550 IF PY <1 THEN PY = 20
1560 IF PY >20 THEN PY = 1
1570 IF S1 = 0 THEN S1 = 1: GOTO 1620
1580 IF A$ < >"M" THEN X = PX:Y = PY: GOSUB 980: IF LC = 1 AND DP = DI THEN DA = DA +10000: TEXT : HOME : VTAB 10: INVERSE : PRINT "ROVER HIT OBELISK--- IT SELF DESTRUCTS": NORMAL : PRINT : FLASH : PRINT "<< ROVER SUSTAINS SIGNIFICANT DAMAGE >>"
1590 IF A$ < >"M" AND LC = 1 AND DP = DI THEN NORMAL : FOR X = 1 TO 3: POKE 801,0: POKE 806,10: CALL 800: POKE 801,200: POKE 806,15: CALL 800: NEXT : FOR X = 1 TO 1500: NEXT : POKE -16302,0: POKE -16299,0: POKE -16304,0
1600 IF LC = 3 AND DP < >DI THEN 1620
1610 IF LC = 3 THEN T1$ = " SAFE IN SHIP! ":EOG = 1:ADJ = 1.2: GOTO 2940
1620 DP = DI:X = PX +1 *XI:Y = PY -1 *YI: GOSUB 940: IF LC < >0 THEN XL = 100:YL = 50:DS = 1:P = 1: GOSUB 990: IF LC < >2 THEN 1650
1630 X = PX +2 *XI:Y = PY -2 *YI: GOSUB 940: IF LC < >0 THEN XL = 115:YL = 60:DS = 3:P = 2: GOSUB 990: IF LC < >2 THEN 1650
1640 X = PX +3 *XI:Y = PY -3 *YI: GOSUB 940: IF LC < >0 THEN XL = 127:YL = 50:DS = 4:P = 3: GOSUB 990
1650 ON DI GOTO 1660,1730,1800,1870,1660,1730,1800,1870
3020 VTAB 1: HTAB 1: FOR X = 1 TO 39:BL$ = BL$ +" ": NEXT : INVERSE : PRINT BL$: FOR X = 2 TO 23: PRINT " ";: HTAB 39: PRINT " ": NEXT : PRINT BL$;: NORMAL
3030 VTAB 20: IF NOT NX THEN GOSUB 2930: HTAB (8): FLASH : PRINT " <<HIT ANY KEY TO BEGIN>>";: NORMAL : GET A$: PRINT : VTAB 20: HTAB (8): PRINT "USE <ESC> FOR INSTRUCTIONS";
3050 HTAB 4: FOR X = 1 TO 32: PRINT "-";: NEXT : PRINT : RETURN
3060 DATA 18,250,24,250,23,75,22,72,19,75,28,250,24,250,23,75,22,75,19,75,28,250,24,250,23,100,22,100,23,100,19,250: DATA 162,48,141,48,192,169,16,32,168,252,202,208,245,96,162,1,141,48,192,138,105,56,32,168,252,232,224,21,208,242,96
3070 DATA 18,250,24,250,23,75,22,72,19,75,28,250,24,250,23,75,22,75,19,75,28,250,24,250,23,100,22,100,23,100,19,250