HP Forums
Lunar Lander - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: Lunar Lander (/thread-17785.html)



Lunar Lander - Mike T. - 12-04-2021 12:29 AM

I first encountered the Lunar lander game on a flight back to England way back in 1976 when my father introduced me to his brand new HP97 as a way to keep me occupied. By the time the battery went flat I'd managed to land successfully, had written a couple of programs of my own, and I knew I wasn't going to grow up to be a Marine Biologist!

I recently gave the HP33C version a go (from the HP33E Applications Book - Page 23) and after a few attempts managed to successfully land using 15 burns with no remaining fuel left.

Code:

Vel.Alt     Burn    Fuel

-50.0500    0        120
-55.0448    0        120
-60.0390    0        120
-65.0328    0        120
-70.0260    0        120
-75.0188    0        120
-80.0110    45       75
-40.0050    25       50
-20.0020    20       30
 -5.0008    8        22
 -2.0004    6        16
 -1.0003    5        11
 -1.0002    5        6
 -1.0001    6        0
  0.0000    0        0     (15 burns)
  0.

I'm sure I wasn't the only person whose imagination was captivated by this simple game - but the question is what is/was your best solution?

After a couple more goes I managed to improve on the solution above and land using just 13 burns with 10 units of fuel remaining, can you do better...


RE: Lunar Lander - Paul Dale - 12-04-2021 07:50 AM

I believe that the best solution is a single final burn.


RE: Lunar Lander - Thomas Okken - 12-04-2021 07:59 AM

Free-fall until you're falling with a speed of 80 at an altitude of 110, then burn 15 units so you're falling at a speed of 70 at an altitude of 35; then burn 75 units, killing your speed at altitude 0.

I believe that's the optimum solution, at least as I recall, playing this game on the HP-25...


RE: Lunar Lander - toml_12953 - 12-04-2021 08:29 AM

I was never able to land safely in any of the incarnations of LL I tried. I died in Assembler, BASIC, Fortran, COBOL, C, Pascal, JavaScript and Python. I died on everything from a building-sized mainframe to a desktop computer to a computer I could carry in my pocket. In fact, if you look at the moon carefully, you can see a crater named for me in the Mare Crisium (Sea of Crises).


RE: Lunar Lander - Andres - 12-04-2021 02:37 PM

I had an HP-25 and played a lot with the lunar landing simulator. The -25 version didn't adjust for vehicle mass reduction as fuel was consumed. I had little contact with the HP-67, but I recall its version did use the "interactive pause" feature: if you don't enter a burn command, the pause times out and the simulation goes on, assuming a burn of 0. Possibly the -67 version adjusted for mass reduction due to fuel useage, I'm not really sure about this aspect.

The HP-25 lunar langer simulator sparked my interest on flight simulators. I wrote a very crude glider landing simulator for the HP-25 (code is lost), and a passable space shuttle landing simulator for the HP-41C, later improved with synthetic symbols on the display.


RE: Lunar Lander - Dave Shaffer - 12-05-2021 12:23 AM

(12-04-2021 08:29 AM)toml_12953 Wrote:  I was never able to land safely in any of the incarnations of LL I tried. I died in Assembler, BASIC, Fortran, COBOL, C, Pascal, JavaScript and Python. I died on everything from a building-sized mainframe to a desktop computer to a computer I could carry in my pocket.

I'm guessing many (some?) here played this on a PDP8 (back in the early 70s - showing my age!). I managed to land several times. IIRC, If you hit the sweet spot, the pilot got out of the ship, wandered over to the nearby McDonalds (!) and ordered a burger to go, got back in the ship, and you could take off.

If you landed in the wrong spot, you got the admonition "You clod, you've destroyed the only McDonald's on the moon!"


RE: Lunar Lander - Danito-Danone - 12-05-2021 01:27 AM

Hi, Another way is:
Display | Burn | Fuel
....................| 120
-80.0110 | 40 | 80
-45.0048 | 30 | 50
-20.0015 | 20 | 30
- 5.0003 | 10 | 20
0.0000
D-D


RE: Lunar Lander - Mike T. - 12-05-2021 11:19 PM

(12-05-2021 01:27 AM)Danito-Danone Wrote:  Hi, Another way is:
Display | Burn | Fuel
....................| 120
-80.0110 | 40 | 80
-45.0048 | 30 | 50
-20.0015 | 20 | 30
- 5.0003 | 10 | 20
0.0000
D-D

I might even be able to remember that solution!! (not the 'best' but it has a certain elegance)

Mike T.