Running Lunar Lander on the PDP-8 Using Paper Tape FOCAL

From Computer History Wiki
Jump to: navigation, search

This Lunar Lander game is the ancestor of all moon landing games. It runs on a PDP-8 using Paper Tape FOCAL software.

In the fall of 1969 high school student Jim Storer programmed Lunar Lander on a Digital Equipment Corporation PDP-8 minicomputer system with eight Teletypes, a small hard drive, and 12KB of main memory.

Running Lunar Lander

Get the SIMH Lunar Lander kit.

Use the following pdp8.ini file to load Paper Tape FOCAL onto the PDP-8:

SET NOVER
SET CONSOLE SPEED=110
SET CONSOLE LOG=focal69_005.log
SET CPU NOEAE
SET CPU IDLE
SET CPU 4K
LOAD -A dec-08-ajae-pb.bin
RUN 200

Start the SIMH pdp-8:

  • Linux: ./pdp8
  • Windows: run pdp8.exe
./pdp8 

PDP-8 simulator Open SIMH V4.1-0 Current        simh git commit id: 2437b13f
Logging to file "focal69_005.log"
LOAD -A dec-08-ajae-pb.bin
%SIM-INFO: 2 sections sucessfully read

CONGRATULATIONS!!
YOU HAVE SUCCESSFULLY LOADED 'FOCAL,1969' ON A PDP-8 COMPUTER.


SHALL I RETAIN LOG, EXP, ATN ?:NO

SHALL I RETAIN SINE, COSINE ?:NO

PROCEED.

*

Make sure you enter NO twice on the two final questions, because otherwise the Lunar Lander program would not fit into the available FOCAL memory!

