ALTITUDE," T "MILES+FEET VELOCITY,MPH FUEL,LBS FUEL RATE"! S A=120;S V=1;S M=32500;S N=16500;S G=.001;S Z=1.8 T " ",%3,L," ",FITR(A)," ",%4,5280*(A-FITR(A)) T %6.02," ",3600*V," ",%6.01,M-N," K=";A K;S T=10 T %7.02;I (200-K)2.72;I (8-K)3.1,3.1;I (K)2.72,3.1 T "NOT POSSIBLE";F X=1,51;T "." T "K=";A K;G 2.7 I (M-N-.001)4.1;I (T-.001)2.1;S S=T I ((N+S*K)-M)3.5,3.5;S S=(M-N)/K D 9;I (I)7.1,7.1;I (V)3.8,3.8;I (J)8.1 D 6;G 3.1 T "FUEL OUT AT",L," SECS"! S S=(FSQT(V*V+2*A*G)-V)/G;S V=V+G*S;S L=L+S T "ON THE MOON AT",L," SECS"!;S W=3600*V T "IMPACT VELOCITY OF",W,"M.P.H."!,"FUEL LEFT:"M-N," LBS"! I (1-W)5.5,5.5:T "PERFECT LANDING !-(LUCKY)"!;G 5.9 I (10-W)5.6,5.6;T "GOOD LANDING-(COULD BE BETTER)"!;G 5.9 I (22-W)5.7,5.7;T "CONGRATULATIONS ON A POOR LANDING"!;G 5.9 I (40-W)5.81,5.81;T "CRAFT DAMAGE. GOOD LUCK"!;G 5.9 I (60-W)5.82,5.82;T "CRASH LANDING-YOU'VE 5 HRS OXYGEN"!;G 5.9 T "SORRY,BUT THERE WERE NO SURVIVORS-YOU BLEW IT!"!"IN " T "FACT YOU BLASTED A NEW LUNAR CRATER",W*.277777," FT.DEEP. T !!!!"TRY AGAIN?"! A "(ANS. YES OR NO)"P;I (P-0NO)5.94,5.98 I (P-0YES)5.92,1.2,5.92 T "CONTROL OUT"!!!;Q S L=L+S;S T=T-S;S M=M-S*K;S A=I;S V=J I (S-.005)5.1;S S=2*A/(V+FSQT(V*V+2*A*(G-Z*K/M))) D 9;D 6;G 7.1 S W=(1-M*G/(Z*K))/2;S S=M*V/(Z*K*(W+FSQT(W*W+V/Z)))+.05;D 9 I (I)7.1,7.1;D 6;I (-J)3.1,3.1;I (V)3.1,3.1,8.1 S Q=S*K/M;S J=V+G*S+Z*(-Q-Q^2/2-Q^3/3-Q^4/4-Q^5/5) 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) The program is cleanly separated into many subroutines. This was almost universal in FOCAL programs (and JOSS), as the line number scheme made such constructs easy to use. This program uses nine routines. The first, group 1, simply prints out the instructions using the ype statement and sets the initial values for the run. The mass of fuel is not recorded directly, instead, it uses the current ass and empty mass, , so the remaining fuel is and the lander runs out of fuel when is 0. Also note the rase at the end of line , which resets all the variable values. The main game loop is driven by group 2. As the code "falls" through group 1 into group 2 during the first run, the initial values are printed out in the first two lines. Near the end of line , the user is sked to input the burn rate as , and then the loop timer is reset using . Line tests the user's input against several possibilities, if it is over 200 or below 8 it types "NOT POSSIBLE" and a row of periods, and then loops back to ask the user to try again. If the value is between these values, it jumps forward to group 3. Note that the limited capabilities of FOCAL's command are evident here, in BASIC this could be