1 REM *** WRITTEN BY JIM STORER, LEXINGTON HS
2 REM *** CONVERTED FROM FOCAL TO BASIC BY  DAVID AHL, DIGITAL
3 REM *** PORTED TO OS/8 BASIC BY BILL CATTEY USING SALVAGED BITS.
4 REM     COLON BECOMES BACKSLASH FOR MULITI COMMAND LINES.
5 REM     LEFT(R$,1)  BECOMES SEG$(R$,1,1) IN LINE 592
6 REM     NO "ELSE" SO LINE 593 BECOMES 3 IF STATEMENTS
10REM LUNAR MODULE PROGRAM "ROCKET"
20 PRINT\PRINT\PRINT "CONTROL CALLING LUNAR MODULE.."\PRINT
35PRINT"YOU MAY SET THE FUEL RATE (K) TO ZERO OR ANY VALUE"
40PRINT"BETWEEN 8 AND 200 LBS PER SECOND.  A NEGATIVE FUEL"
50 PRINT "RATE WILL ABORT THE LANDING, UNLESS THE RATE"
55 PRINT "IS -2, IN WHICH CASE THE CURRENT POSITION IS "
57 PRINT "SAVED FOR LATER RECALL UPON RESTART." \ PRINT
60PRINT"YOU HAVE 16000 LBS OF FUEL."
70PRINT"ESTIMATED FREE FALL IMPACT TIME IS 120 SECONDS."
80PRINT"CAPSULE WEIGHT IS 32,500 LBS."
90 PRINT\PRINT "FIRST RADAR CHECK COMING UP..."
100 PRINT "BEGIN LANDING PROCEDURE"\PRINT\PRINT
110PRINT"TIME(SECS)","HEIGHT(MI)","VELOCITY(MPH)","FUEL(LBS)","FUEL RATE"
120 LET L=0\LET A=120\LET V=1\LET M=32500\LET N=16500
170 LET G=.001\LET Z=1.8
210 PRINT INT(L+.5),A,V*3600,M-N,"K";
220 INPUT K
225 LET T=10
227 IF K <> -2 THEN 230
228 M1=M \ L1=L \ V1=V \ A1=A \ PRINT "SAVED YOUR POSITION" \ GOTO 220
230 IF K<0 GO TO 590
235 IF K=0 GOTO 310
240 IF K<8 THEN 260
250 IF K<=200 GO TO 310
260 PRINT "NOT POSSIBLE",,,,"K";
270 INPUT K \ GOTO 230
310 IF M-N-.001 <=0 GOTO410
320 IF T<.001 GOTO 210
330 LET S=T\IF N+S*K<=M GO TO 350
340 LET S=(M-N)/K
350 LET I0=1 \ GOTO 900
360 IF I <= 0 GOT O 710
370 IF V<=0 GO TO 380
375 IF J<0 GOTO 810
380 LET I0=1\GOTO600
410 PRINT"FUEL OUT AT ";L;"SECS."
420 LET S=(-V+SQR(V*V+2*A*G))/G
430 LET V = V+G*S
440 LET L=L+S
510 PRINT"ON THE MOON AT ";L;"SECS."
511 LET W = 3600*V
514 PRINT "IMPACT VELOCITY OF ";W;"M.P.H."
520 PRINT "FUEL LEFT ";M-N;"LBS."
530 IF W>=1 GOTO 550
540 PRINT "PERFECT LANDING!  CONGRATULATIONS!!"\ GOTO 590
550 IF W >=10 THEN 560
552 PRINT "VERY GOOD LANDING, NOT PERFECT YET."\GOTO590
560 IF W >= 25 THEN 570
562 PRINT "A FAIR LANDING, NO CRAFT DAMAGE."\GOTO590
570 IF W >= 60 THEN580
572 PRINT "CRAFT DAMAGE -- BETTER LUCK NEXT TIME."\GOTO 590
580 PRINT "SORRY, BUT THERE WERE NO SURVIVORS."
585 PRINT "IN FACT YOU BLASTED A NEW LUNAR CRATER ";W*.277777;" FEET DEEP."
590 PRINT\PRINT\PRINT "TRY AGAIN? (Y,N,RESTART, OR LOW WINDOW)";
592 INPUT R$\ R$=SEG$(R$,1,1)
593 IF R$="Y" THEN 90 \ IF R$="R" THEN 1200 \ IF R$="L" THEN 1100
595 PRINT\ PRINT "CONTROL OUT" \ GOTO 1800
600 LET L=L+S
610 LET T = T-S
620 LET M=M-S*K
630 LET A=I
640 LET V=J
650 IF I0=1 GO TO 310
660 IF I0=3 GO TO 850
710 IF S< .005 GO TO 510
720 LET S= 2*A/(V+SQR(V*V+2*A*(G-Z*K/M)))
730 LET I0=2 \GOTO 900
810 LET W=(1-M*G/(Z*K))/2
820 LET S=M*V/(Z*K*(W+SQR(W*W+V/Z)))+.05
825 LET I0=3 \GOTO 900
830 IF I<=0 THEN 710
840 GOTO 600
850 IF J>=0 THEN 310
860 IF V<=0 GO TO 310
870 GOTO 810
900 LET Q=S*K/M
905 IF Q<=0 THEN 1000
910 LET J=V+G*S+Z*(-Q-(Q^2)/2-(Q^3)/3-(Q^4)/4-(Q^5)/5)
920 LET I=A-G*S*S/2-V*S+Z*S*(Q/2+Q^2/6+Q^3/12+Q^4/20+Q^5/30)
930 IF I0=1 GOTO 360
940 IF I0=2 GOTO 600
950 IF I0=3 GOTO 830
1000 LET J=V+G*S
1010 LET I=A-G*S*S/2-V*S
1020 GOTO930
1100 LET L=140
1110 LET A=2.382342
1120 LET V=.1257558
1130 LET M=18500
1140 LET N=16500
1150 GOTO 170
1200 M=M1 \ L=L1 \ V=V1 \ A=A1 \ GOTO 210
1800 END 
