lander.bas

来自「1984-1993模糊 C 源代码竞赛.zip 非常的好,不过这是DOS格式,」· BAS 代码 · 共 75 行

BAS
75
字号
10 REM Lunar Lander20 REM By Diomidis Spinellis25 REM Compiler version30 PRINT "You aboard the Lunar Lander about to leave the spacecraft."60 GOSUB 400070 GOSUB 100080 GOSUB 200090 GOSUB 3000100 LET H = H - V110 LET V = ((V + G) * 10 - U * 2) / 10120 LET F = F - U130 IF H > 0 THEN 80135 LET 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 LET V = 701020 LET F = 5001030 LET H = 10001040 LET 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!"3045 PRINT F3050 GOTO 30103060 RETURN3070 LET 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."5050 END

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?