mirror of
https://github.com/rfivet/BCG101.git
synced 2024-12-21 01:26:24 -05:00
36 lines
1.8 KiB
QBasic
36 lines
1.8 KiB
QBasic
2 PRINT "THIS IS A COMPUTER SIMULATION OF AN APOLLO LUNAR"
|
|
3 PRINT "LANDING CAPSULE."\PRINT\PRINT
|
|
4 PRINT "THE ON-BOARD COMPUTER HAS FAILED (IT WASN'T MADE BY"
|
|
5 PRINT "DIGITAL) SO YOU HAVE TO LAND THE CAPSULE MANUALLY"
|
|
6 PRINT\PRINT "SET BURN RATE OF RETRO ROCKETS TO ANY VALUE BETWEEN"
|
|
7 PRINT "0 (FREE FALL) AND 200 (MAXIMUM BURN) POUNDS PER SECOND"
|
|
8 PRINT "SET NEW BURN RATE EVERY 10 SECONDS."\PRINT
|
|
9 PRINT "CAPSULE WEIGHT 32,500 LBS; FUEL WEIGHT 16,500 LBS"
|
|
10 PRINT\PRINT\PRINT "GOOD LUCK!!!"
|
|
11 L=0
|
|
13 PRINT\PRINT "SEC","MI + FT","MPH","LB FUEL","BURN RATE"\PRINT
|
|
15 A=120\V=1\M=33000\N=16500\G=1E-03\Z=1.8
|
|
21 PRINT L,INT(A);INT(5280*(A-INT(A))),3600*V,M-N,\INPUT K\T=10
|
|
31 IF M-N<.001 THEN 41\IF T<.001 THEN 21\S=T\IF M>=N+S*K THEN 35
|
|
32 S=(M-N)/K
|
|
35 GOSUB 91\IF I<=0 THEN 71\IF V<=0 THEN 38\IF J<0 THEN 81
|
|
38 GOSUB 61\GOTO 31
|
|
41 PRINT "FUEL OUT AT"L"SEC"\S=(-V+SQR(V*V+2*A*G))/G\V=V+G*S\L=L+S
|
|
51 W=3600*V\PRINT "ON MOON AT"L"SEC - IMPACT VELOCITY" W "MPH"
|
|
52 IF W>1.2 THEN 53\PRINT "PERFECT LANDING! (LUCKY)"\GOTO 95
|
|
53 IF W>10 THEN 56\PRINT "GOOD LANDING (COULD BE BETTER)"\GOTO 95
|
|
56 IF W>60 THEN 58 \PRINT "CRAFT DAMAGE.....YOU'RE STRANDED HERE UNTIL"
|
|
57 PRINT "A RESCUE PARTY ARRIVES. HOPE YOU HAVE ENOUGH OXYGEN!"\GOTO 95
|
|
58 PRINT "SORRY, BUT THERE WERE NO SURVIVORS...YOU BLEW IT!"
|
|
59 PRINT "IN FACT, YOU BLASTED A NEW LUNAR CRATER"W*.227"FT DEEP"
|
|
60 GOTO 95
|
|
61 L=L+S\T=T-S\M=M-S*K\A=I\V=J\RETURN
|
|
71 IF S<5E-03 THEN 51\D=V+SQR(V*V+2*A*(G-Z*K/M))\S=2*A/D
|
|
73 GOSUB 91\GOSUB 61\GOTO 71
|
|
81 W=(1-M*G/(Z*K))/2\S=M*V/(Z*K*(W+SQR(W*W+V/Z)))+.05\GOSUB 91
|
|
83 IF I<=0 THEN 71\GOSUB 61\IF J>0 THEN 31\IF V>0 THEN 81\GOTO 31
|
|
91 Q=S*K/M\J=V+G*S+Z*(-Q-Q*Q/2-Q^3/3-Q^4/4-Q^5/5)
|
|
94 I=A-G*S*S/2-V*S+Z*S*(Q/2+Q^2/6+Q^3/12+Q^4/20+Q^5/30)\RETURN
|
|
95 PRINT\PRINT\PRINT\PRINT "TRY AGAIN??"\GOTO 6
|
|
99 END
|