zd : n  , : "Around the World Flight of Amelia Earhart, 1937"x : : ) "(c) David H. Ahl, 1986" : , "Press any key to continue." : RN~X () : RNRN : : 6 : :Print scenario`:v:Initialization LA$(#),LB$("),FX(#),C(#),R(#),WX(#),DX(#),M$( )  : z : :Initialize text variables and airport data7 ) "Press any key when you're ready to go"; : ()pRNRN : : RN : RNRN : : RN : x::Main programJJ : DYDY : TG : n :  : :New day & destinationFFX(J) : WWX(J) : DDX(J) : :Set variables for new location5  : :Date subroutine} "You are at "LA$(J)", "LB$(J)". Repair facilities are ";F$(F)"." "Runway is made of ";C$(C(J));" and is ";R$(R(J))" for your plane." DC ^ : :Don't print mileage before start@" : "You have flown" DC "miles in total and you have flown"{, (TM) "hours since your last major overhaul."6  : :Aircraft repairs subroutine@  : :Major overhaul subroutine J TPTQ ^ : :Any delay for repairs or overhaul??TTGTGTPTQ : DYDYTPTQ : TP : TQ : i^ R : :Pilot condition subroutineh  : :Navigator condition subroutiner ND  : :Delay a day because navigator is drunk?|  : :Next destination subroutine= "How many gallons of fuel do you want in the plane";FUz FU~ "Maximum capacity is 1150 gallons." : :Actual weather may be slightly better or worse than expectedWA(WL()) : WA WA : WA WA. "Current weather: ";W$(WA) : WA o "Do you want to wait a day for better weather (Y or N)";A$  : A  : :Abort flight because of weather?AB : TGTG : DYDY :  : :Increase day counters ^ 8 : :Take-off subroutineO AB  : :Was flight aborted on takeoff?s  : :In flight subroutine n : ::Date subroutine DY 0 : DY8 N : DY) :&MO$"June" : DADY : D0MO$"May" : DADY : D6:MO$"July" : DADY)]D : "Date: " MO$;DA ", 1937" : N : "It's July 16 and your money has completely run out."X "Sorry, you were unsuccessful. Perhaps you and George Putnam"b "can raise enough money for a try again next year."&l .v:N:Aircraft repairs routineTQ : M : :If no malfunctions, return to main program "Your ";M$(M);" has been giving you problems."  "Do you want to have it repaired here (Y or N)";A$ :  A CM : "That will take" F "hours";v (DX(J)X F) F  : "." :  " and will prevent you from leaving today." : TQ : ::Major overhaul routineTP : TM   : TM'  : :Check flying hours_ "You should probably have a major overhaul "; : TM< ~ "sometime soon." :  "as soon as possible." :   (J J J J) TM   :  F : :Major overhaul not possible at this airportS  "Do you want a major overhaul here (Y or N)";A$ : h*TP : A 4 ()333 TPF : TPF : :30% chance that overhaul takes>DM : TM : "That will take" TP "day(s)." : : :extra dayH: R:Pilot condition routineF \X () : : "You are feeling ";e f X z : X  p "as if you could use some more sleep." : z "pretty good, all things considered." :  "fit as a fiddle and ready to go." : :!:Navigator condition routineZ!ND : NCox DC  TG : "Your navigator is ";! NCP  : NC2  : NC ! "well rested and ready to go." : ! "a bit under the weather from drinking last night." : $" "droopy and has a bad hangover." : K" "drunk and barely able to walk."" "Do you want to wait until tomorrow and hope he will be in"" " better shape (Y or N)";A$ :  : A "ND : ":":Next destination routine# J J JAJ : JAJj# "Your next destination is "LA$(JA)", "LB$(JA)"," DX(JA) "miles away."p#$x#.:#8:Take-off routine#B "Revving up engines...everything seems okay...rolling..."#L "...picking up speed and..."; : nE$VX() : Xp}  : XHz  : :Problem 2% of timez$`YC(J)R(J)WA : :Runway condition and weather$j Y XY  : :Monsoons and muddy runway?$t Y FU X  : :Bad weather and big fuel load?%~ "you're finally off!" : : Q% "the wheels just won't lift out of the mud!% "Reluctantly you concede there is no chance of a takeoff today."%AB : % "the landing gear strut broke!" :  & "engines aren't synchronized...plane is turning!"%& n : : : : i& "Disaster! The Electra is lying helpless on the runway with"& "a broken wing, smashed engine, and structural damage just"& "as in the ill-fated March 20 takeoff from Honolulu. So sorry."'  : :Flight failed, exit program%':r':In flight routines (weather, equipment, fuel consumption, navigation)' "At what speed do you wish to fly";S'  Sw S 2' "Minimum cruising speed is 120 mph; maximum is 170 mph." : (:!((:Weather aloft routineb(2WA(WAL()) : WA WA : WA WA(< "Current weather aloft is: ";W$(WA)(F J J SW : "Strong 30+ mph headwind.")P J SW : "Mixed weather...doldrums...headwinds.")Z J J P)dSW : "The plane is being buffetted about, ";)n ()L  : :60% chance of getting thru a monsoon)x "and you'll have to turn back.") X : :Turning back) "but you decide to push on."):8*:Compute flight data and update cumulative figures|*SASSW : DJDX(JA) : TEDJSA : :Actual speed, expected time*DCDCDJ : TCTCTE : :Cumulative distance and time*DMDMDJ : TMTMTE : :Cumulative maintenance distance and time+:(+:Major engine problem routinen+PCDMDM([TM) : :Plane condition; needs maint when pc=1.0+MP(PC)I : :Probability of major engine problem+ ()MP  : :Actual failure?+M : P6, "Right engine guages are going crazy...major engine failure!"z, "Want to try to limp along on one engine (Y or N)";A$ : , A ^ : :Trying to limp along on one engine,"X() : X~* @ : X* r'-, "No chance of making " LA$(JA) ". You'll have to turn back."C-6 X : :Turning back-@ n : "Whew! It looks as if you can nurse it along."-J  : :Skip minor problems and fuel consumption routines-T:-^:Forced landing routine.h J J J J  : :Over water?d.r "Going down...looking for a suitable place to land...nothing...".| ()L~  : :80% chance of surviving a forced landing. n : " C R A S H ! No survivors." : */ "maybe that small clearing..."; : n : "you made it!"b/ "The plane is a wreck but at least you're alive."/  : :It's all over/ "Going down...nothing but water..looking for a reef or anything..."/ /:/:Minor malfunction30 () l : :30% chance of a minor malfunctionq0 M MQM : MQ : :Previous malfunction not fixed?0M( ()): P : : "Malfunction in the " M$(M)0 MQ  1 "This combined with the previous malfuntion of the " M$(MQ) " will"B1 "create very serious problems for you." : "z1MD(DJ()) : :Miles flown in this flight leg1 "You have flown" MD "miles of this flight leg. Do you want to"2& "push on (Y or N)";A$ :  : A MEDJMD : MEMDH20 ()L|MEDJ : : N : :Up to 5% chance of going down2: P : "Uh oh. Fuel feed system has malfunctioned also."2D "Things look pretty bad." : : n : h2N A l : :Going on3XAB : JJ : JAJA : FU333FU ::Turning back3b:53l:Fuel consumptions3vTFFU(333S #{) : :Flying time for amount of fuel3 TFLTE  : :Enough fuel for flight leg3 Sy "Fuel consumption seems very high..." : /4 "You're going to be tight on fuel. Perhaps you should throttle"[4 "back. What speed would you like";SQ4 SQx "Too slow. Now then, what speed";SQ : 4 J FUL  : :Longer range on stripped plane5 SSQ  : :Cut back speed enough to make a difference?H5 TFuTE  : :Run out of fuel?z5 "Uh oh...the right engine is sputtering..."5 n : "And now the left engine too. You're out of fuel."5 ^ : :Go to forced landing routine5:6:Navigation26 NC3 * : :Is navigator functional?u6  "Your navigator isn't going to be of much use to you today."6 "You'll have to rely upon dead reckoning and landmarks."6  M M "Moreover, your " M$(M) " is on the fritz."7*TR(TE) : TR TRX74 : "You have been flying for over" TR "hours but there is"7> "no sign of "; : AB R : AB :  7H:7R:Special situations7\ J  : :Atlantic crossing8f "land. Pushing onwards. "; : n : "Wow! Land! Look!"P8p "Approaching coast of Africa; ahead of you is ";8z ()33s "Dakar! Nice flying!" : J :  8 "nothing but jungle. Turning north." : n 9 "A half hour later you sight St. Louis, Senegal, and decide to land."T9JA : DX( ) :  : :Distance between Dakar and St. Louis\9:9 J  : :Moonsoons out of Akyab9 "anything except the deluge of water. You'll have to put down at": "Rangoon...if you can find it." : n : "Look! There!"J:JA :  : :Reset destination to RangoonR::: J $ : :Serious instrument problems in Java: MJ  : :Have we been through this already?; "civilization. Moreover several of your instruments"C; "are behaving quite badly. Reluctantly, you turn back to"; "Bandoeng because you know that facilities at Saurabaya are minimal."; DCDC, : DMDM, : TCTC : TMTM : J : JA : MJ :  ; :<$ J  : :Lae to Howland IslandP<. "land. You spotted the arc lights at Nauru 8 hours ago."<8 "Calling Coast Guard cutter Itasca...";: ( : n~ NC RN : RN #{ : :If navigator okay, 30% chance ofv> : finding Howland Island, otherwise only 2%> ()RN ^ : :Go to forced landing routine> "My gosh! There it is! A tiny speck of land. WOW!" :  7? "Tuvalu, the only island in the Gilberts with a landing strip,"v? "is almost 4 hours distant on a course almost due west."? K  : "Flying..."; : n : K : n? : "Look! Coral reefs. A small island." : n*@ "Virtually no fuel left...both engines sputtering...try to put"e@ "it down in that flat area along the beach." : n@ "You made it down...a wing tore off the plane...navigator injured."@ n : "Men in uniform are coming over the sand dunes."A n : n : : ()(| Z _A "They're Japanese. An English-speaking native tells you that"A "this is Mili Atoll in the Marshall Islands. You are put on a"A "warship bound for Majuro. Days later you are put on another".B "Japanese warship bound for Saipan. The Japanese accuse you"vB( "of being a spy, torture you, and put you in a tiny prison cell."B2 n : : nB< "After months in a tiny, damp prison cell you contract dysentery."CF "Your navigator is executed and in August 1938 you die of disease"bCP "and thus become the first U.S. casualities of World War II."lCZ Cd "They're British. You're safe. In three days the USS Itasca"Cn "picks you up and deposits you in Honolulu a week later."Cx D :.D J  : :Howland to HonolulunD "the Hawaiian Islands. But you're buoyed by the thought"D "that you found Howland Island in the middle of the Pacific."D K  : "Flying..."; : n : K : n#E : "Calling Honolulu...come in please" : ( : neE "Honolulu to Electra: You're right on course. Weather is"E "excellent. You should sight Diamond Head very soon." : nE : "Yes...there it is. What a welcome sight!" :  E :F J  : :Honolulu to OaklandWF "the mainland. But you're confident you'll make it."F n : : "You've been flying nearly 20 hours and you're"F "bone tired. You wish your navigator could releive you.": n$G ( : "Oakland calling Electra...Oakland calling Electra..."dG "Are you okay...please respond...are you okay";A$ : G" A "Oakland : Glad to hear it."; : 6 G, "Oakland: Sorry to hear that. Keep going. Just a short way now."H6 n : " Oh yes, G.P. sends greetings." : n : eH@ "And there it is; the Pacific coast and the Golden Gate Bridge."HJ "What a beautiful sight! Coming into Oakland...steady...steady."HT "Touchdown...slowing down...HUGE crowds all around...stopping."I^ K  : n : K : : XQIh I  : K  d : K :  , : X$ : Ir X X$"CONGRATULATIONS !" : X :  I| X$" " : XI II : : : : I :I :Landing routine%J LA$(JA) ". Flying on..." : n : "Look to the right!"nJ "It looks like...yes it is...an aerodrome. What a welcome sight."J "Field looks " R$(R(JA)) " for the plane."J M  : "Radio broken. You'll have to try to land"K "without establishing contact." : :  WK "Electra calling control tower..." : (: ()L} & K "Tower to Electra...tower to Electra..." : WX(JA)  K "Condition of field is fine. Do you want clearance to land";A$L  : A : : "Repeat: "; :  PL "Field is a bit soggy. Do you want clearance to land";A$L  : A : : "Do you want to turn back";A$L  : A X : "Repeat: "; :  L& "Can't establish contact. Do you want to land";A$ : =M0 A "Circling...circling...trying radio again.":  ~M: "Coming in...steady...steady..."; : n : "touchdown."MD C(JA)R(JA)WX(JA) ()~ N : b MN "Field is soggy...one wheel caught in mud...plane is tipping."NX LNb "Slowing down...turning...bring it to a stop...shut down engines."Nl JA JA K : K(()) : :Type of crowdNv "A " Z$(K) " crowd is waiting for you. Nice job."N J : :Are you in Darwin?N ::O "Australian authorities claim that your medical papers are"}O "not in order and hold you on the plane for 10 hours. That"O "costs you an extra day." : DYDY : TGTG : O :O :Subroutine to put verbal data into constantsP I  : F$(I) : I-P I  : C$(I) : IKP I  : R$(I) : IiP I  : W$(I) : IP I  : M$(I) : IP I  : Z$(I) : IP "excellent","good","fair","poor"P "concrete","packed gravel","grass and dirt"=Q "plenty long","of adequate length","barely long enough"vQ "clear","scattered clouds","overcast","light rain"Q* "wind and heavy rain","high wind and monsoon rains"Q4 "thermocouple","turn & bank indicator","fuel guage","altimeter"8R> "Bendix radio direction finder","Sperry Gyro Pilot","radio"}RH "mixture control lever","hydraulic system","electrical system"RR "engine"R\ "small","large","noisy","clamorous","restless","tiny"Rf Rp :Sz :Airport location, repair facilities, runway construction,YS : runway length, likely weather, miles from last airportS I  : X,LA$(I),LB$(I),FX(I),C(I),R(I),WX(I),DX(I): IS S 1, "Oakland","California", 1,1,1,1,0 T 2, "Burbank","California", 2,1,1,1,332@T 3, "Tuscon","Arizona", 2,1,1,1,456wT 4, "New Orleans","Louisiana", 1,1,1,1,1287T 5, "Miami","Florida", 1,1,1,1,688T 6, "San Juan","Puerto Rico", 2,2,2,1,1053U 7, "Caripito","Colombia", 1,1,1,3,624PU 8, "Paramaribo","Dutch Guiana", 3,3,1,2,610U 9, "Fortaleza","Brazil", 1,3,2,5,1332U 10,"Natal","Brazil", 3,3,2,4,270U 11,"St. Louis","Senegal", 4,3,2,2,1992+V 12,"Dakar","French West Africa", 2,2,2,1,1974bV 13,"Gao","French Sudan", 3,3,2,2,1150V$ 14,"Fort Lamy","Chad", 4,3,3,1,1027V. 15,"El Fasher","Fr. Equatorial Africa",4,3,3,1,679 W8 16,"Khartoum","Anglo Egyptian Sudan",4,2,3,1,494?WB 17,"Massawa","Abyssinia", 3,3,2,1,442uWL 18,"Assab","Eritrea", 3,2,2,1,340WV 19,"Karachi","India", 1,1,1,3,1920W` 20,"Calcutta","India", 2,2,2,6,1390Xj 21,"Akyab","Burma", 3,2,2,6,338OXt 22,"Rangoon","Burma", 3,2,2,6,330X~ 23,"Bangkok","Siam", 2,2,2,5,365X 24,"Singapore","Asia", 2,2,2,2,895X 25,"Bandoeng","Java", 1,3,1,2,635'Y 26,"Saurabaya","Java", 4,3,3,2,365^Y 27,"Koepang","Timor", 4,3,3,2,1148Y 28,"Port Darwin","Australia", 2,1,1,1,517Y 29,"Lae","New Guinea", 3,3,2,2,1196Z 30,"Howland Island","Pacific", 4,2,2,2,25569Z 31,"Honolulu","Hawaii", 1,1,1,1,1818pZ 32,"Oakland","California", 1,1,1,1,2420xZ:Z:Check for yes or no answerZ A$"Y" A$"y" A : Z A$"N" A$"n" A : [  "Don't understand your answer of ";A$;"."D[ "Please enter Y for 'yes' or N for 'no.'";A$ : L[:h[(:Radio signal routine[2 I  : X() : K X : : K[< K  : K : I : [F:[P:Warning beeper routine\Z : I ::: K  : K : I : \d:/\n:Pause routineI\x I  : I : Q\:l\:Alarm clock routine\ : I  : : I\ "There goes the alarm. It's" (l()) "a.m. Y-A-W-N"\ I  : I : I  : : I : ]:,]:End of flight summary routineh] n : : : "Sorry your flight was unsuccessful."] : "You flew" DC "miles and were aloft for";]T(TC) : TM(<(TCT)) : T "hours and" TM "minutes."!^ "Your flight started on May 20 and ended on " MO$;DA ", 1937."d^ : "Amelia Earhart flew approximately 27,000 miles between"^ "May 20 and July 2, 1937 before going down at Mili Atoll"^ "in the Japanese held Marshall Islands." : n : _ : "Would you like to try again (Y or N)";A$ : M_ A "Okay. Good luck!" : x : : _" "Okay. So long for now." : x : "M" : _,:_6:Subroutine to print the scenario_@ : ) "Around the World Flight Attempt" : 2`J " In this simulation, you take the role of Amelia Earhart in her"}`T "attempt to fly around the world in a twin-engine Lockheed Electra."`^ " Prior to each flight leg, you are given information about your"ah "physical condition and that of your navigator, the distance to your"aar "next destination, and the current weather. As pilot, you must make"a| "many decisions before taking off, while aloft, and prior to landing.a " Under ideal conditions, at 150 mph, your plane can fly 2.3";b "miles on one gallon of fuel, but conditions are seldom ideal."tb "The Electra can hold up to 1150 gallons of fuel."b " Your engine and mechanical components will last longer if they" c "are maintained regularly; on the Electra, the recommended interval"Uc "for a major overhaul is 40 hours. But remember, not all airports"c "are equipped to service your aircraft."c " If you have malfunctions along the way, you may want to have"d "them fixed at a secondary areodrome. Of course, this costs time."dd " Your navigator has a serious alcohol problem. As long as your"d "ground time is minimal, he won't have much chance to get lost in"d "the bottle, but if you get trapped on the ground by a series of">e "tropical storms and he gets drunk, you may find you have to rely"e "on dead reckoning and landmarks when you get back in the air."e :