CONTENTS:
This file has information mainly of interest to other programmers.
Part 1: The Program -- Comments about the program itself.  
Part 2: Program Variables -- names and descriptions


** Part 1 **
===== THE PROGRAM =====

The Around-the-World Flight main program is only 29 lines long (Lines 230510); most of the calculations and dialogue are contained in eight major subroutines, 19 sub-subroutines, an initialization section, and an end-of-game summary section.

In the initialization section (Lines 160200), variables are dimensioned and initial values are entered by means of two subroutines. I have, of course, used city and country names as they were in 1937; most of the African names are different today.

Three lines (130, 140, 200) are used to get a seed for the Randomize statement without the user having to enter a number between -32768 and 32767. The variable RN is set to -32500 and then, in Line 140 and 200, RN is incremented by 1 until any key is pressed. The length of the input buffer, LEN(INKEY$) will be zero until a key is pressed. After a key is pressed, LEN(INKEY$) will be greater than zero, and RN will have some value greater than -32500. Line 200 checks the value of RN to see that it is not out of range (above 32767) and, if it is, subtracts 65535 as often as necessary to bring RN into the range -32768 to 32767. It is then used as the seed for RANDOMIZE.

For the most part, the main program simply calls one subroutine after another. Very short operations are done in the main program. These include printing the current location, airplane condition, and weather; determining if there is a delay in takeoff; resetting the day and date; and fueling the plane.

The date subroutine (Lines 530620) determines and prints the month and date based on the number of days into the flight (DY) from the starting date of May 20, 1937.

The aircraft-repairs subroutine (Lines 640710) looks to see if there has been a malfunction in a previous flight leg (M > 0). If so, you are asked if you want to make repairs. (Hint: You are well-advised to do so. Amelia Earhart always made necessary repairs, even to the smallest items, as soon as possible. Not making repairs substantially increases the probability of major problems on future flight legs.) If a repair is to be made, the time (in hours) to fix it is a direct function of the facilities of the airport; a minor repair will take three hours at a well-equipped airport and nine hours at a poorly-equipped one (Line 690). If the repair time is five hours or more and the next destination is more than 600 miles away (more than four flying hours) or if the repair time is nine hours or more, you will not be able to take off the same day (Line 700).

The major-overhaul subroutine (Lines 730830) is similar to the repairs subroutine. The program advises you to have a major overhaul "sometime soon" if flying time is between 39 and 60 hours and "as soon as possible" if flying time is more than 60 hours. You are also permitted to have a major overhaul at any of four very well-equipped airports: Miami, Fortaleza, Karachi, and Bandoeng. A major overhaul is not possible at airports with fair or poor facilities.

What is the probability of mechanical trouble? This is a function that took some thought and finally turned out to be quite simple. The mechanical condition of the plane is determined by the total number of flying hours and the speed flown. Although it is possible to push the plane to its limit, the engines and other mechanical components will last longer if they are used with, as Amelia put it, TLC. On the other hand, you can't fly too slowly, or fatigue becomes an overwhelming factor. Hence, the mechanical condition can be represented by cumulative distance times average speed. This is a better measure of wear and tear on the plane than just hours flown. Condition (PC) is normalized to 1.0 for 6000 miles at 150 mph (Line 1500), or 40 flying hours. On her round-the-world flight attempt, Amela tried to have a preventative overhaul approximately every 40 flight hours.

However, you may be tempted to fly longer intervals between overhauls or may find yourself at an airport that does not have the facilities for a major overhaul. What then? Until the recommended overhaul interval is reached, the plane can be considered very reliable. (See major engine-problem routine at Lines 1490 to 1610). At one-half the overhaul interval there is a slim 3% chance of malfunction, and even at 80% of the interval, the chance of a problem has risen to only a little over 5%. However, beyond the overhaul interval, the probability of a malfunction rises dramatically; fly 1.3 times the recommended interval and the chance of a problem is nearly 78%, while flying 1.5 times the interval increases the chance of failure to 92%. Obviously, the probability can never exceed 100%.

If we plot these probabilities (see graph on next page), we see a very familiar curve. Although it can be expressed several ways, the tangent function is one of the simplest. The upper and lower limits of the tangent function are p/2 and -p/2, but we want the probability to range between 0 and 1. Okay, that's easy to fix by dividing the answer by pi and adding 0.5. However, we want the input variable to range between 0 (no flight hours) and 2 (a risk-taker flying twice the recommended interval before servicing). There are several pairs of constants that make the probability of a problem equal to 10% at the scheduled maintenance point (my estimated figure for Amelia's Lockheed Electra). I finally settled on the following equation (Line 1510) in which PC represents the plane condition (ranges between 0 to 2 or more, depending upon speed and hours flown) and MP represents the probability of a mechanical problem (varies between 0 and 1):

