00 · Problem background
A CodeAbbey simulator with roots in an early BASIC game.
The supplied problem came from CodeAbbey, whose website owner is identified as Rodion Gorkovenko. Its introduction traces the exercise to the lunar-lander game in 101 BASIC Computer Games and frames the task as a training simulator for controlling a spacecraft's descent to the Moon.
The assignment supplied craft mass, fuel mass, initial height and velocity, ten-second burn-rate settings, changing lunar gravity, rocket exhaust speed, and a small simulation step. The required result was touchdown speed within an accepted numerical tolerance—not an optimal control schedule or a binary safe/unsafe verdict.
01 · Problem
Every burn changes the next decision.
The lander must reduce downward velocity before reaching the surface, but thrust consumes fuel and therefore changes spacecraft mass. The simulation advances through time while applying scheduled burn rates and updating motion under lunar gravity.
02 · Approach
Advance state one time step at a time.
Read the control input
Determine the commanded burn rate for the current portion of the descent.
Update the physics
Account for thrust, fuel loss, changing mass, lunar gravity, velocity, and height.
Evaluate touchdown
Continue until the surface is reached, then interpret the final impact velocity.
03 · Lessons
Simulation quality depends on explicit assumptions.
- State variables are coupled.Burn rate changes fuel, mass, acceleration, velocity, and the time remaining to react.
- Time-step choice matters.A coarse step can obscure rapid changes near touchdown or overshoot the surface.
- A threshold needs a source.“Safe” impact velocity should be defined and documented rather than implied.
04 · Future demonstration
Graph the descent as it happens.
A future interface could animate altitude while plotting velocity, fuel, and thrust against time, then explain which decisions produced a safe or unsafe touchdown.
Verification boundary: the exercise origin is confirmed as CodeAbbey, with inspiration attributed to 101 BASIC Computer Games. Numerical correctness has not been independently verified. The supplied task asks for touchdown speed; any later safe-impact threshold would require a separately sourced definition.