5 ms·
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 t
by jihadjihad 2y ago
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/LunarLanderListingText.txt https://www.cs.brandeis.edu/~storer/LunarLander/LunarLander/...
- realslimjd 2y agoThere 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.
- layer8 2y agoIt’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.
- bee_rider 2y agoIt’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.
- BobaFloutist 2y agoIt's unsurprising that someone is the best at the world at running, but it's still pretty impressive when they do it.
- schiffern 2y agoEDIT 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.
- Closi 2y agoIt 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 2y ago[deleted]
- WalterBright 2y ago> 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.
- Closi 2y agoIt'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.
- WalterBright 2y agoI agree with that.
- krallja 2y ago
- scrame 2y agoyeah bill gates at lakeside in Seattle was one of like 3 high schools in the country that had a computer.
- blahedo 2y agoNot 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.
- phkahler 2y agoI 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-collection-lunar-lander-50-years-of-crashing-into-the-moon-from-mainframes-and-minicomputers-to-arcades-and-personal-computers/ https://retro365.blog/2021/12/02/bits-from-my-personal-colle... Wikipedia on FOCAL: https://en.wikipedia.org/wiki/FOCAL_(programming_language) https://en.wikipedia.org/wiki/FOCAL_(programming_language)
- martincmartin 2y agoOP 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.
- pbhjpbhj 2y agoYour 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 M*G/(Z*K) respectively.
- martincmartin 2y agoThanks. Fixed!
- jprete 2y agoThat'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.
- dn3500 2y agoI 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.
- hyperthesis 2y agoThough famous as the first lunar lander game, the impressive part was the specific numerical techniques used.
- martincmartin 2y agoOP 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.
- Affric 2y agoIt wouldn’t be quick for me and I have done University calculus.
- martincmartin 2y agoI 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.