?? lander.bas
字號:
10 REM Lunar Lander20 REM By Diomidis Spinellis30 PRINT "You aboard the Lunar Lander about to leave the spacecraft."60 GOSUB 400070 GOSUB 100080 GOSUB 200090 GOSUB 3000100 H = H - V110 V = ((V + G) * 10 - U * 2) / 10120 F = F - U130 IF H > 0 THEN 80135 H = 0140 GOSUB 2000150 IF V > 5 THEN 200160 PRINT "Congratulations! This was a very good landing."170 GOSUB 5000180 GOTO 10200 PRINT "You have crashed."210 GOTO 1701000 REM Initialise1010 V = 701020 F = 5001030 H = 10001040 G = 21050 RETURN2000 REM Print values2010 PRINT " Meter readings"2015 PRINT " --------------"2020 PRINT "Fuel (gal):"2030 PRINT F2040 GOSUB 2100 + 100 * (H <> 0)2050 PRINT V2060 PRINT "Height (m):"2070 PRINT H2080 RETURN2100 PRINT "Landing velocity (m/sec):"2110 RETURN2200 PRINT "Velocity (m/sec):"2210 RETURN3000 REM User input3005 IF F = 0 THEN 30703010 PRINT "How much fuel will you use?"3020 INPUT U3025 IF U < 0 THEN 30903030 IF U <= F THEN 30603040 PRINT "Sorry, you have not got that much fuel!"3050 GOTO 30103060 RETURN3070 U = 03080 RETURN3090 PRINT "No cheating please! Fuel must be >= 0."3100 GOTO 30104000 REM Detachment4005 PRINT "Ready for detachment"4007 PRINT "-- COUNTDOWN --"4010 FOR I = 1 TO 114020 PRINT 11 - I4025 GOSUB 45004030 NEXT I4035 PRINT "You have left the spacecraft."4037 PRINT "Try to land with velocity less than 5 m/sec."4040 RETURN4500 REM Delay4510 FOR J = 1 TO 5004520 NEXT J4530 RETURN5000 PRINT "Do you want to play again? (0 = no, 1 = yes)"5010 INPUT Y5020 IF Y = 0 THEN 50405030 RETURN5040 PRINT "Have a nice day."
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -