Skip to content

Latest commit

 

History

History
56 lines (35 loc) · 1.38 KB

README.md

File metadata and controls

56 lines (35 loc) · 1.38 KB

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