README file for lander, the original lunar lander program DESCRIPTION =========== Wherefore is it that recent astronaut reality movies (notably _Apollo 13_ and _Space Cowboys_) deny us (the audience) a graceful lunar landing? They have me yearning for the classic lunar lander game: after some practice, I feel anyone could do a smooth touch-down near Tycho B. Here's your chance. This lunar lander game is not only an exact external replicate of the one from yore (lander.bas is included for your browsing pleasure ... warning: gosub rules the day here), but also serves as a small tutorial for call-outs to C-routines using melange. NOTES ===== The need was a delay loop in BASIC that I did not want d2c to optimize away. My solution was to write the countdown routine in C (with an appropriate header), and use melange to allow me to call the C-routine as a Dylan function. See counter.* for the C implementation, see counter-intr.intr for the melange interface, and see lander.lid and the Makefile for how I tied it all together. Pay attention! If you're sending output to the terminal via Dylan, you must manually flush it (with flush-output(*standard-output*)) before making the C call, otherwise you get a mess on the screen. Also, as this classic.basic.program, and the others, depend on the keyboard for input ("Keyboard ... how quaint!" commented Scotty in Star Trek IV), I've put the tied query and input into its own library: terminal-input. BACKGROUND ========== I had some wonderful times coding, then playing, the games from David Ahl's _BASIC Computer Games_ on my TRS-80 (4K Mod I, Level 2, to be precise). After digging for those sources, I came across an ftp'd version of a scant 6 of them. Here is an exact copy of the original lander in Dylan, along with the original BASIC source code. INSTALLATION ============ I recommend you install this program in a directory like games/. This program requires the terminal-input library be installed off the same base directory. terminal-input is available from the same ftp source from which you got lander-1.0.1.tar.gz. If you have not installed terminal-input, please download and install it first (it has installation directions in its README file). Once you've installed the terminal-input library, enter the below at the shell: $ gzip -cd lander-1.0.1.tar.gz | tar xvf - $ cd lander $ make TODO ==== * I seem to remember a graphical version; once GTK's ported, do that. * I believe there was a multi-planet lander simulation, too (landing on Jupiter was quite a challege). Find the gravity constants for the other planets and moons and add those options. * I've pretty much kept the flavor of the original BASIC source, implementing instead in the functional style where it was obvious to do so. Further improvements here would be a Good Thing(tm). SOURCES ======= Original BASIC source code from anon. Traceable sources circa _BASIC Computer Games_, by David Ahl (out-of-print) Included BASIC source ftp'd from: ftp.rahul.net/pub/rhn/classic.basic.programs Dylan sources created by Douglas M. Auclair, dauclair@hotmail.com Dylan sources copyright (c) 2000, Douglas M. Auclair under the GPL (www.fsf.org/copyleft/gpl.html)