Copy the Lunar Lander source and paste it into the console window (be patient as it takes a while; you're finished when the line beginning with *09.40 is finished:

*01.04 T "CONTROL CALLING LUNAR MODULE. MANUAL CONTROL IS NECESSARY"!
*01.06 T "YOU MAY RESET FUEL RATE K EACH 10 SECS TO 0 OR ANY VALUE"!
*01.08 T "BETWEEN 8 & 200 LBS/SEC. YOU'VE 16000 LBS FUEL. ESTIMATED"!
*01.11 T "FREE FALL IMPACT TIME-120 SECS. CAPSULE WEIGHT-32500 LBS"!
*01.20 T "FIRST RADAR CHECK COMING UP"!!!;E
*01.30 T "COMMENCE LANDING PROCEDURE"!"TIME,SECS   ALTITUDE,"
*01.40 T "MILES+FEET   VELOCITY,MPH   FUEL,LBS   FUEL RATE"!
*01.50 S A=120;S V=1;S M=32500;S N=16500;S G=.001;S Z=1.8
*
*02.10 T "    "%3,L,"           "FITR(A),"  "%4,5280*(A-FITR(A))
*02.20 T %6.02,"       "3600*V,"    "%6.01,M-N,"      K=";A K;S T=10
*02.70 T %7.02;I (200-K)2.72;I (8-K)3.1,3.1;I (K)2.72,3.1
*02.72 T "NOT POSSIBLE";F X=1,51;T "."
*02.73 T "K=";A K;G 2.7
*
*03.10 I (M-N-.001)4.1;I (T-.001)2.1;S S=T
*03.40 I (N+S*K-M)3.5,3.5;S S=(M-N)/K
*03.50 D 9;I (I)7.1,7.1;I (V)3.8,3.8;I (J)8.1
*03.80 D 6;G 3.1
*
*04.10 T "FUEL OUT AT"L," SECS"!
*04.40 S S=(FSQT(V*V+2*A*G)-V)/G;S V=V+G*S;S L=L+S
*
*05.10 T "ON THE MOON AT"L," SECS"!;S W=3600*V
*05.20 T "IMPACT VELOCITY OF"W," M.P.H."!"FUEL LEFT:"M-N," LBS"!
*05.40 I (1-W)5.5,5.5;T "PERFECT LANDING !-(LUCKY)"!;G 5.9
*05.50 I (10-W)5.6,5.6;T "GOOD LANDING-(COULD BE BETTER)";G 5.9
*05.60 I (22-W)5.7,5.7;T "CONGRATULATIONS ON A POOR LANDING";G 5.9
*05.70 I (40-W)5.81,5.81;T "CRAFT DAMAGE. GOOD LUCK";G 5.9
*05.81 I (60-W)5.82,5.82;T "CRASH LANDING-YOU'VE 5 HRS OXYGEN";G 5.9
*05.82 T "SORRY,BUT THERE WERE NO SURVIVORS-YOU BLEW IT!"!"IN "
*05.83 T "FACT YOU BLASTED A NEW LUNAR CRATER",W*.277777," FT. DEEP"!
*05.90 T !!!!"TRY AGAIN?"!
*05.92 A "(ANS. YES OR NO)"P;I (P-0NO)5.94,5.98
*05.94 I (P-0YES)5.92,1.2,5.92
*05.98 T "CONTROL OUT"!!!;Q
*
*06.10 S L=L+S;S T=T-S;S M=M-S*K;S A=I;S V=J
*
*07.10 I (S-.005)5.1;S S=2*A/(V+FSQT(V*V+2*A*(G-Z*K/M)))
*07.30 D 9;D 6;G 7.1
*
*08.10 S W=(1-M*G/Z*K)/2;S S=M*V/(Z*K*(W+FSQT(W*W+V/Z)))+.05;D 9
*08.30 I (I)7.1,7.1;D 6;I (-J)3.1,3.1;I (V)3.1,3.1,8.1
*
*09.10 S Q=S*K/M;S J=V+G*S+Z*(-Q-Q^2/2-Q^3/3-Q^4/4-Q^5/5)
*09.40 S I=A-G*S*S/2-V*S+Z*S*(Q/2+Q^2/6+Q^3/12+Q^4/20+Q^5/30)
*

Start Lunar Lander using the GO command:

*GO
CONTROL CALLING LUNAR MODULE. MANUAL CONTROL IS NECESSARY
YOU MAY RESET FUEL RATE K EACH 10 SECS TO 0 OR ANY VALUE
BETWEEN 8 & 200 LBS/SEC. YOU'VE 16000 LBS FUEL. ESTIMATED
FREE FALL IMPACT TIME-120 SECS. CAPSULE WEIGHT-32500 LBS
FIRST RADAR CHECK COMING UP


COMMENCE LANDING PROCEDURE
TIME,SECS   ALTITUDE,MILES+FEET   VELOCITY,MPH   FUEL,LBS   FUEL RATE
    =   0           = 120  =    0       = 3600.00    = 16000.0      K=:

You will now be asked to enter your fuel consumption (“K”, for the next 10 seconds) over and over again, until you either run out of fuel or a landing (whether successful or not) occurs, whichever comes first.

COMMENCE LANDING PROCEDURE
TIME,SECS   ALTITUDE,MILES+FEET   VELOCITY,MPH   FUEL,LBS   FUEL RATE
    =   0           = 120  =    0       = 3600.00    = 16000.0      K=:0
    =  10           = 109  = 5016       = 3636.00    = 16000.0      K=:0
    =  20           =  99  = 4224       = 3672.00    = 16000.0      K=:0
    =  30           =  89  = 2904       = 3708.00    = 16000.0      K=:0
    =  40           =  79  = 1056       = 3744.00    = 16000.0      K=:0
    =  50           =  68  = 3960       = 3780.00    = 16000.0      K=:0
    =  60           =  58  = 1056       = 3816.00    = 16000.0      K=:0
    =  70           =  47  = 2904       = 3852.00    = 16000.0      K=:200
    =  80           =  37  = 1930       = 3476.43    = 14000.0      K=:200
    =  90           =  28  = 1385       = 3072.94    = 12000.0      K=:200
    = 100           =  20  = 1707       = 2637.46    = 10000.0      K=:200
    = 110           =  13  = 3400       = 2164.97    =  8000.0      K=:200
    = 120           =   8  = 1772       = 1649.14    =  6000.0      K=:200
    = 130           =   4  = 2796       = 1081.92    =  4000.0      K=:200
    = 140           =   2  = 2019       =  452.72    =  2000.0      K=:200
FUEL OUT AT=   150.00 SECS
ON THE MOON AT=   315.55 SECS
IMPACT VELOCITY OF=   343.33 M.P.H.
FUEL LEFT:=-    0.00 LBS
SORRY,BUT THERE WERE NO SURVIVORS-YOU BLEW IT!
IN FACT YOU BLASTED A NEW LUNAR CRATER=    95.37 FT. DEEP




TRY AGAIN?
(ANS. YES OR NO):NO
CONTROL OUT


*

Well, that wasn't a successful go at all ... Try yourself if you can do better!

Either say YES when asked for a new try or restart the game using the GO command.

External links