Skip to content

Dr. Jim Storer's 1969 Lunar Lander program in ANSI BASIC and modern Fortran 2008

License

Notifications You must be signed in to change notification settings

fortran-gaming/lunar-lander-1969

Repository files navigation

Lunar Lander 1969: BASIC and Fortran

Actions Status

This game is presented in:

  • BASIC lunar.bas adapted from the 1969 source code, compatible with modern ANSI BASIC interpreters.
  • Fortran lunar.f90 by Michael Hirsch is also given.

Build

Any Fortran 2008 compliant compiler should work.

cmake -B build
cmake --build build

Usage

The program defaults to stdin from user.

./build/lunar-lander

Options:

  • -d allows file redirection for testing and optimization
  • -f specifies initial fuel weight

To mimic the 1969 results

lunar-lander -f 16000 -d < fail.asc

lunar-lander -f 16000 -d < ok.asc

The final output line is formatted for automatic parsing.

BASIC

For reference the 1973 BASIC program from David Ahl may be run with many ANSI BASIC interpreters like:

bwbasic lunar.bas

Notes