Live data from Hacker News

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

martincmartin.com

1–10 of 124 posts

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

#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 difference is between the two at the original framerate.

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

#3
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 mentions being skilled at calculus--seems to me that if you were interested in space/rocketry/etc. and had the aptitude it makes sense that you'd try your hand at programming a lunar landing game.

[1]: https://www.cs.brandeis.edu/~storer/LunarLander/LunarLander/...

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

#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!

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

#5
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…

OP here (of this blog post, not the original game). The naive way is what I expected too, and described as the Euler method in the post.

In terms of physical accuracy, especially when you get near the surface, the mass does change significantly if you have a high rate of fuel burn. But in terms of how challenging/fun it would be, and what strategies you use as a player, I doubt it would make much difference. In fact, there are other lunar lander simulations in the BASIC computer games book, I think one of them does use the naive approach.

If 10 seconds is too long, you could still leave that as the turn in the UI, but internally break each turn into a bunch of smaller time steps, e.g. 10 time steps of 1 second each. Actually, the existing game does that in certain places, which is why his physics simulation takes in an arbitrary time S rather than always the full 10 seconds.

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

#6

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 that makes it pretty notable he was a high school senior in 1969.

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

#7

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…

I needed to know what language that is written in. Turns out it's something called FOCAL, as mentioned in this article about the game:

https://retro365.blog/2021/12/02/bits-from-my-personal-colle...

Wikipedia on FOCAL:

https://en.wikipedia.org/wiki/FOCAL_(programming_language)

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

#9
post #7

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…

I needed to know what language that is written in. Turns out it's something called FOCAL, as mentioned in this article about the game: https://retro365.blog/2021/12/02/bits-from-my-personal-colle... Wikipedia on FOCAL: https://en.wikipedia.org/wiki/FOCAL_(programming_language)

OP here. One interesting thing about FOCAL is that * has higher precedence than /. So in Lunar Lander, M*G/Z*K is what mathematicians and other languages would write M*G/(Z*K). I did a double take when I first saw that. :) As the Wikipedia article says, "This can cause subtle errors when converting FOCAL source code to other systems."

Also, the IF syntax is a little limiting and hard to read, although I suppose programmers would get used to it.

Post reply on HN