MP = ATN(14 * PC - 17) / 3.14159 + .5

This probability is compared to a random number between 0 and 1 (Line 1520) to determine if there is an actual failure. If there is a failure in one engine, you have a 33.3% probability of being able to nurse the plane along to the next airport on one engine, a 33.3% chance of having to go back to the airport from which you just took off, and a 33.3% chance of a forced landing (Line 1570).

<graph>

The forced landing routine (Lines 16301720) first checks to see if you are over water; if so, you don't have a prayer. If you are over land, you have an 80% chance of surviving a crash, although the crash ends the round-the-world flight.

Minor malfunctions, of which Amelia Earhart saw many, are annoying but seldom fatal (Lines 17401880). On the other hand, if a previous malfunction was never fixed, the combination of two or more minor malfunctions is equivalent to losing one engine. If you have just one minor malfunction, you are given an opportunity to push on or to return to the airport from which you took off. The longer you fly with a minor malfunction, the greater the probability that it will cause major problemsup to 5% if you cover the entire flight distance. Hence, if you are less than one-third of the way to the next location, you probably should turn back. Amelia usually lived with her minor malfunctions and turned back only once on her round-the-world flight attempt, when she had serious instrument problems between Bandoeng and Saurabaya, Java. This situation is re-created in the program (Lines 22702320).

Another serious problem facing the flyer is that of fuel consumption and weight (Lines 19002020), which, of course, are interrelated. More fuel means longer flying time, but it also means more weight and higher fuel-consumption. The Electra had dramatically different fuel consumption rates depending upon its speed; this is a key calculation (Line 1910). The Electra could cruise at between 120 and 170 mph. Amelia preferred a speed of just over 150 mph whenever possible to balance fuel consumption with flight time (and pilot fatigue). It would reduce the fun of playing the game to print the exact relationships here; but at 150 mph, the Electra gets approximately two miles per gallon. Amelia also reported several serious problems with the fuel/air mixture control system. A problem in this system requires you to throttle way back because fuel consumption increases enormously.

At Lae, New Guinea, Amelia stripped nearly everything nonessential out of the Electra in order to save precious weight and increase fuel range. This is simulated in Line 1970.

Another problem related to the fuel load is that the takeoff distance is lengthened when the plane is heavier (Lines 10801250). This is a major factor at airports with short runways made of grass and dirt. When these fields are wet, which is frequently the case in Brazil and Southeast Asia, the plane may not be able to get off with a heavy fuel load. Indeed, in monsoon conditions or after days of heavy rain, the plane may be unable to break out of the mud at allregardless of fuel load.

Another problem on takeoff is that of synchronizing the two engines. Amelia had serious problems with this and smashed the Electra on the takeoff from Honolulu on her first east-to-west round-the-world attempt (Lines 12001240).

Weather conditions affect the round-the-world flight attempt in many ways. Bad weather may prevent you from taking off at all (Lines 410450). In the case of bad weather, you can elect to delay your takeoff for a day or moreoften a wise option if a monsoon is raging outside. The weather aloft (Lines 13201420) can also be a headache. In the event of a monsoon, you have a 60% chance of getting through (or around) it and a 40% chance of having to turn back. In the Caribbean you will always face strong headwinds which lengthen flying times and increase fuel consumption; across the South Atlantic you face mixed weather conditions.

Weather also affects landings (Lines 29803200). If it has been raining and the field is soggy, you run a risk of getting a wheel stuck in the mud on a grass and dirt field. You should try to contact the tower by radio to learn the condition of the field before you land. If it is soggy, you are given the option of going back. On short flight legs this is feasible, but on longer flights you probably won't have enough fuel.

One unusual problem that Amelia faced on her round-the-world flight attempt was a navigator with a serious alcohol problem. Although Fred Noonan had supposedly gone on the wagon before the flight, he soon reverted to his old ways, particularly as the flight went on; tensions increased, and delays grew longer (Lines 9201010 and 20402110). In the program, if your navigator is drunk when you are ready to take off, you have the option of waiting a day on the chance that he will be sober tomorrow. If you take off with him not fully functional, you have to rely upon dead reckoning and landmarksfeasible over land, much more difficult over water.

