Live data from Hacker News

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

martincmartin.com

61–70 of 124 posts

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

#61
post #58

Earlier quoted context omitted.

> and an impressive amount of capability for a high school senior It's only impressive because very few (none?) high schools teach calculus at the level required for his implementation. High schoolers are quite capable of handling that kind of calculus, it's just that the high schools don't teach it.

It's not about the level of calculus knowledge for me - it's about building this from scratch with 1960's technology in 50 lines of basic and very little prior art. It's easier to be the second person to do something.

I agree with that.

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

#62

Earlier quoted context omitted.

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.

Yeah, I think we're agreeing. :)

So it turns out, before discovering the bug, I actually wrote code to find the optimal sequence when your choices are restricted to integers. I thought, along the same lines as you, "maybe if you burn 165 or 170 or something in the first non-zero term, then you could burn less on the 14 turn and still land."

And this is how I know it's not possible, at least with integer burn rates. :) I checked all 201^9 combinations, with a few optimizations to cut down the search space.

That's different than what you said, of using floating point for the last burn. But it is in a similar spirit.

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

#63
post #44

Earlier quoted context omitted.

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.

> and an impressive amount of capability for a high school senior It's only impressive because very few (none?) high schools teach calculus at the level required for his implementation. High schoolers are quite capable of handling that kind of calculus, it's just that the high schools don't teach it.

Yeah but being first is part of it, no? In my mid 20s I read Karl Popper's Conjectures and Refutations and realized I'd reached the falsification pathway to epistemology as a teenager. But was I a genius or was I just lucky to be born in this age where the soup of concepts we're bathed in makes that obvious? I think the latter. Same with Goldbach's Conjecture, I came up with an equivalent conjecture as a pre-teen.

Evidence since has shown I'm reasonably intelligent but not the Popper or Goldbach or even the Walter Bright of our times.

Humanity the organism evolves so more things become obvious to more average members. Perhaps ten year olds will see the intuitive use of monadic structures in the future.

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

#64
post #59

Oh, fond memories. I learned BASIC programming when I was 11 in 1981 (I think that’s right) at a summer computer camp on an Apple II. I made a simplified version of lunar lander… it was ridiculously fun to make and play. One of my cohort mates who was in the “advanced” Pascal class is still my friend to this day.

OP here. Cool! I was born in 1969, less than a month before Neil Armstrong walked on the moon, and was only a few months old when this game was written. I too learned BASIC, then spent hours pouring over the book "BASIC Computer Games", before I even had a computer of my own. Fond memories, as you say.

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

#65
post #17

Earlier quoted context omitted.

Automobiles are more (wear-)efficient at braking when they use the engine to brake, not the brakes, so that would probably be a better approach to automate

A long time ago, in a book whose title I don’t remember, a character said, “but engine parts are more expensive than brake parts”. That has always stuck with me, even as I glide to a stop with almost no braking.

As an avid engine braker who lives in a hilly area and drives in the foothills/mountains often, I figure that at the relatively inconsequential loads and speeds my passenger vehicles operate under, I'm simply leveraging the engine's already constant state of wear while preserving my brakes for a moment when I may need their optimal stopping performance.

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

#67
post #26

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…

It’s unsurprising that at least one of the hundreds would write such a game though? In particular when those having access already are self-selected to some degree.

It's unsurprising that someone is the best at the world at running, but it's still pretty impressive when they do it.

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

#68

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.

OP here. Yes, that's what I meant. Using the rocket equation, truncated Taylor series approximation, truncating even more to make things solvable, then iterating to improve the solution, were all things I wouldn't have expected.

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

#69
post #7

Earlier quoted context omitted.

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 progr…

Another curious feature is that the labels appears to be floating point, as in "G 5.9" appears to transfer control to line starting at "05.90".

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

#70
post #24

Earlier quoted context omitted.

That's surprising from today's perspective, but when I imagine the thought process, it seems reasonable, especially for math and science purposes where multiplication and division operators usually get grouped into a series of multiplications above the division bar, and a series of multiplications below it.

True. + also has higher precedence than -, so that a - b + c means a - (b + c).

Ah, the old

    My
    Dear
    Aunt
    Sally
vs.

    My Dear
    Aunt Sally
debate. :)
Post reply on HN