The Best of Creative Computing Volume 1 (published 1976)

Page 264 << PREVIOUS >> NEXT Jump to page:
Go to contents Go to thumbnails

Lunar (BASIC computer game, lunar landing simulation, LEM, ROCKET, APOLLO, BASIC program listing, sample run,)

graphic of page

Another new game from Creative Computing  . .

                                          LUNAR
                                        by David Ahi
  LUNAR, also known as ROCKET, APOLLO, LEM, etc. is, next to STAR TREK and SPACE
WAR, the most popular computer game. It is certainly the most popular on smaller
machines. (I remember a milestone of sorts when I
managed to compress LUNAR to run on 4K PDP-8 BASIC while retaining full
instructions and landing messages. I
used every single character available.)

The version of LUNAR presented here was originally written in FOCAL by Jim
Storer, a student at Lexington
(Mass.) High School in the mid 60's. While everyone claims to be the original
program author of LUNAR, I'm
reasonably sure that Jim predates the others and therefore qualifies as the
original, original author. I converted the program to BASIC in early 1970. It's
a straight~forward version without side stabilization rockets or other goodies
but, nevertheless, is quite a challenge to land successfully.

PLAYING THE GAME
  Your mission is to achieve a soft landing of your LEM on the moon. You
separate from the command ship 200
miles above the surface of the moon and, every 10 seconds, set the burn rate of
your retro rockets to slow your craft. You may free fall (0 lbs./sec.) or burn
at any rate between 8 lbs./sec. and 200 lbs./sec. Since ignition occurs at 8
lbs./sec., burn rates between 1 and 7 lbs./sec. may not be used. A negative burn
rate automatically aborts your mission.

  There are three popular ways to land:

1. Constant burn rate all the way down.

2. Free fall for a while, then maximum burn rate tapering off as you get close.

3. Gradually increase burn rate to a maximum, then taper off as you get close.

   Recall from physics that Newton found the force ofattraction (gravity)
between two bodies varies directly with the mass of the bodies and inversely
with the square of the distance between their centers. This may help you land
successfully. Then again, it may not.

COMPUTER NOTES
  Convert the program to your version of BASIC.Multiple statements on one line
are separated by a colon
(:). Everything else is standard.

  Some computers produce an error calculating the expansions (Statements 910 and
920) when you get close
to the moon and the numbers get very small. If you does, substitute the expanded
form. Here it is for Statement 910:

-Q*(1+Q*(l/2+Q*(1/3+Q*(1/4+Q/5))))

You should be able to figure out the other one yourself.

  Would you like us to print the other versions of LUNAR in Creative Computing?
lf so, write and let me
know-DHA.

MAPPING THE MOON

This photograph pictures Mare Crisium, the large "flat" area near the eastern
edge of the moon as seen from Earth. In the foreground is the mountainous
terrain that forms the southern rim of Mare Crislum. Visible near the horizon,
285 miles across the mare, is its northern rim. Prominent at above right in the
mare is the
24-mile-wide crater Picard. Photo was made from Apollo 10, the last flight
before the lunar landing. (Photo Kodak)

                                         SAMPLE RUN

RUNNH
LUNAR LANDING SIMULATION



CONTROL CALLING LUNAR MODULE..

YOU MAY SET THE FUEL RATE <K> TO ZERO OR ANY VALUE BETWEEN 0 AND 200 LBS PER
SECOND.  A NEGATIVE FUEL RATE WILL ABORT THE MISSION.

YOU HAVE 16000 LBS OF FUEL. ESTIMATED FREE FALL IMPACT TIME IS 120 SECONDS.
CAPSULE WEIGHT IS 32,500 LBS.

FIRST RADAR CHECK COMING UP... BEGIN LANDING PROCEDURE

TIME<SECS>     HEIGHT<MI>          VELOCITY<MPH>         FUEL<LBS>         FUEL
RATE
0               120                    3600               16000            K? 0
10              109.95                 3636               16000            K? 0 
     
20              99.8                   3672               16000            K? 0
30              89.55                  3708               16000            K? 0
40              79.2                   3744               16000            K? 0
50              68.75                  3780               16000            K? 0
60              58.2                   3816               16000            K? 0
70              47.55                  3852               16000            K? 0
80              37.3656                3476.43            14000            K?
200
90              28.2623                3072.94            12000            K?
200
100             20.3232                2637.46            10000            K?
200
110             13.644                 2164.97            8000             K?
200
120             8.33572                1649.14            6000             K?
200  
130             4.52958                1081.92            4000             K?
180
140             2.2887                 522.398            2200             K? 90
150             1.22706                238.772            1300             K? 40
160             .718389                127.493            900              K? 20
170             .418089                88.5788            700              K? 22
180             .237646                41.1605            480              K? 14
    
190             .147722                23.5114            340              K? 10
200             .859622E-1             20.9169            240              K? 10
210             .317304E-1             18.0912            140              K? 12
    

ON THE MOON AT 218.451SECS. 
IMPACT VELOCITY OF 8.90172 M.P.H. 
FUEL LEFT 38.5879 LBS. 
VERY GOOD LANDING, NOT PERFECT VET.

TRY AGAIN < 1 FOR YES, 0 FOR NO>? 0

CONTROL OUT

READY

264

Page 264 << PREVIOUS >> NEXT Jump to page:
Go to contents Go to thumbnails