1 CLR$=CHR$(26)    '              CLEAR SCREEN
2 PRINT CLR$
3 FOR K=1 TO 5:PRINT:NEXT K
10 PRINT TAB(5)"************************* H/Z-89 LUNAR LANDER **************************" 
20 PRINT:PRINT
30 PRINT TAB(5) "The author of the original Lander Program is unknown. Modifications"
40 PRINT
50 PRINT TAB(5) "made in adapting this software to Heath/Zenith Computer was implemented"
60 PRINT
70 PRINT TAB(5) "by Hank Toliver in November, 1982."
80 PRINT:PRINT
90 PRINT TAB(5) "************************************************************************"
100 REM
120 RV$=CHR$(27)+"l"      '		ENTER HALF INTENSITY
130 XV$=CHR$(27)+"m"      '		EXIT REVERSE VIDEO
140 TL$=CHR$(27)+CHR$(120)+CHR$(49)'	ENABLE 25th LINE
150 DTL$=CHR$(27)+CHR$(121)+CHR$(49)'	DISABLE 25th LINE
160 DC$=CHR$(27)+"=" '		DIRECT CURSOR ADDRESSING
170 CN$=CHR$(27)+CHR$(121)+CHR$(53)'	CURSOR ON
180 CF$=CHR$(27)+CHR$(120)+CHR$(53)'	CURSOR OFF
190 PRINT DC$;CHR$(56);CHR$(56);CHR$(7)
200 IF INKEY$>"" THEN 200
210 PRINT TAB(25) "Do you want instructions";
220 C$=INKEY$
230 IF C$="Y" THEN PRINT CLR$;DC$;CHR$(32);CHR$(32):GOTO 260
240 IF C$="N" THEN PRINT CLR$;DC$;CHR$(32);CHR$(32):GOTO 340
250 GOTO 220
260 PRINT CLR$
270 RESTORE 1680
280 FOR K=1 TO 18
290 READ IN$
300 PRINT TAB(10) IN$
310 NEXT K
320 PRINT DC$;CHR$(54);CHR$(51) "Strike any key to continue.....";
330 IF INKEY$="" THEN 330
340 PRINT CLR$;CF$
350 PRINT DC$;CHR$(32);CHR$(36);RV$;"S C A N N E R   S C R E E N"
360 PRINT DC$;CHR$(32);CHR$(80)"S T A T U S   M O N I T O R";XV$
370 FOR K=0 TO 14
380 PRINT DC$;CHR$(34+K);CHR$(36) "-"
390 NEXT K
400 PRINT DC$;CHR$(34);CHR$(38) "120"
410 PRINT DC$;CHR$(41);CHR$(38) "60"
420 PRINT DC$;CHR$(47);CHR$(38) "8"
430 PRINT CHR$(27);CHR$(70)
440 PRINT DC$;CHR$(33);CHR$(79) "f"
450 PRINT DC$;CHR$(33);CHR$(35) "f"
460 PRINT DC$;CHR$(50);CHR$(79) "e"
470 PRINT DC$;CHR$(50);CHR$(35) "e"
480 PRINT DC$;CHR$(33);CHR$(107) "c"
490 PRINT DC$;CHR$(33);CHR$(63) "c"
500 PRINT DC$;CHR$(50);CHR$(107) "d"
510 PRINT DC$;CHR$(50);CHR$(63) "d"
520 FOR K=0 TO 26
530 PRINT DC$;CHR$(33);CHR$(80+K) "a"
540 PRINT DC$;CHR$(33);CHR$(36+K) "a"
550 PRINT DC$;CHR$(50);CHR$(80+K) "a"
560 PRINT DC$;CHR$(50);CHR$(36+K) "a"
570 NEXT K
580 FOR K=0 TO 15
590 PRINT DC$;CHR$(34+K);CHR$(79) "`"
600 PRINT DC$;CHR$(34+K);CHR$(35) "`"
610 PRINT DC$;CHR$(34+K);CHR$(107) "`"
620 PRINT DC$;CHR$(34+K);CHR$(63) "`"
630 NEXT K
640 PRINT CHR$(27);CHR$(71)
650 PRINT DC$;CHR$(34);CHR$(80) "Elasped Seconds:"
660 PRINT DC$;CHR$(37);CHR$(80) "Miles:       Feet:"
670 PRINT DC$;CHR$(40);CHR$(80) "Miles Per Hour:"
680 PRINT DC$;CHR$(43);CHR$(80) "Fuel Remaining:"
690 PRINT DC$;CHR$(46);CHR$(80) "Prior Burn rate:"
700 PRINT DC$;CHR$(49);CHR$(80) "Prior Burn Time:"
710 PRINT DC$;CHR$(49);CHR$(37) "SCANNER MODE: "
720 A=120:V=1:M=33000!:N=16500:G=.001:Z=1.8:L=0:K=0:T=0:BT=0:PO=34:LK=121:LR=0
730 PRINT DC$;CHR$(34);CHR$(97) RV$;L
740 PRINT DC$;CHR$(37);CHR$(87) INT(A)
750 PRINT DC$;CHR$(37);CHR$(100) INT(5280*(A-INT(A)))
760 PRINT DC$;CHR$(40);CHR$(95) 3600*V
770 PRINT DC$;CHR$(43);CHR$(96) M-N
780 PRINT DC$;CHR$(46);CHR$(100) K
790 PRINT DC$;CHR$(49);CHR$(100) BT;XV$
800 PRINT CHR$(27);CHR$(106)
810 GOSUB 1760
820 PRINT TL$;DC$;CHR$(56);CHR$(42) CLR$;CN$
830 PRINT TAB(15);RV$;"Input Burn Rate and Time (Separated by Comma)";XV$;
840 INPUT K,T
850 BT=T
860 PRINT DTL$
870 PRINT CHR$(27);CHR$(107)
880 IF K>300 GOTO 820
890 IF K<0 GOTO 820
900 IF T<0 GOTO 820
910 IF M-N<.001 THEN 1020
920 IF T<.001 THEN 730
930 S=T
940 IF M>=N+S*K THEN 960
950 S=(M-N)/K
960 GOSUB 1520
970 IF I<=0 THEN 1380
980 IF V<=0 THEN 1000
990 IF J<0 THEN 1440
1000 GOSUB 1340
1010 GOTO 910
1020 PRINT CLR$
1030 PRINT TAB(10) "* Out of fuel at";L;"seconds":M=0:N=0
1040 S=(-V+SQR(V*V+2*A*G))/G
1050 V=V+G*S
1060 L=L+S
1070 W=3600*V
1080 PRINT
1090 PRINT TAB(10) "* On moon at";L;"seconds....Impact velocity";W;"miles per hour"
1100 PRINT
1110 PRINT TAB(10) "* There's";M-N;"pounds of fuel remaining"
1120 PRINT
1130 IF W>1.2 THEN 1180
1140 PRINT TAB(10) "* Great Landing.....You're a regular Buck Rogers!!!!"
1150 PRINT
1160 GOTO 1580
1170 PRINT
1180 IF W>10 THEN 1220
1190 PRINT TAB(10) "* That was a nice landing.....Live long and prosper!!!!"
1200 GOTO 1580
1210 PRINT
1220 IF W>60 THEN 1290
1230 PRINT TAB(10) "* Craft damaged. You are stranded until a rescue mission"
1240 PRINT
1250 PRINT TAB(12) "arrives. Hope your supplies and oxygen hold out."
1260 PRINT
1270 GOTO 1580
1280 PRINT
1290 PRINT TAB(10) "* You crashed.....No survivors."
1300 PRINT
1310 PRINT TAB(10) "* The Lander blasted a new lunar crater";W*.2777;"feet deep"
1320 PRINT
1330 GOTO 1580
1340 L=L+S:T=T-S
1350 M=M-S*K
1360 A=I:V=J
1370 RETURN
1380 IF S<.005 THEN PRINT CLR$:GOTO 1070
1390 D=V+SQR(V*V+2*A*(G-Z*K/M))
1400 S=2*A/D
1410 GOSUB 1520
1420 GOSUB 1340
1430 GOTO 1380
1440 W=(1-M*G/(Z*K))/2
1450 S=M*V/(Z*K*(W+SQR(W*W+V/Z)))+.05
1460 GOSUB 1340
1470 IF I<=0 THEN 1380
1480 GOSUB 1340
1490 IF J>0 THEN 910
1500 IF V>0 THEN 1440
1510 GOTO 910
1520 Q=S*K/M
1530 IF Q>.000001 THEN 1550
1540 Q=0
1550 J=V+G*S-Z*Q*(1+Q*(.5+Q*(1/3+Q*(.25+Q/5))))
1560 I=A-G*S*S/2-V*S+Z*S*Q*(.5+Q*(1/6+Q*(1/12+Q/20)))
1570 RETURN
1580 PRINT TL$
1590 IF INKEY$>"" THEN 1590
1600 PRINT DC$;CHR$(56);CHR$(32)
1610 PRINT TAB(10)CHR$(7);"Would you like to try again  (Y/N)";
1620 C$=INKEY$
1630 IF C$="Y" THEN 1660
1640 IF C$="N" THEN PRINT DTL$;DC$;CHR$(32);CHR$(32);CLR$:GOTO 1670
1650 GOTO 1620
1660 PRINT DTL$;DC$;CHR$(32);CHR$(32):GOTO 340
1670 END
1680 DATA, "The capsule weight is 33000 pounds and you have 16500 pounds"
1690 DATA, "of fuel available. Your estimated free fall impact time is"
1700 DATA, "113.553 seconds. You must set the retro rocket burn rate to a"
1710 DATA, "value from 0 LBS/SEC (free fall) to 300 LBS/SEC (full power)."
1720 DATA, "To enter your commands, simply type the pounds of fuel to be"
1730 DATA, "expended; followed by a comma and the number of seconds for"
1740 DATA, "which the burn should last."
1743 DATA, " "
1745 DATA, "E X A M P L E :  '300,30'   (means 300 lbs for 30 seconds)"
1750 DATA, "		G O O D    L U C K"
1760 PRINT DC$;CHR$(PO);CHR$(49) "      ";CF$
1770 GOSUB 1800
1780 PRINT DC$;CHR$(PO);CHR$(49) "L.E.M.";CHR$(7)
1790 RETURN
1800 IF A>15 THEN 1810 ELSE 1910
1810 LR=LR+1
1820 IF LR>1 THEN 1840
1830 PRINT DC$;CHR$(49);CHR$(52);RV$;"Long Range";XV$
1840 SR=0:LK1=0
1850 FOR K=LK TO 0 STEP-1
1860 LK1=LK1+.125
1870 IF INT(A)<K THEN NEXT K
1880 PO=PO+INT(LK1)
1890 LK=K-1
1900 RETURN
1910 IF A<15 AND A>1 THEN SR=SR+1:GOTO 1940
1920 GOTO 2080
1930 REM:IF A<=1 AND INT(5280*(A-INT(A)))<5280 THEN 2500
1940 IF SR>1 THEN 1990
1950 PRINT DC$;CHR$(49);CHR$(51);RV$;"Approach";XV$;"    ";CHR$(7)
1960 PRINT DC$;CHR$(34);CHR$(38) "15 "
1970 PRINT DC$;CHR$(41);CHR$(38) "7 "
1980 PRINT DC$;CHR$(47);CHR$(38) "1"
1990 PRINT DC$;CHR$(PO);CHR$(49) "      "
2000 GOSUB 2020
2010 PRINT DC$;CHR$(PO);CHR$(49) "L.E.M."
2020 LK=16:NR=0:LK1=0:PO=34
2030 FOR K=LK TO 0 STEP-1
2040 LK1=LK1+.755
2050 IF INT(A)<K THEN NEXT K
2060 PO=PO+INT(LK1)
2070 RETURN
2080 IF NR>1 THEN 2110
2090 PRINT DC$;CHR$(49);CHR$(51);RV$;"Landing";XV$;"     ";CHR$(7)
2100 NR=2
2110 PRINT DC$;CHR$(34);CHR$(38) INT(5280*(A-INT(A)))*2;"ft  "
2120 PRINT DC$;CHR$(41);CHR$(38) INT(5280*(A-INT(A)));"ft  "
2130 PRINT DC$;CHR$(47);CHR$(38) INT(5280*(A-INT(A)))/2;"ft  "
2140 PO=41
2150 IF 3600*V<5 AND INT(5280*(A-INT(A)))<20 AND M-N>600 THEN GOSUB 2170
2160 RETURN
2170 FT=INT(5280*(A-INT(A))):SP=.1
2180 PRINT DC$;CHR$(41);CHR$(49) "L.E.M."
2190 FOR K=FT TO 0 STEP -1
2200 PRINT CHR$(7)
2210 PRINT DC$;CHR$(37);CHR$(100);RV$;K
2220 PRINT DC$;CHR$(43);CHR$(96) M-N
2230 PRINT DC$;CHR$(40);CHR$(95) (3600*V)-SP;XV$
2240 PRINT DC$;CHR$(34);CHR$(38) K*2;"ft  "
2250 PRINT DC$;CHR$(41);CHR$(38) K;"ft  "
2260 PRINT DC$;CHR$(47);CHR$(38) K/2;"ft  "
2270 N=N+25
2280 FOR Z=0 TO 200:NEXT Z
2290 PRINT DC$;CHR$(53);CHR$(41)"                                           "
2300 FOR Z=0 TO 200:NEXT Z
2310 SP=SP+.1
2320 PRINT DC$;CHR$(53);CHR$(41);RV$;"Automatic Sequencing Has Been Initiated";XV$
2330 NEXT K
2340 FOR K=0 TO 500:NEXT K
2350 PRINT CLR$;CN$
2360 FOR K=0 TO 9:PRINT:NEXT K
2370 PRINT TAB(10) "You are now safely on the moon. All systems are operational"
2380 PRINT
2390 PRINT TAB(10) "and on standby status. Have a nice visit!"
2400 GOTO 1580
oon. All systems are operational"
2380 PRINT
2390 PRINT TAB(10) "and on standby status. Have a nice visit