
This file will try to explain the lander pgm in greater detail

The files are :

INI  this initializes all the variables
TH   2950000 lbf for thrust of rocket
HT   100000 ft for height above surface
VEL  0 ft/s start velocity
FBR  fuel burn rate lbs/s 0 initially
ET   elapsed time in sec
ACCS acceleration of ship
ACCG       "      of gravity 32 ft/s
MF   mass of fuel 60000 initially

This will display the parameters in the graphics mode and depending on the height will display a "dot" or a small picture of the ship or when HT < 100 ft a larger picture of the ship.

To begin press the soft key 'INI' the first one in the directory. To raise-lower the fuel burn rate while the game is running press appropriate user keys +-2 +-7 +-50 lbs/sec you will see your fuel decrease and acceleration change. As the fuel is depleated you will get more acc. for a given thrust as the mass of the ship is less

This program uses a variable 'MN' to run the main body I will list it and attempt to explain

%%HP: T(3)A(D)F(.);   @ this pgm allowes you to use any key
\<<                   @ during the execution of the pgm in 
  DO                  @ the variable 'TASK' when a key is
    IF PKEY           @ pressed the number returned by KEY
    THEN LTASK PKEY   @ is compared with a list of #s stored
GET 'VTASK' STO       @ in 'DOLST' if it matches one in the 
    ELSE 0 'VTASK'    @ list it will store its position in 
STO                   @ the list in 'PKEY' then if a value
    END TASK 0        @ is found in 'PKEY' it will GET that
'PKEY' STO            @ argument from 'LTASK' STO it in
  UNTIL KEY           @ 'VTASK' which is EVALed in the 
  END 'K' STO 1       @ lander pgm.
DOLST SIZE
  FOR N DOLST N GET   @ DOLST={ 11 12 13 14 15 16 }
K                     @ LTASK={ +2 -2 +7 -7 +50 -50 }
    IF ==             @ there is 1 to 1 correspondance
    THEN N 'PKEY'     @ between these lists when key 12
STO                   @ is pressed 2 is STOed in PKEY
    END               @ and -2 STOed in VTASK
  NEXT MN             @ well that's all hope you have
\>>                   @   fun 


%%HP: T(3)A(D)F(.);
DIR
  INI
    \<< CLLCD CLEAR
INIT 2950000 'TH'
STO 100000 'HT' STO
0 'VEL' STO 0 'FBR'
STO 0 'ET' STO 0
'ACCS' STO 60000
'MF' STO MN
    \>>
  MN
    \<<
      DO
        IF PKEY
        THEN LTASK
PKEY GET 'VTASK'
STO
        ELSE 0
'VTASK' STO
        END TASK 0
'PKEY' STO
      UNTIL KEY
      END 'K' STO 1
DOLST SIZE
      FOR N DOLST N
GET K
        IF ==
        THEN N
'PKEY' STO
        END
      NEXT MN
    \>>
  DOLST { 11 12 13
14 15 16 }
  IN
    \<< OBJ\-> 1 SWAP
      IFERR
        FOR L DUP
\->STR DUP DUP SIZE 1
- DUP SUB
          IF "$" \=/
          THEN ""
INPUT OBJ\->
          ELSE { \Ga
} INPUT
          END SWAP
STO
        NEXT
      THEN DROP MN
      END
    \>>
  VEL -224
  HT 99440
  MF 60000
  FBR 0
  ET 7
  SPAD
GROB 8 2 FF00
  SBK
    \<< PICT { # 3d
# 0d } SBLK REPL
    \>>
  SLG
GROB 8 18 808080808080C1C1C1C1C1C1C1C122141400
  SMD
GROB 4 4 20202050
  SSM GROB 2 2 1000
  SBLK
GROB 7 56 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  MSHIP
    \<<
      IF HT 100 <
      THEN PICT {
# 3d # 56d } SPAD
GOR
      END
      IF HT 1001 >
      THEN PICT
# 6d 40 HT 2479 /
IP - R\->B 2 \->LIST
SBK SSM GOR
      ELSE
        IF HT 101 >
        THEN PICT
# 5d 40 HT 25 / IP
- R\->B 2 \->LIST SBK
SMD GOR
        ELSE PICT
# 3d 39 HT 2.5 / IP
- R\->B 2 \->LIST SBK
SLG GOR
        END
      END
    \>>
  E
GROB 35 5 00000000000000000000000000000000000000000000000000
  CNUMS
    \<< { # 0d # 0d }
PVIEW # 35d # 5d
BLANK 'E' STO {
# 45d # 5d } CSTR {
# 99d # 0d } CSTR {
# 52d # 15d } CSTR
{ # 70d # 21d }
CSTR { # 60d # 31d
} CSTR { # 39d
# 39d } CSTR
    \>>
  DNUMS
    \<< { # 0d # 0d }
PVIEW 2 FIX { # 47d
# 5d } HT \->STR DSTR
{ # 99d # 0d } ET
\->STR DSTR { # 52d
# 15d } VEL \->STR
DSTR { # 70d # 21d
} ACCG ACCS + \->STR
DSTR { # 60d # 31d
} FBR \->STR DSTR {
# 39d # 39d } MF
\->STR DSTR
    \>>
  INIT
    \<< ERASE { # 0d
# 58d }
" +2    -2    +7    -7    +50  -50"
DSTR { # 20d # 5d }
"HEIGHT: " DSTR {
# 80d # 0d }
"TIME: " DSTR {
# 20d # 15d }
"VELOCITY: " DSTR {
# 20d # 21d }
"ACCELERATION: "
DSTR { # 20d # 31d
} "BURN RATE: "
DSTR { # 20d # 39d
} "FUEL: " DSTR
    \>>
  DSTR
    \<< PICT ROT ROT
"    " + 1 \->GROB
REPL
    \>>
  STRT MN
  TASK1 MN
  L
    \<< VTASK 'FBR'
STO+ C1 C2 DSP
      IF HT 1 \<=
      THEN
        IF VEL ABS
6 \<=
        THEN
"YOU HAVE LANDED"
        ELSE
" **CRASH**"
        END 1 \->GROB
PICT SWAP { # 20d
# 50d } SWAP GOR 60
WAIT HALT
      END
    \>>
  TASK L
  CST { 2 -2 7 -7
50 -50 }
  C2
    \<< TH FBR 180 /
* MS MF + / DUP
'ACCS' STO ACCG +
DUP TI * DUP VEL +
2 / TI * 'HT' STO+
'VEL' STO+ TI SQ *
2 / 'HT' STO+ TI
'ET' STO+
      IF HT 0 <
      THEN -10 'HT'
STO
      END
    \>>
  C1
    \<<
      IF FBR 0 \<=
      THEN 0 'FBR'
STO
      END FBR TI *
'MF' SWAP STO-
      IF MF 0 \<=
      THEN 0 'TH'
STO 0 'MF' STO 0
'FBR' STO
      END
    \>>
  DSP
    \<< DNUMS MSHIP
    \>>
  K 12
  VTASK 0
  PKEY 0
  LTASK { 2 -2 7 -7
50 -50 }
  ACCS 0
  TI 1
  ACCG -32
  TH 2950000
  MS 30000
END