Seven special situations, some of which Amelia Earhart faced, are simulated in the program. The navigation was incorrect on the Atlantic crossing (Lines 21302200); this you must face, even if your navigator is stone sober. But it is not a serious problem; you simply hit the coast of Africa at the wrong place 95% of the time.

Out of Akyab, Burma, you will fly through a monsoon (Lines 22202250). Because you are following the coast, this again is not a terribly serious problem, except that you may have to land at an intermediate destination.

Already mentioned are the instrument problems on the Bandoeng to Saurabaya flight leg. Also in this part of the world, the Australian authorities refused to recognize the signature of a doctor on Amelia's vaccination records and quarantined her, Noonan, and the Electra for ten hours at Port Darwin (Lines 32203240).

Your most serious problem is on the flight leg from Lae, New Guinea, to Howland Island (Lines 23402680). Your only visible guidance comes from the arc lights at the mines at Nauru. If your navigator is functional (Noonan wasn't), you have a 30% chance of finding Howland; if not, your chance is only 2%. If you turn back for the British Gilbert Islands, you have a 1.5% chance of finding them and a 98.5% chance of winding upas Amelia didat the Marshall Islands.

Two situations which, unfortunately, Amelia did not face are the flight legs of Howland Island to Honolulu (Lines 27002770) and Honolulu to Oakland (Lines 27902960).

Five frequently used subroutines are found in Lines 3820 to 4010. They check for yes/no answers to questions, provide a pause, and make beeping noises to represent a radio signal, warning indicator, and alarm clock. Incidentally, if you want to speed up play of the game, you can lower the value of the FOR loop from 1500 to 1000 or 500 or even 0.

The end-of-flight summary (Lines 40304130) provides you with some overall statistics of your flight and that of Amelia Earhart, and gives you a chance to play the game again.


** Part 2 **
===== PROGRAM VARIABLES =====

A Answer of user (0 = Yes, 1 = No)
A$ Answer of user (Y or N)
AB Abort flight for one day indicator
C(n) Runway construction (n = 1 - 32, index of C$)
C$(n) Runway construction description (n = 1 - 3)
D Distance over a flight leg
DA Day of month
DC Distance (cumulative) total
DF Distance, maximum based on speed and fuel
DJ Distance over a flight leg, temporary
DM Distance (cumulative) since last maintenance
DX(n) Distance over a flight leg (n = 1 - 32)
DY Day into flight
F Facilities (index of F$)
F$(n) Facilities description (n = 1 - 4)
FU Fuel for a flight leg, gallons (user input)
FX(n) Facilities by location (n = 1 - 32)
I Index variable, temporary
J Location (current) index
JA Location (destination) index
K Index variable, temporary
LA$(n) Location, city name (n = 1 - 32)
LB$(n) Location, state or country name (n = 1 - 32)
M$(n) Malfunction description (n = 1 - 11)
MO$ Month
M Malfunction indicator (index for M$)
MD Miles flown prior to a malfunction on flight leg
ME Miles yet to fly after a malfunction
MJ Malfunction of instruments over Java indicator
MP Malfunction of engine probability
MQ Malfunction not fixed indicator
NC Navigator condition (scale of 1 to 100)
ND Navigator condition (0 = functional, 1 = not)
PC Plane condition (needs servicing when PC = 1.0)
PD Plane condition based on distance and time (DM * DM / TM)
R(n) Runway length (n = 1 - 32, index of R$)
R$(n) Runway length description (n = 1 - 3)
RF Radio frequency change indicator
RN Random probability of finding Howland Island also Randomize seed at start of program
S Speed over a flight leg (user input)
SA Speed over a flight leg, actual
SQ Speed, reduced because of fuel (user input)
SW Speed of wind over a flight leg
TC Flight time (cumulative) total
TE Flight time over a flight leg, expected actual
TF Flight time, maximum based on fuel and speed
TG Ground time, total at one location
TM Flight time (cumulative) since last maintenance also time in minutes at end of program
TP Ground time for overhaul
TQ Ground time for repairs
TR Flight time, temporary
W Weather, probable, at airport
WA Weather, actual, at airport (index of W$)
W$(n) Weather conditions description (n = 1 - 6)
WX(n) Weather, probable, at each airport (n = 1 - 32)
X$ Temporary string variable
X Temporary variable for random number
Y Temporary variable
Z$(n) Type of crowd (n = 1 - 6)