Live data from Hacker News

I found a 55 year old bug in the first Lunar Lander game

martincmartin.com

41–50 of 124 posts

Re: I found a 55 year old bug in the first Lunar Lander game

#41

Pretty cool, the offending line seems to be 08.10 [1]. I thought it was a little odd that he mentioned "impressive for a high school senior in 1969" multiple times throughout -- honestly I would imagine that growing up in the Space Age would have had a massive influence on technically minded folks, reminds me of that movie from a while back called October Sky. In the interview in TFA with the game's author he mention…

There were on the order of hundreds of high school students with computer access in the US in 1969, and even fewer with computer literacy. Growing up in the Space Age probably was inspirational, but that doesn't change the fact that computers basically didn't exist to the general public at that time. Unlike now, software development wasn't a widely known career. There wasn't a CS major in the US until 1962. I think t…

EDIT Personally, for clarification, I do think the code is impressive, but the above back-and-forth doesn't really explain why.

---

That explanation still wouldn't mean support the assertion that writing the lander game is the part that's "impressive for a high school senior in 1967."

If anything, all this explanation would show is that their having access to a computer is the "impressive" part.

Re: I found a 55 year old bug in the first Lunar Lander game

#42
post #4
post #2

It's interesting. The naive way to write this would be not use any special formulas, and just recalculate mass and acceleration each frame (based on the new mass). And to calculate intersection with the ground at each frame boundary. I guess the idea is that the lower your frame-rate, the less accurate this approach is, or maybe the idea is it's fun to use the actual equations. I'm curious how perceptible the differe…

There wasn't any graphical output or any frame rate to speak of in the sense you are thinking. The output would appear printed, like this: https://www.cs.brandeis.edu/~storer/LunarLander/LunarLander/... Only updating the mass/acceleration at ten-second intervals would be wildly incorrect!

Just because your displaying results in 10s increments doesn’t mean anything about the simulation frame rate. You could still simulation 10k frames at 1ms granularity between the results printed each ms. The challenge is computational for a 1960s machine and a closed form solution is sensible here for that reason.

Re: I found a 55 year old bug in the first Lunar Lander game

#43

  >It’s also possible to land gently, you just need to end your 14th turn with a low altitude and velocity, and then use low thrust in your 15th turn, landing somewhere after 150 seconds. It’s just the theoretical full-thrust-on-landing suicide burn, that takes around 148 seconds, that eludes us.
