home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
MBUG
/
MBUG067.ARC
/
LANDER.BAS
< prev
next >
Wrap
BASIC Source File
|
1979-12-31
|
3KB
|
92 lines
1010 PRINT "DO YOU WANT INSTRUCTIONS ";
1020 INPUT A$
1030 IF A$="NO" THEN 1130
1040 PRINT "GROUND CONTROL CALLING LUNAR LANDER"
1050 PRINT "ON BOARD AND GROUND COMPUTERS KAPUT"
1060 PRINT "TAKE OVER"
1070 PRINT "CAPSULE WEIGHT 33000 LBS - AVAILABLE FUEL 16500 LBS"
1080 PRINT "ESTIMATED FREE FALL IMPACT TIME 120 SEC"
1090 PRINT
1100 PRINT "SET RETRO ROCKET BURN RATE TO ANY VALUE FROM 0 LBS/SEC"
1110 PRINT "(FREE FALL) TO 300 LBS/SEC, TYPE A COMMA AND THEN"
1120 PRINT " GIVE BURN TIME IN SEC."
1130 PRINT
1140 PRINT "GOOD LUCK"
1150 PRINT
1160 PRINT "SEC";TAB(12);"MI + FT";TAB(26);"MPH";TAB(37);"LB FUEL";
1170 PRINT TAB(50);"BURN RATE,TIME"
1180 PRINT
1190 A=120
1200 V=1
1210 M=33000.
1220 N=16500
1230 G=.001
1240 Z=1.8
1250 L=0
1260 PRINT L;TAB(10);INT(A);INT(5280*(A-INT(A)));TAB(25);3600*V;
1270 PRINT TAB(37);M-N;TAB(50);
1280 INPUT K,T
1290 IF M-N<.001 THEN 1400
1300 IF T<.001 THEN 1260
1310 S=T
1320 IF M >= N+S*K THEN 1340
1330 S=(M-N)/K
1340 GOSUB 1790
1350 IF I <= 0 THEN 1650
1360 IF V <= 0 THEN 1380
1370 IF J<0 THEN 1710
1380 GOSUB 1590
1390 GOTO 1290
1400 PRINT "OUT OF FUEL AT";L;"SEC"
1410 S=(-V+SQR(V*V+2*A*G))/G
1420 V=V+G*S
1430 L=L+S
1440 W=3600*V
1450 PRINT "ON THE MOON AT";L;"SEC - IMPACT VELOCITY";W;"MPH"
1460 IF W>1.2 THEN 1490
1470 PRINT "GREAT LANDING !!! (LUCKY)"
1480 GOTO 1830
1490 IF W>10 THEN 1520
1500 PRINT "GOOD LANDING"
1510 GOTO 1830
1520 IF W>60 THEN 1560
1530 PRINT "CRAFT DAMAGE. YOU ARE STRANDED UNTIL RESCUE MISSION"
1540 PRINT "ARRIVES. HOPE YOUR OXYGEN HOLD OUT."
1550 GOTO 1830
1560 PRINT "YOU CRASHED - NO SURVIVORS."
1570 PRINT "YOU BLASTED A NEW LUNAR CRATER";W*.2777;"FT DEEP"
1580 GOTO 1830
1590 L=L+S
1600 T=T-S
1610 M=M-S*K
1620 A=I
1630 V=J
1640 RETURN
1650 IF S<.005 THEN 1440
1660 D=V+SQR(V*V+2*A*(G-Z*K/M))
1670 S=2*A/D
1680 GOSUB 1790
1690 GOSUB 1590
1700 GOTO 1650
1710 W=(1-M*G/(Z*K))/2
1720 S=M*V/(Z*K*(W+SQR(W*W+V/Z)))+.05
1730 GOSUB 1590
1740 IF I <= 0 THEN 1650
1750 GOSUB 1590
1760 IF J>0 THEN 1290
1770 IF V>0 THEN 1710
1780 GOTO 1290
1790 Q=S*K/M
1792 REM PATCH TO PREVENT UNDERFLOW
1794 IF Q>.000001 THEN 1800
1796 Q=0
1800 J=V+G*S-Z*Q*(1+Q*(.5+Q*(1/3+Q*(.25+Q/5))))
1810 I=A-G*S*S/2-V*S+Z*S*Q*(.5+Q*(1/6+Q*(1/12+Q/20)))
1820 RETURN
1830 INPUT "WANT TO TRY AGAIN ";D$
1840 IF LEFT$(D$,2)="YE" THEN 1140
1850 PRINT"CHICKEN":STOP
9999 END