100 DIM A$[1]
200 PRINT "DO YOU NEED INSTRUCTIONS ";
230 INPUT A$
240 IF A$="Y" THEN RUN "LANINS"
250 PRINT "GOOD LUCK AND HAPPY LANDINGS"
260 LET X0=0
270 LET V0=0
1007 REM
1030 PRINT "LOCATION: MOON, EARTH, OR PERSEPHONE";
1040 INPUT A$
1043 LET K=0
1045 IF A$="M" THEN 1060
1047 LET K=1
1048 IF A$="E" THEN 1060
1049 IF A$="P" THEN 4000
1050 PRINT "LOCATION NOT RECOGNIZED"
1055 GOTO 1030
1060 LET G=5+27*K
1070 LET M=30+60*K
1075 IF X0>0 THEN 1100
1080 LET X=X0+500+1500*K
1090 LET V=V0-50-100*K
1100 PRINT "INITIAL CONDITIONS : STANDARD OR RANDOM";
1110 INPUT A$
1115 RANDOMIZE
1120 IF A$<>"S" THEN 1170
1130 LET X=500+1500*K
1140 LET V=-50-100*K
1145 GOTO 1200
1170 LET X=INT(RND(0)*(100+K*100))*10+100
1180 LET V=-INT(RND(0)+(10+K*10))*5
1190 IF V+V>2*(M-G)*X THEN 1180
1200 LET X0=X
1210 LET V0=V
1290 LET F=INT(SQR(M*(V*V+2*G*X)/(M-G))*.13+.5)*10
1300 PRINT
1302 PRINT "INITIAL HEIGHT:    ";X;" FEET"
1303 PRINT "INITIAL VELOCITY:  ";V;" F/SEC"
1305 PRINT "TOTAL FUEL SUPPLY: ";F;" UNITS"
1307 PRINT "MAXIMUM BURN:      ";M;" U/SEC"
1308 PRINT "BURN TO CANCEL G:  ";G;" U/SEC"
1320 PRINT
1340 PRINT "TIME","HEIGHT","VELOC.","FUEL","BURN"
1350 PRINT
2000 LET T=-1
2010 LET T=T+1
2020 PRINT T,X,V,F," ";
2030 INPUT B
2040 LET B1=ABS(B)
2050 IF B1>M THEN 2060
2055 IF B1>F THEN 2075
2056 GOTO 2080
2060 PRINT " ","MAX BURN IS ";M;"BURN";
2070 GOTO 2030
2075 PRINT " ","MAX BURN IS ";F;"BURN";
2076 GOTO 2030
2080 LET T8=2
2081 LET T9=2
2090 IF B1=0 THEN 2110
2100 LET T9=F/B1
2110 LET A=B-G
2120 LET R=V*V-2*A*X
2140 IF R<0 THEN 2200
2150 IF A=0 THEN 2180
2160 LET T8=-(V+SQR(R))/A
2170 GOTO 2200
2180 IF V>=0 THEN 2200
2190 LET T8=-X/V
2200 IF T8<=0 THEN 2210
2201 IF T8>1 THEN 2210
2202 IF T9>1 THEN 2210
2203 GOTO 2300
2210 LET X=X+V+A/2
2220 LET V=V+A
2230 LET F=F-B1
2235 IF X>.0001 THEN 2010
2240 LET T=T+1
2245 GOTO 2630
2300 IF T8<=0 THEN 2310
2301 IF T8>T9 THEN 2310
2302 GOTO 2600
2310 PRINT T+T9,"OUT OF FUEL"
2320 LET F=0
2321 LET B1=0
2330 LET X=X+V*T9+A*T9*T9/2
2340 LET V=V+A*T9
2350 LET A=-G
2360 LET T8=(V+SQR(V*V-2*A*X))/G
2370 IF T8<1-T9 THEN 2500
2380 LET X=X+V*(1-T9)+A*(1-T9)^2/2
2390 LET V=V+A*(1-T9)
2400 LET T=T+1
2410 PRINT T,X,V
2420 LET T8=(V+SQR(V*V-2*A*X))/G
2430 IF T8<=1 THEN 2600
2440 LET X=X+V+A/2
2450 LET V=V+A
2460 GOTO 2400
2500 LET T=T+T9
2600 LET F=F-B1+T8
2610 LET T=T+T8
2620 LET V=V+A*T8
2630 PRINT T,0,V,F
2690 PRINT "VELOCITY AT TOUCHDOWN = ";-V;" FEET PER SECOND"
2701 LET R5=INT(RND(0)*5+1)
2710 IF V<-1 THEN 2800
2720 IF R5=1 THEN PRINT "QUALIFIED ASTRONAUT !!"
2730 IF R5=2 THEN PRINT "FLOAT LIKE A BUTTERFLY !!"
2740 IF R5=3 THEN PRINT "LIKE A SNOWFLAKE !!"
2750 IF R5=4 THEN PRINT "QUIET AS A KITTEN'S PURR !!"
2760 IF R5=5 THEN PRINT "ANOTHER MR. SPOCK !!"
2761 GOTO 1007
2800 IF V<-10 THEN 2900
2810 IF R5=1 THEN PRINT "A BIT ROUGH, BUT STILL ONE PIECE !"
2820 IF R5=2 THEN PRINT "IF THIS WAS AN LTD, IT WOULD COST YOU $1K !"
2830 IF R5=3 THEN PRINT "MADE IT ON THE SECOND BOUNCE !"
2840 IF R5=4 THEN PRINT "BETTER CHECK LANDING GEAR BUDDY !"
2850 IF R5=5 THEN PRINT "PASS ME THE AIR-SICK PILLS !"
2851 GOTO 1007
2900 IF V<-20 THEN 3000
2910 IF R5=1 THEN PRINT "IS YOUR MEDICAL INSURANCE PAID UP ??"
2920 IF R5=2 THEN PRINT "DO YOUR REALLY WANT TO BE AN ASTRONAUT ??"
2930 IF R5=3 THEN PRINT "YA THINK ARMSTRONG MADE IT THE FIRST TIME ??"
2941 IF R5=4 THEN PRINT " EVER CONSIDERED A DIFFERENT CAREER ??"
2950 IF R5=5 THEN PRINT "DID YOU PACK FOR A LONG TRIP ??"
2951 GOTO 1007
3000 IF R5=1 THEN PRINT "NEXT OF KIN WILL BE NOTIFIED !"
3020 IF R5=2 THEN PRINT "YOU CREAMED A 29-MEGABUCK LANDER !!!"
3030 IF R5=3 THEN PRINT "LUCKY THIS IS ONLY A SIMULATION !!"
3040 IF R5=4 THEN PRINT "THEY'LL NAME THE NEW CRATER AFTER YOU!!"
3042 IF R5=5 THEN PRINT "SO MUCH FOR MANUAL CONTROL"
3043 GOTO 1007
4000 PRINT
4020 PRINT "INITIAL HEIGHT (FEET) ";
4030 INPUT X
4040 PRINT "INITIAL VELOCITY (F/SEC) USUALLY NEGATIVE ";
4050 INPUT V
4060 PRINT "TOTAL FUEL SUPPLY (UNITS) ";
4070 INPUT F
4080 PRINT "MAX FUEL BURN RATE (UNITS/SEC) ";
4090 INPUT M
4100 PRINT "FUEL BURN RATE REQUIRED TO CANCLE GRAVITY (UNITS/SEC) ";
4105 INPUT G
4120 GOTO 1320
5000 END
