![]() |
Forum Index : Microcontroller and PC projects : MicroMite - LUNAR LANDER MKII
Author | Message | ||||
Chris Roper Senior Member ![]() Joined: 19/05/2015 Location: South AfricaPosts: 280 |
I was reading some old issues of Kilobaud and came across this little program in the August 1978 Issue. Luna Lander used to be the game I used to test HP and other Programmable Calculators, longer ago than I care to remember, and thought it would be fun to add to the Micromite as a test of porting older programs to MMBasic. It could form the basis of a graphics game for those playing with Colour Displays but even if you don't want to convert it to graphics it is still a fun diversion with only console output. [code] PRINT TAB(8);"LUNAR LANDER MKII" PRINT TAB(8); "+++++++++++++++++" PRINT "WOULD YOU LIKE INSTRUCTIONS?" PRINT "1= YES 0=NO" INPUT A IF A = 0 GOTO Decent PRINT "YOU HAVE 120 LBS OF FUEL" PRINT "YOU ARE APPROACHING THE LUNAR" PRINT "SURFACE AT 50 FT/SEC, AND" PRINT "ARE CURRENTLY 500 FT FROM" PRINT "THE SURFACE, TO CANCEL" PRINT "GRAVITY BURN 5LB FUEL" Decent: PRINT "HAPPY LANDINGS!" LET F = 120 LET V = 50 LET D = 500 Guages: PRINT "FUEL"; F PRINT "SPEED"; V PRINT "DISTANCE"; D GetFuel: PRINT "ENTER YOUR BURN". INPUT B IF B > F GOTO GetFuel LET F = F-B LET C = B-5 LET D = D-V+C/2 LET V = V-C IF D > 0 GOTO Guages IF V < 5 GOTO Touchdown PRINT "****!!CRASH!!****" PRINT "YOU HIT THE MOON AT";V;"FT/SEC" GOTO Retry Touchdown: PRINT "WELL DONE — YOU LANDED OK" PRINT "LANDING SPEED";V;"FT/SEC" Retry: PRINT "DO YOU WANT ANOTHER TRY?" PRINT "1=YES, 0=NO" INPUT A IF A = 1 GOTO Decent END [/code] Cheers, Chris http://caroper.blogspot.com/ |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1593 |
Thank you! Very old memories ... ![]() I have already two versions for the Maximite. Maybe I'll convert your code in a more modern style? My first try: ![]() ![]() Michael causality ≠correlation ≠coincidence |
||||
Chris Roper Senior Member ![]() Joined: 19/05/2015 Location: South AfricaPosts: 280 |
Thanks, that is the only piece of code I haven't tested as I haven't landed it yet ![]() Yes it could do well with some more modern structure, but as a test it worked well. All I had to do was strip out the line numbers and add the labels. I could probably have even left the Line numbers too ![]() Cheers Chris http://caroper.blogspot.com/ |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1593 |
The "trick" is to do nothing till you're halfway down. (0,0,5,13,20,13,0,0,0,0,30,25) of course! ![]() causality ≠correlation ≠coincidence |
||||
Chris Roper Senior Member ![]() Joined: 19/05/2015 Location: South AfricaPosts: 280 |
I see you take a different approach, I was going for a gradual decent whereas you come in fast with a major burn at the last second. It was quite nerve wrecking doing it your way, I almost panicked as I typed in that last second burn ![]() Cheers Chris http://caroper.blogspot.com/ |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1593 |
![]() This is my conversion (works for Maximites too): ' Lunar Lander
' by Chris Roper@TBS 9/2015 Dim f,v,d ' fuel,speed,distance Dim a,b ' input vars Print Tab(8);"LUNAR LANDER MKII" Print Tab(8);"+++++++++++++++++" Print "WOULD YOU LIKE INSTRUCTIONS?" Input "1= YES 0=NO"; A If A Then show_instructions Do Print "HAPPY LANDINGS!" F = 120 V = 50 D = 500 Do Print "FUEL"; F Print "SPEED"; V Print "DISTANCE"; D Do Input "ENTER YOUR BURN"; B Loop While B > F F = F-B C = B-5 D = D-V+C/2 V = V-C Loop While D > 0 If V < 5 Then Print "WELL DONE YOU LANDED OK" Print "LANDING SPEED";V;"FT/SEC" Else Print "****!!CRASH!!****" Print "YOU HIT THE MOON AT";V;"FT/SEC" EndIf Print "DO YOU WANT ANOTHER TRY?" Input "1=YES, 0=NO"; A Loop While a End Sub show_instructions Print "YOU HAVE 120 LBS OF FUEL" Print "YOU ARE APPROACHING THE LUNAR" Print "SURFACE AT 50 FT/SEC, AND" Print "ARE CURRENTLY 500 FT FROM" Print "THE SURFACE, TO CANCEL" Print "GRAVITY BURN 5LB FUEL" End Sub causality ≠correlation ≠coincidence |
||||
vegipete![]() Guru ![]() Joined: 29/01/2013 Location: CanadaPosts: 1132 |
For some serious brown pants, try this sequence: (0,0,0,0,0,0,0,15,75) - check the number of zero burns, might be one more or less. Total fuel used: 90 lbs. ---------------- I might actually remember this game as a kid, from Creative Computing or some such. It is interesting to ponder this now and wonder why the computer wasn't used to solve the problem, instead of presenting it. Not that that has changed much over the years - only the graphics and sound have gotten better. I've got to dig out "Hunt the Wumpus"... Visit Vegipete's *Mite Library for cool programs. |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1593 |
90 lbs.? ![]() 86 lbs. should be enough! ![]() that's what I thought! causality ≠correlation ≠coincidence |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |