kristopherjohnson / lunar-c Goto Github PK
View Code? Open in Web Editor NEWPort of classic text-based lunar lander game to C
Home Page: http://undefinedvalue.com/lunar-for-c-and-rust.html
Port of classic text-based lunar lander game to C
Home Page: http://undefinedvalue.com/lunar-for-c-and-rust.html
This blog article describes a bug in the physics simulation of the original lunar lander code. The goal of this project is to provide the "classic" behavior, but maybe there should be an option to provide the fixed simulation.
https://martincmartin.com/2024/06/14/how-i-found-a-55-year-old-bug-in-the-first-lunar-lander-game/
Hi,
Thanks for doing this conversion!
The constant at the end of the line:
S = M * V / (Z * K * (W + sqrt(W * W + V / Z))) + 0.5;
Should be 0.05, not 0.5.
This code is invoked when the lander switches from moving down to up in a single time step. This code computes an approximate time when the velocity is zero and the lander is at its minimum position, so we can see whether or not it hits the moon. I'm not sure what the offset is for, maybe to make sure we're a little past the zero of velocity, so we don't get stuck in an infinite loop of checking where the velocity changes sign.
Anyway, both the original FOCAL and the BASIC version in "BASIC Computer Games" have 0.05, so I think that's correct.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.