I expect the fuel-optimal soft landing strategy (ignored because it doesn't fit the exact form of a "suicide burn") would be to play 164.31426784 lbs/second at t=70 seconds, and then replace one of the subsequent 200 lbs/second inputs with 199.99999999 lbs/second.

The earlier you "play" 199.99999999 the better, so just use exhaustive search and select the earliest play that still achieve a soft landing.

Re: I found a 55 year old bug in the first Lunar Lander game

#44

Earlier quoted context omitted.

There were on the order of hundreds of high school students with computer access in the US in 1969, and even fewer with computer literacy. Growing up in the Space Age probably was inspirational, but that doesn't change the fact that computers basically didn't exist to the general public at that time. Unlike now, software development wasn't a widely known career. There wasn't a CS major in the US until 1962. I think t…

EDIT Personally, for clarification, I do think the code is impressive , but the above back-and-forth doesn't really explain why. --- That explanation still wouldn't mean support the assertion that writing the lander game is the part that's "impressive for a high school senior in 1967." If anything, all this explanation would show is that their having access to a computer is the "impressive" part.

It needs access to a computer, creativity, and an impressive amount of capability for a high school senior.

This is 5 years before pong - you are inventing game concepts from scratch rather than standing on the shoulders of giants.

Re: I found a 55 year old bug in the first Lunar Lander game

#45

>It’s also possible to land gently, you just need to end your 14th turn with a low altitude and velocity, and then use low thrust in your 15th turn, landing somewhere after 150 seconds. It’s just the theoretical full-thrust-on-landing suicide burn, that takes around 148 seconds, that eludes us. I expect the fuel-optimal soft landing strategy (ignored because it doesn't fit the exact form of a "suicide burn") would be…

The nature of the bug is that it has trouble finding when the lander has touched the surface. You need to have an altitude of less than zero for around 0.05 seconds for the game to notice that you've landed. If your thrust during that time is 200 or 199, to have an altitude Even when the bug is fixed, the code is still only approximating the lowest point. Also, even when it detects that you've landed, now it needs to compute the time when you land, i.e. when the altitude is zero, not velocity. It also uses an approximation for that.

So the times will be a little off. If you're burning 200 or 199 during that last time step, you have a high acceleration so even a small amount of time turns into a large amount of velocity. Instead, if you're burning say 10 lbs/sec, then being off by say 0.08 sec won't change your velocity much.

Re: I found a 55 year old bug in the first Lunar Lander game

#46
post #44

Earlier quoted context omitted.

EDIT Personally, for clarification, I do think the code is impressive , but the above back-and-forth doesn't really explain why. --- That explanation still wouldn't mean support the assertion that writing the lander game is the part that's "impressive for a high school senior in 1967." If anything, all this explanation would show is that their having access to a computer is the "impressive" part.

It needs access to a computer, creativity, and an impressive amount of capability for a high school senior. This is 5 years before pong - you are inventing game concepts from scratch rather than standing on the shoulders of giants.

[deleted]

Re: I found a 55 year old bug in the first Lunar Lander game

#47

Earlier quoted context omitted.

There were on the order of hundreds of high school students with computer access in the US in 1969, and even fewer with computer literacy. Growing up in the Space Age probably was inspirational, but that doesn't change the fact that computers basically didn't exist to the general public at that time. Unlike now, software development wasn't a widely known career. There wasn't a CS major in the US until 1962. I think t…

EDIT Personally, for clarification, I do think the code is impressive , but the above back-and-forth doesn't really explain why. --- That explanation still wouldn't mean support the assertion that writing the lander game is the part that's "impressive for a high school senior in 1967." If anything, all this explanation would show is that their having access to a computer is the "impressive" part.

I think both. It's likely only very impressive high school students got that much access to a computer in 1967.

It reminds me of an article I read about Jai alai years ago: the sport is long, long past its peak, and one of the people interviewed said the players nowadays are some of the best ever, because only people who are really, really good and really, really love the game still try to play professionally.

Re: I found a 55 year old bug in the first Lunar Lander game

#49

Pretty cool, the offending line seems to be 08.10 [1]. I thought it was a little odd that he mentioned "impressive for a high school senior in 1969" multiple times throughout -- honestly I would imagine that growing up in the Space Age would have had a massive influence on technically minded folks, reminds me of that movie from a while back called October Sky. In the interview in TFA with the game's author he mention…

Though famous as the first lunar lander game, the impressive part was the specific numerical techniques used.

Re: I found a 55 year old bug in the first Lunar Lander game

#50

>It’s also possible to land gently, you just need to end your 14th turn with a low altitude and velocity, and then use low thrust in your 15th turn, landing somewhere after 150 seconds. It’s just the theoretical full-thrust-on-landing suicide burn, that takes around 148 seconds, that eludes us. I expect the fuel-optimal soft landing strategy (ignored because it doesn't fit the exact form of a "suicide burn") would be…

The nature of the bug is that it has trouble finding when the lander has touched the surface. You need to have an altitude of less than zero for around 0.05 seconds for the game to notice that you've landed. If your thrust during that time is 200 or 199, to have an altitude Even when the bug is fixed, the code is still only approximating the lowest point. Also, even when it detects that you've landed, now it needs to…

I get what you're saying, but I don't think that contradicts the optimal strategy I outlined?

Rather than a large deviation from a suicide burn at the end of the burn, a small deviation at the beginning of the burn should be a cheaper way (w/r/t fuel burn) to "search" the buggy code for a possible soft landing solution.

Anyway, what a fun write-up! Thanks for posting it.

Post reply on HN