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/...
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.
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.
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.
For accuracy, it was written in FOCAL, not BASIC.
I agree with that.
The UK stopped including calculus as part of physics even!
I got told off for doing an integral.
How sad.
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.
I’m fairly certain that while schools might be capable of teaching calculus at this level, the amount of interest in that roughly corresponds with the number of students that already know calculus at that level anyway.
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.
That doesn't make any sense.
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 anything was done by somebody. In fact it is inevitable that the most impressive thing is done by somebody out there, because otherwise it wouldn’t be a thing that was done. But, being that person can still be impressive.
It's unsurprising that someone is the best at the world at running, but it's still pretty impressive when they do it.
yeah bill gates at lakeside in Seattle was one of like 3 high schools in the country that had a computer.
Not disagreeing with the overall point here, but there definitely were some high schools with computers and programming classes by then---my mom was teaching programming (FORTRAN) in a Chicago high school starting in 1967. I think she was one of the first dozen or so high school programming teachers in the country but I don't think she was _the_ first.
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.
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".
They aren't actually floating-point: each label is a pair of numbers, the first denoting the group and the second denoting the line within that group. The groups have no semantic importance, they are only for organization.
Actually, I was mistaken. The line numbers aren't even numbers, so much as digit pairs, given how one-digit labels take the first digit.
And the "DO" command takes a group number, runs each line within the group, then returns after the end of the group. So each group can effectively act as a subroutine. (In this particular game, this can be seen in groups 6 and 9.)
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
vs. debate. :)Your code got munged, use backslash to escape * (otherwise it starts a span of italicised text), or use four leading blanks for code blocks (in which escaping is usually not needed):
M*G/Z*K
I think you meant, the above and
respectively.Thanks. Fixed!
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.
It wouldn’t be quick for me and I have done University calculus.
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.
OP here. I see your point. But think of what's needed to create this game:
- From high school physics, you know to start with a free body diagram. There are two forces, gravity and thrust. So far, your average high school student with an A in physics should be able to do that.
- Gravity depends on the distance to the center, which of course is changing, that's the whole point of a lander. I mean, you start 120 miles up. You have to realize it doesn't change much, so can be approximated as a constant. But you've been exposed to that in physics class, so maybe you just assume it's a constant.
- How the hell does thrust work as a function of burn rate? Is the exhaust velocity higher when you burn more? In other words, considering 100 lbs/sec vs 200 lbs/sec, when you double the flow of fuel into the engine, and then you burn it, it turns into twice as much fuel in the same volume. Wouldn't it be forced out at twice the speed? Or at least a higher speed? Maybe you think of the universal gas law, PV=nRT. The volume is constant (the volume of the engine), n is doubled, R is a universal constant. So that means P or T changes, or both. Why is T, which is a function of the velocity of the molecules, constant why P is doubled? Why don't both change?
- So you talk to your Dad, who happens to be a physicist. Most high school students, even those getting an A in physics, don't have a physicist for a father who can look up the properties of rocket engines and find the Tsiolkovsky rocket equation. So a high school senior finding the rocket equation is impressive to me.
- To go from velocity to position, you need to integrate. I'm not sure your average A physics senior would think of replace the FLOG() call with a Taylor series and integrating it term by term.
- How many terms of the Taylor series do you need? Does it even converge for you? If he thought of these subtleties, that's impressive. But it's possible that young Jim didn't realize these issues and just uses 5 terms because that seemed like a lot of terms.
- So now you can simulate it in near the moon. Cool! But how do you detect when it hits the ground? You could try to solve for altitude equals zero, and see if there are zero or more solutions. But even if there are solutions, they might be in the past or the future. So instead you decide to look where the velocity is zero, since you know this happens exactly once during the turn. I think that shows some ingenuity there, although I don't know if that was 18 year old Jim's thought process.
- So you try to invert the rocket equation: given a desired delta-V, how much fuel do you need to burn to achieve it? If you try this with pencil and paper and high school math, including Calculus, you keep getting stuck. You don't have the tools to show that it's actually impossible and needs you to introduce a new function, the Lambert W.
- So maybe you give up, or maybe your physicist Dad helps you again. Using your Taylor series, you now have to solve a 5th degree polynomial. So you decide to scrap the 3rd, 4th and 5th term to get yourself a quadratic. Why is it ok to scrap these now, when it wasn't ok when computing the regular dynamics? I'm impressed that he realized he can use different levels of approximation in different circumstances, without it generating some inconsistencies or other problems.
- You somehow figure out how to use the alternate form of the quadratic equation, which means you didn't just look it up and type it in. Possibly impressive.
I was in high school in 1969, knew some calculus, and was very interesting in programming. In a good size city with a major engineering university and a large high school the main barrier was access to computers. Our school had teletypes connected to a remote mainframe. My friends and I found a few computers at the university we could use at night, but most had card readers and line printers, and none had graphics terminals of any kind. I think the particular combination of skills, interest, and access would have been pretty rare at the time.