(figure)

THE GAME

The Longest Automobile Race puts you in the driver's seat. In this simulation of a 1908 race from New York to Paris—across the U.S., Japan, Russia, and Europe—you are the captain of the American team. It is your job to get the Thomas Flyer to Paris as quickly as possible—and before your money runs out.

Soon after your departure on February 12, 1908, you encounter some of the worst snows of the decade. From Chicago on, you face a different array of problems: accidents, fatigue, mechanical breakdowns, and more bad weather. Japan and Russia have their own problems (narrow cart tracks in Japan, no gas or lubricants in Russia).

Your chances of beating the other contestants to Paris will be increased if you note the following:

On July 30, 1908, nearly six months after starting the race, the weary Thomas Flyer crew limped down the Champs-Elysees and was declared the winner of the race. Can you improve on the performance of the American team—or will your opponents pass as you are permanently bogged down in Siberian mud?

sample output

THE STORY

In 1908, barely 15 years after the automobile was invented, the seemingly preposterous suggestion that an automobile race be run from New York to Paris was made. This race, proposed by newspapermen of the New York Times and Le Matin of Paris, was to be made over untried roads; the sponsors believed it would be possible to drive in Alaska by widening dog trails and, in the far North, driving on the crust of the snow that, according to one Times document, "froze so solidly overnight that it would bear the weight of a car." They also believed that contestants would be able to drive a car on frozen rivers and to cross the Bering Strait between Alaska and Siberia on an ice bridge.

The most difficuly stretch of the race was across Manchuria amd Russia

This sort of misinformation, coupled with the daring, adventuresome spirit of early automobile makers and the promise of honor and glory, lured thirteen contestants to sign up for the race.

However, on February 12, 1908, the day the race was to begin, only six teams actually showed up. The entrants included three cars made in France and one each made in Italy, Germany, and the United States.

The French entries included a 30 hp Motobloc, a big De Dion, and a tiny one-cylinder, 15 hp Sizaire-Naudin. Italy was represented by a Zust, Germany by a big Protos, and the U.S. by a year-old, 60 hp Thomas Flyer. All of the cars had four cylinders (except the Sizaire-Naudin), open bodies with no windshields, narrow spoked wheels, no heaters, and only the most basic seating for driver and passengers.

Each team consisted of a driver and one or more mechanics. In addition, each car was required to carry a writer/observer from one of the sponsoring newspapers.

The race got underway in front of the Times Building on 43rd Street at 11:15 A.M. on Abraham Lincoln's birthday, 1908.

The Sizaire-Naudin driven by Auguste Pons led the procession up Broadway and onto the Albany Post Road. It was the only time Pons had the lead; while climbing a hill only 40 miles from the city, his car broke an axle. There were no spare parts available for his car, and Pons spoke no English. Thus the race ended for him on the very first day.

Language was also a problem for the crew of the French Motobloc. They stopped for lunch at a hotel in Dobbs Ferry, New York, and after waiting two hours to be served, became furious and accused the proprietor of overcharging and delaying them. To add injury to insult, just a few miles north at Peekskill, the Motobloc skidded in the snow and landed in a ditch, delaying it further. Snow and language difficulties continued to plague the Motobloc team, and they finally dropped out of the race three weeks later in western Iowa.

The remaining four cars fought on—although their battles were as much or more with Mother Nature as with one another.

From the newspaper stories, one can piece together a fascinating description of the race. However, a somewhat more coherent account is found in the book, The Longest Auto Race, by George Schuster, the mechanic on the American Thomas Flyer. Moreover, Schuster and the Flyer team stayed in the race long after even the hardiest newspapermen had dropped out.

Schuster records constant problems with snow as the cars progressed along the route from New York to Albany, Buffalo, Erie, Cleveland, South Bend, and Chicago. In fact, Ohio and Indiana had one of the worst blizzards of the decade just after the cars left Buffalo.

What should have been a two- or three-day trip from Buffalo to Chicago became a week-long ordeal for the Flyer team: in and out of snow drifts, driving on railroad tracks, hiring teams of horses to pull the car a few miles, and dealing with every sort of mechanical problem.

Beyond South Bend, the team was forced to hire teams of six or eight horses to drag the car along. On February 22 Schuster spent $80 on horse teams and covered only 15 miles. The next day, the Flyer team struggled for 22 hours and covered a grand total of eight miles.

The chores of draining the water from the cooling system every night (antifreeze had not yet been invented) and making constant small repairs added to the frustration of slow progress.

Finally, at 4:25 P.M. on February 25, the Flyer team reached the South Shore Country Club, the official arrival point in Chicago. Schuster notes that it took 13 1/2 days to travel the 1403 miles from New York, eight days of which were required to cover the last 256 miles. All of the teams spent a few days in Chicago recuperating and making needed repairs before starting westward on "tracks of half-frozen ruts" on the morning of February 28.

Now the battle was with thick, gooey mud, which the wheels and tires threw in big gobs onto the fenders, running boards, and interior of the car. Schuster records that when the Flyer team pulled into Clarence, Iowa, to stop for the night, someone suggested that they take the car to the fire station to get the mud washed off. The high-pressure three-inch stream was so effective that the Flyer crew visited fire stations whenever they could from then on. The thrill of the trip had worn thin for the Times correspondent, and a day later in Cedar Rapids he bade the American crew good bye and returned to New York.

The Plains States brought more rain and mud, which, as the cars reached the mountains, turned into sleet, hail, and snow.

Conditions were so bad in Utah and eastern Nevada that it became clear that crossing the Sierra Nevada Mountains (the direct route to San Francisco) would be impossible. So the Flyer team took a 700-mile detour south through the Nevada desert and Death Valley to Bakersfield, California and back up along the San Joaquin Valley to San Francisco.

The Flyer team made it to San Francisco on March 24, a total of 3836 miles and 41 days after leaving New York. At the time, the Italian Zust was in Utah and the French De Dion and the German Protos were in Wyoming, all pushing west. With the help of the Thomas Flyer dealer in San Francisco, that car was prepared, as much as possible, for the unknown rigors of Alaska and Siberia that lay ahead. Springs, transmission, wheels, drive chains, and many other parts were replaced in the three days before the car was loaded on the steamer City of Pueblo for the three-day voyage to Seattle. There, five tires—all that could be found—were purchased and Schuster wired owner Mr. Thomas at the factory for additional funds.

The crew and car sailed north on a leisurely seven-day voyage to Valdez, Alaska. There they learned the truth about the proposed route: Dog trails didn't exist, snow would not support a car, and there was no ice bridge across the Bering Strait. They telegraphed this information to New York and soon received a response: "Return to Seattle. Route changed. Go by steamer to Vladivostock." Meanwhile, the Zust and the De Dion had arrived in San Francisco, while the Protos, much in need of repairs, had been shipped by its crew aboard a railroad flatcar from Idaho across the Sierra Nevadas to Seattle, avoiding the 700-mile "detour" taken by the other cars.

The Protos sailed immediately for Vladivostock; the other teams, unable to get a steamer for Russia, sailed instead for Japan. The Flyer crew, afraid that those teams would get credit for driving across Japan, decided to take a steamer for Kobe, Japan. On the voyage, the leather aprons with which the Flyer crew had replaced their metal fenders were removed by the Chinese crew to make sandals. The captain ordered the ship's carpenter to replace the aprons with canvas and, Schuster reported, "except for that our voyage was uneventful." As it turned out, the Flyer crew need not have worried about the newly added Japan segment.. The race committee ruled that the Protos would be penalized 15 days for not driving all the way across the U.S. and that the Flyer crew would be given a 15-day advantage for going to Alaska.

The trip across Japan from Kobe to Tsuruga was only 350 miles, but torturous miles they were. Japanese roads were designed for narrow carts, and the big cars could barely negotiate the sharp turns and steep hills. What should have been an easy two-day drive turned into a four-day ordeal punctuated by delays for religious processions, detours, wrong turns, and skids into ditches. Although it was commonly thought that the Japanese worked for coolie wages, one group of workmen insisted on 50 yen ($25) for manning a towrope to let the Flyer down a steep hillside.

Sailing from Tsuruga on May 16, the Flyer and its crew finally arrived in Vladivostock in a gloomy rain on May 18. The other cars were all there, but the eccentric Count De Dion, his team having already driven and won the Peking to Paris race the year before, decided he had much to lose and little to gain by continuing on, and pulled his team out of the race.

Gasoline was extremely scarce in Russia, and the Protos and Zust teams had lined up most of the existing supplies. Schuster was thus forced to cash his last letter of credit to buy 400 gallons of gasoline at exorbitant prices ($1.00 to $1.25 per gallon). Most of this was then shipped ahead by rail to be stored along the route where the team could retrieve it in the days ahead. This was necessary because there were no filling stations, and gasoline would not be commercially available until the cars reached Europe. The teams stocked up on food and supplies and were ready to go on May 22. "You are mad," a Russian officer told them. "You will never get through." It rained during 17 of the next 20 days and, recounted one driver, "we drove out into a dismal, flat, rain-drenched country, over or rather through a road that was a streak of mud as far as the eye could reach." The Flyer drove in low or second gear with chains on the rear wheels.

In one of the most memorable events of the race, the Flyer came upon the Protos so deep in the mud that only the tops of the rear wheels showed above the mire. The three Germans and a Russian officer/guide were trying to pry it out, but with the churning of the wheels it was only sinking deeper. After a brief debate among themselves, the Flyer crew passed a towrope to the Germans and managed to pull the Protos to solid ground. Lt. Koeppen, the German team captain, uncorked a bottle of champagne and poured drinks as thanks for what he called "a gallant, comradely act."

Finally, unable to make any progress in the muddy cart tracks, the Flyer crew took to driving along railroad tracks, a strategy they had successfully used—at great cost to the wheels, tires, and springs—on several stretches in the U.S. Two tires quickly blew out, and four more were worn to the cords in the next 150 miles. The organizers had ruled that the cars would not be permitted to fit special wheel flanges that would allow them to drive on the rails but that driving on the ties was permitted.

Soon, however, the pounding on the ties began to take an even greater toll than the tires and springs. A sharp noise signaled a six-inch crack in the Flyer transmission housing and the stripping of six gear teeth from the drive pinion. Schuster then made a five-day trip to Harbin where he cabled the factory to send a new transmission by way of Europe. Meanwhile, the crew made makeshift repairs—new teeth were welded to the drive pinion at a blacksmith shop—and slowly pushed on.

Mechanical devices, much less automobiles, were virtually unknown in Manchuria and Siberia, and lubricants were unavailable. Thus the crew was forced to buy 40 lbs. of Vasoline in Chita to quiet the gears and allow them to keep moving. At Irkutsk, completely out of money, Schuster again wired the factory for more. He received it, but Thomas warned him that he was disinclined to pour any more money into this adventure. Also at Irkutsk when the mud was washed from the car, he discovered a broken motor support. Schuster replaced it with a piece of boiler plate from the railroad shops, but the break had thrown the motor out of line, making it difficult to shift gears.

It rained so constantly through Siberia that the road was a continuous bog. The car frequently got stuck, and laborers or horse teams had to be hired to pull it out. Near Kansk was a swollen river with a quicksand bottom and no bridge; there the Flyer crew hired four teams of Cossacks' horses to rush the car across a fording spot. The next day they came upon a river so deep it could not be forded, so the crew hired villagers to make a log raft to float the car across.

Deep ditches across the roads were frequent hazards in Siberia. On one occasion, completely worn brake drums failed to stop the Flyer in time at one of these ditches; there was a sudden snap, and the left side of the car sagged. The frame was broken, creating an awkward problem in the middle of nowhere. Finally, angle iron was secured from a railroad shop and bolted to the broken frame.

The Protos had been in the lead across most of Russia, but finally, near the village of Kolnokowa, the Flyer caught up with and passed the German competitor. However, a few days later, on July 1 in Omsk, 3408 miles from Vladivostock, the makeshift transmission repairs on the Flyer gave out. The new transmission had been shipped two weeks earlier aboard the SS President and should have been waiting. It wasn't, so again the crew laboriously forged new teeth at a blacksmith shop and welded them on. This cost three days, but on July 4, the Flyer was back on the road. The Protos, too, had run into trouble and was obliged to wait in Kansk for five days until a new rear axle could be shipped from the factory in Germany.

Schuster, fearing that the transmission would soon fail permanently, sent two crew members (two mechanics from teams that had dropped out had joined the Flyer crew) to check all the railroad depots in the area for the missing transmission while the car pushed slowly on toward Perm. There he received word that the missing transmission had been located at Kasan, 350 miles ahead and more or less on the route west. However, the mud was so bad that the car could never be shifted out of low, and three days out of Perm—still 215 miles from Kasan—the transmission failed for good.

Schuster then used the last of his money to arrange relays of farm wagons to fetch the 600-lb. transmission. It took five days, by which time Schuster, walking with the wagons day and night, was sick with chills and a high fever. Installing the transmission took another day, and on July 18 the team finally reached Kasan where they took a steam ferry across the Volga River. A wrong turn, a leaky radiator, and another break in the frame slowed the Flyer, but finally at Gorky they reached the relatively smooth pavement of some of the oldest roads in Europe.

But there were problems with these roads, too. When driven at speed on a good surface, the Flyer wobbled all over the road; the repaired motor support broke again and was out of alignment with the clutch and transmission. The tires were worn through, and the radiator was still leaking. Thus, the team had to stop for several days in Moscow to make more repairs.

The Flyer team reached St. Petersburg on the afternoon of July 22, four days behind the Protos; three days later, the Flyer crossed the border into Germany. The radiator sprang yet another leak and was removed for more repairs at the ancient fortress city of Konigsberg. The crew reached Berlin on July 27, and there heard the disheartening news that the Protos had arrived in Paris the night before. Rolling along perfectly smooth road outside of Hanover, the car slowed down and finally coasted to a stop. The makeshift clutch shaft installed in Moscow had worn away completely, again necessitating complete disassembly and repair. The 30-lb. assembly was hauled to a machine shop many miles away where it took another half day to make and install a new part.

At noon the next day, having had little food or rest, the Flyer crew drove into Cologne, looking forward to a washup and a good meal. "Not here, not here," said the head waiter of the Dom Hotel, shaking his head and waving the motley crew out of the restaurant. After an unsatisfying meal at a small cafe, they left the city and crossed the Rhine into Liege, Belgium, to spend the night.

Leaving early on July 30, they followed the Meuse River and crossed into France at Fumay. Accelerator to the floor, they attained a speed of 50 mph, the highest since they had left the United States. Approaching Paris late in the afternoon, they were stopped by gendarmes who refused to let them pass without headlamps (they had broken weeks before in Siberia). A passing Frenchman gallantly offered one from his bicycle. When the lamp could not be detached, the bicycle was lifted onto the car, and the journey was resumed amid cheering crowds.

At 6:00 P.M. on July 30, the Thomas Flyer pulled up in front of the offices of Le Matin and, with the credit for going to Alaska and the penalty against the Protos, was declared the winner of the longest automobile race in history by 26 days. The only other car still in the race, the Italian Zust, finally reached Paris on September 17, missing second place by only three days.

Winning the race briefly spurred sales of the Thomas Flyer, but the euphoria was short-lived. In 1909, Henry Ford introduced the Model T, thus ending the age of expensive hand-crafted automobiles. A year later, only 913 Thomas Flyers were produced, and the following year the company left the business.

Note: The restored chassis of the competing Protos is on display in the Deutches Museum in Munich, Germany, and the restored Thomas Flyer is at the Harrah Automotive Museum in Reno, Nevada. The Zust was not preserved.

BIBLIOGRAPHY

Schuster, George with Tom Mahoney. The Longest Auto Race. New York: The John Day Co., 1966.

The New York Times. Various accounts between February and August, 1908.

THE PROGRAM

The Longest Automobile Race program consists of a main program, initialization section, summary section, 12 major subroutines, and five lesser subroutines.

In the initialization section (Lines 140–230), variables are dimensioned, and text and numeric data are read into variables in three subroutines. When the data are loaded, the program enters an endless loop (Line 220) to produce a seed for the Randomize function. This loop is exited when you press any key.

The main program (Lines 250–620) consists of two main sections. The first section (Lines 260–500) obtains data for the next section of the race, specifically weather (W), distance (D), and the number of days that it took the winning car to complete the segment in 1908 (TE). The current date, location, and summary information of the race to that point are then printed. If the racer has managed to limp along with an unfixed problem that developed on the road, repairs are made at this location (Lines 310–330).

If the next segment of the race is an ocean voyage, the ocean voyage subroutine (Lines 2290–2570) is called. If the next race segment is a normal land segment, the main program prints a description of the expected weather and road conditions, and establishes a time and distance goal (Lines 450–470).

Next, three subroutines that accept input from the user are called: the amount of fuel to be put in the car and spotted at villages ahead (in many locations, the racing teams had to send cans of gasoline ahead by train), the desired driving speed, and the desired number of driving hours per day.

The second major section of the main program (Lines 520–620) loops through each day of the race. For each day, subroutines that deal with weather conditions, mechanical breakdowns, and accidents and special situations, are called. After this, the program calculates daily and cumulative distance traveled and gasoline consumption. If a race segment is completed, the program branches back to the beginning of the main program to start the next segment.

In the gas-and-oil subroutine (Lines 640–710), you are asked how many gallons of fuel you want to purchase. The price of gasoline varies between 17 and 39 cents per gallon (Line 650); the average is 25 cents. However, if you run out of gasoline on the road, the base price is 33 cents per gallon, although it can be as low as 23 cents or as high as 52 cents. In general, the best strategy is to buy enough gas for a segment at the outset. However, extra gas goes to waste, as it cannot be shipped ahead to the next race segment. In general, the car will get approximately 14 miles per gallon, but mileage varies by plus or minus 20% (Line 580). After calculating the total cost of the gas you want to buy, the program goes to the payment subroutine at Line 2660 (discussed later). If you don't have enough money to buy the amount of gasoline you want, you get as much as you can afford.

The subroutine to accept the desired speed (Lines 730–800) will accept any speed between 8 mph and 54 mph, the top speed of the Thomas Flyer. In snowy weather, the program limits the maximum speed to 30 mph. Of course, your average speed on the road will be lower than the speed you input, because you must slow down to go through villages, make detours, make rest stops, and deal with unexpected problems. The probability of a mechanical breakdown is related to speed by the formula at Line 790 and increases rather quickly as speed exceeds 35 mph. You must, of course, balance the risk of mechanical problems with that of driving too slowly to be competitive.

The driving-hours subroutine (Lines 820–920) accepts the desired driving hours per day (HP), establishing an upper limit of eight and a lower limit of two. If you have consistently been driving for an average of more than seven and a half hours, you are advised not to push yourself and your crew quite so hard. The probability of a problem resulting from driver fatigue (PF) is related to driving hours and starts to rise sharply when six and a half hours per day is exceeded (Line 910). The formula for this probability is:

PF = HP^3 / 1000 - .15

Cubing the hours causes the very sharp rise from nil at five hours per day to 6.6% at six hours, 19.3% at seven hours, and 36.2 at eight hours.

The date subroutine (Lines 940–1100) simply takes the day counter (TD%XC) and converts it into the proper month and day. If the date goes beyond August 31—one full month after the first car crossed the finish line in 1908—you are obliged to withdraw from the contest.

The weather subroutine (Lines 1120–1620) is the longest in the program. It is divided into five sections, representing major types of weather conditions, and a subroutine having to do with getting stuck in a ditch.

Each of the five major weather-subroutine sections is structured similarly. First, a random number is generated to determine if something nasty happens. For example, in the heavy snow section (Lines 1150–1210), there is a 33% chance of hitting a blizzard of major proportions. In this case the speed factor (PW) ranges from .03 to .10; i.e., your actual speed will be only 3% to 10% of what you input. You also have a 17% chance of getting stuck in a snowdrift, in which case you are sent to the stuck-in-the-ditch subroutine. Under "normal" heavy-snow conditions, the speed factor is about .22 or 22% of what you input.

In regular snowy conditions there is a 10% chance of skidding off the road, but in all cases your speed is much reduced (Lines 1230–1270).

Rainy weather was a much greater problem in 1908 than it is today, because the dirt roads turned into virtual quagmires into which a car could sink 10 or 15 inches. There is a 20% chance of this occurring (Line 1300). Furthermore, if you do get stuck, getting out is usually rather time-consuming.

In the cloudy-and-mixed-weather section (Lines 1350–1470), there is a 1% chance of a sudden downpour, an 8% chance of coming to a river with no bridge, and a 92% chance of smooth sailing. Although a river without a bridge doesn't seem to be related to cloudy weather, in the actual 1908 race most of the rivers across which the contestants had to be ferried were reached during stretches of cloudy or mixed weather. The program gives you a choice of being ferried across (for a fee) or driving north to a bridge (an unknown distance away).

If you get stuck in a snowdrift, a ditch, or mud, you can usually find a farmer to pull you out for $5 to $20 (Line 1540). If you want to pay him to pull you out, the program calls the payment routine. If not, you and your mechanic have at it with prybars, shovels, and a winch. To get out by yourself takes at least one day and sometimes two (Lines 1610–1620).

The mechanical-breakdowns subroutine (Lines 1640–1910) is perhaps the most complex in the program. First, a random number is compared to the breakdown probability to determine if there actually is a breakdown (Line 1650). Then, the specific problem is determined by the random number functions in Line 1660; the first 13 malfunctions are twice as likely to occur as the last five.

1660 F = INT(1 + 15 * RND(1)) : IF F > 13 THEN F = INT(14 + 5 * RND(1))

The problem is then presented to you, and you are asked whether or not you want to fix it and which type of repair you want to use in the event that more than one is available. One is usually a new part and the other a homebrew approach. Each repair has a time and cost associated with it. If you have enough money, the repairs are made; otherwise the car must be nursed along to the next city at half speed, a procedure with a 60% chance of success. Also, if there is a second unrepaired malfunction, the combination of the two forces the car to be retired. In general, the only time you might not want to do a repair right away is when you are nearing the next city, because you won't lose much time at the reduced speed and also a sympathetic automobile dealer will usually fix your car for free (Lines 310–330).

The accidents-and-special-situations subroutine (Lines 1930–2270) is divided into three sections. The first determines whether or not there is an accident (Line 1940). As mentioned earlier, the probability of an accident is related to the average driving hours per day. If there is an accident—you dozed off and ran into something: a tree, hole, or farmer's wagon—you can try to fix it on the spot (costs time) or get a tow to the next village and get it repaired there (costs money). At the time of the accident, the farmer will tell you the cost of a tow to the next village, but, of course, you will not know how much the repairs will cost.

In the four race segments in which the roads are particularly bad or blocked with snow, you may be able to get permission to drive on the railroad tracks (Lines 2100–2170). While this will save you time—the speed factor is multiplied by 1.7—the constant pounding of tires on the uneven railroad ties is extremely hard on the car.

Although the wheels, tires, suspension, transmission, and chassis take the biggest beating, in the program the current overall probability of all problems is simply multiplied by 1.25, i.e., an increase of 25% (Line 2170).

In the two race segments in central Russia between Chita and Omsk, very few mechanical supplies of any sort were available in 1908. Gasoline, oil, grease, and all spare parts had to be carried on the cars or shipped ahead, or substitutions made on the spot. During this segment, the Thomas Flyer developed a serious crack in its transmission. The team requested that a replacement be shipped from the factory, but they had to push on to meet the transmission in Perm.

A portion of this adventure is simulated in the no-grease routine (Lines 2190–2270). Also, the time for a transmission repair is set to forty hours (Line 3510), which is five eight-hour workdays. The forty hours is converted to days in Line 1790 so it can be added to the cumulative travel time.

The ocean-voyage subroutine (Lines 2290–2570) simulates the five steamer voyages: San Francisco to Seattle, Seattle to Valdez, Valdez to Seattle, the long 21-day trip to Kobe, Japan, and the short voyage from Tsuruga to Vladivostock, Russia. There is not much decision-making on these segments. Your waiting time in port varies from one to four days and is produced by the formula in Line 2300.

A short subroutine takes care of time delays and hotel stays (Lines 2590–2640). It simply increments the day counters by TZ, a variable set in various other subroutines representing days needed for repairs, tows, river crossings, and port stays. For each day of the trip, except those on ships, you pay an average of $10 for food and accommodations for you and your mechanic.

All bills—repairs, tows, hotels, gasoline, and ferries—are paid in a four-line subroutine (Lines 2660–2690). The cost of an item (ZN) is simply subtracted from your cash reserve (Z). If you don't have enough money to pay your bills and can't get it from home, an indicator (A) is set to 1 and program execution is returned to the place the bill was incurred. The consequences of not paying your bills can range from mild (if you can't pay for as much gasoline as you want, you are given as much as you can afford) to severe (unpaid repair and hotel bills take you out of the race).

If you run out of money, you can wire Mr. Thomas at the factory in Buffalo for more (Lines 2710–2950). In 1908, Mr. Thomas was wildly enthusiastic about the race before it started and while the cars were in the U.S. However, as the months wore on his enthusiasm turned to disenchantment, and he became much less willing to supply additional funds to the crew. The growing disillusionment of Mr. Thomas as well as his somewhat temperamental nature is simulated in the program.

You can go back and ask for money three times before Mr. Thomas gets totally fed up. You can get up to $1000 on each of the first two requests and up to $500 on the third. But if you don't say the right things you may get less or you may have to wait for the money. Lines 2790 to 2830 pick apart the contents of your telegram to Mr. Thomas in three-letter groups. I won't spoil the fun of playing the game by telling you what the telegram must say, although close analysis of the program will give you the answer.

The three subroutines between Lines 2970 and 3510 read numeric and alphabetic data into the proper variables. The subroutine at Lines 3530–3570 checks for a yes or no answer to an INPUT statement. The telegraph and warning beeper subroutines make simple sounds, the "Ready to go?" subroutine halts the program until a key is pressed, while the pause subroutine creates a short pause in program execution.

The simulated race can end in one of two ways: You make it to Paris or you don't. If you make it, the routine at Lines 3740 to 3870 tells you how long it took and where you placed in the race. If you don't make it, a consoling message is printed, and you are given a chance to try again.

PROGRAM VARIABLES

A Answer of user (0 = Yes, 1 = No)
A$ Answer to string input query, user input
AP Telegram-politeness indicator
AT$ 3-letter group from telegram
AS Telegram-urgency indicator
C(n) Road conditions by location, index of C$(n), n = 1 - 20
C$(n) Road-conditions descriptor, n = 1 - 20
D Distance of segment
DA Distance, cumulative within segment
DC Distance, cumulative
DD Distance, daily
DX(n) Distance of segment, n = 1 - 20
F Mechanical failure, index for FA$, FB$, FC$, FL, FT
FA$(n) Mechanical-failure descriptor, n = 1 - 18
FB$(n) Mechanical-failure fix descriptor, n = 1 - 18
FC$(n) Mechanical-failure 2nd fix descriptor, n = 1 - 18
FD$ Mechanical failure, hours or days descriptor
FL(1,n) Mechanical-failure cost of 1st fix, n = 1 - 18
FL(2,n) Mechanical-failure cost of 2nd fix, n = 1 - 18
FQ Mechanical-failure, how to fix, user input
FT(1,n) Mechanical-failure time for 1st fix, n = 1 - 18
FT(2,n) Mechanical-failure time for 2nd fix, n = 1 - 18
FU Mechanical failure, fix time
FX Mechanical-failure indicator
GF Gasoline base price per gallon
GG Gasoline reserve
GM Gasoline used by day
GP Gasoline price
HC Hours per day, cumulative
HP Hours per day to drive, user input
I Temporary index
J Journey-segment number
JV Ocean-voyage indicator
K Temporary indicator and index
LA$(n) City, n = 1 - 20
LB$(n) State or country, n = 1 - 20
MD Day of month
MO$ Month
PB Probability of mechanical breakdown
PF Probability of fatigue problem
PW Probable speed factor due to weather and road conditions
RN Random variable for random number
RQ Random variable for hours
SP Speed, user input
T Time-into-race segment

TD Time, cumulative
TE Time of 1908 winning car to complete segment
TL Time, cumulative of 1908 race leader
TT Temporary date indicator
TX(n) Time of 1908 winning car to complete segment, n = 1 - 20
TZ Time delay
W Weather on the trip, index of w$(n)
W$(n) Weather descriptor, n = 1 - 6
WX(n) Weather, probable at each location, n = 1 - 20
X Temporary variable
X$ Temporary string variable
Z Cash balance of racing team
ZN Cash expenditure during race

Note: all variables use the following measurement units:

D	Distance	Miles
G	Gasoline	Gallons
H	Time		Hours
P	Probabilities	0 to 1
T	Time		Days
Z	Money		Dollars and cents

PROGRAM LISTINGS

Download AUTORACE.BAS (tokenized BASIC format)

100 CLS : KEY OFF
110 LOCATE 10, 23 : PRINT "The Longest Automobile Race, 1908" : PRINT
120 PRINT : PRINT TAB(29) "(c) David H. Ahl, 1986" : LOCATE 23, 21
130 '
140 'Initialization
150 DIM LA$(20), LB$(20), TX(20), C(20), WX(20), DX(20)
160 DIM FA$(20), FB$(20), FC$(20), FT(2, 20), FL(2, 20)
170 Z = 1000 : GF = .25 : 'Starting cash and gas price
180 GOSUB 2970 : 'Initialize text variables
190 GOSUB 3060 : 'Initialize location data
200 GOSUB 3310 : 'Initialize mechanical breakdown data
210 PRINT "Press any key when you're ready to go" : RN = -32768!
220 WHILE LEN(INKEY$) = 0 : RN = RN + 1 : WEND
230 WHILE RN > 32767 : RN = RN - 65535! : WEND : RANDOMIZE RN : GOSUB 4010
240 '
250 'Main program
260 J = J + 1 : T = 0 : GOSUB 3710 : GOSUB 3630 : 'New location, road data, etc.
270 DA = 0 : W = WX(J) : D = DX(J) : TE = TX(J) : 'Set variables for new location
280 GOSUB 940 : 'Print the date
290 PRINT "You are at " LA$(J) ", " LB$(J) "."
300 PRINT "You currently have"; : PRINT USING "$$####.##";Z : IF J = 1 THEN 420
310 IF FX = 0 THEN 340 : 'Any unfixed mechanical parts?
320 PRINT "A sympathetic garage owner will fix the " FA$(FX) " here." : FX = 0
330 TZ = INT(1 + 3 * RND(1)) : PRINT "It will take" TZ "day(s)." : GOSUB 2590
340 IF J > 7 AND J < 11 THEN GOSUB 2290 : 'Ocean voyage?
350 IF JV = 1 THEN JV = 0 : TL = TL + TE : GOTO 260 : 'End of ocean voyage?
360 PRINT : PRINT "You have driven" INT(DC) "miles in" TD "days."
370 IF J = 20 THEN 3740 : 'Finished the race?
380 IF TD < TL THEN 400 ELSE IF TD = TL THEN 410
390 PRINT "The race leader passed this point" TD - TL "day(s) ago." : GOTO 420
400 PRINT "You are the race leader and are" TL - TD "day(s) ahead." : GOTO 420
410 PRINT "You and the Italian Zust are running even with each other."
420 TL = TL + TE : 'Elapsed time of race leader
430 IF J = 7 OR J = 12 THEN GOSUB 2290 : 'Ocean voyage after land segment?
440 IF JV = 1 THEN JV = 0 : GOTO 260 : 'End of ocean voyage?
450 PRINT "Roads to the west of here are " C$(C(J)) "."
460 PRINT "The weather forecast is " W$(W) "."
470 PRINT "You set a goal of making" D "miles in the next" TE - 2 "days."
480 GOSUB 640 : 'Buy gas and oil
490 GOSUB 730 : 'Get desired speed
500 GOSUB 820 : 'Get desired driving hours per day
510 '
520 'Go through this race segment day by day
530 TZ = 1 : GOSUB 2590 : 'Increment through each day of travel
540 GOSUB 1120 : 'Weather subroutine
550 GOSUB 1640 : 'Mechanical breakdown subroutine
560 GOSUB 1930 : 'Accident subroutine
570 DD = SP * HP * PW : DA = DA + DD : DC = DC + DD : 'Daily and cumulative distances
580 GM = .07 * DD * (.8 + .4 * RND(1)) : 'Gas used today
590 IF GM < GG THEN GG = GG - GM : GOTO 620 : 'Subtract gas used from supply
600 BEEP : BEEP : BEEP : GOSUB 940 : PRINT "You ran out of gas on the road."
610 GF = .33 : GOSUB 640 : GG = GG - GM : 'Buy gas
620 IF DA >= D THEN 260 ELSE 520 : 'Complete a travel segment?
630 '
640 'Fuel and oil subroutine
650 GP = GF * (.7 + .6 * RND(1)) : PRINT "Gas costs" INT(100 * GP) "cents per gallon here."
660 INPUT "How many gallons do you want for the segment ahead"; GG
670 GF = .25 : ZN = GG * GP : PRINT "That will cost"; : PRINT USING "$$###.##";ZN
680 GOSUB 2660 : 'Do you have enough money?
690 IF A = 0 THEN RETURN : 'Enough money now?
700 IF Z < 2 THEN PRINT "Your car won't run on fumes. It's all over." : GOTO 3910
710 GG = INT(Z / GP) : PRINT "Sorry, you could only get" GG "gallons." : RETURN
720 '
730 'Input desired speed subroutine
740 INPUT "How fast (mph) do you want to drive";SP
750 IF SP > 54 THEN PRINT "Top speed of your car is only 54 mph." : GOTO 740
760 IF SP < 8 THEN PRINT "At that rate, you'll never get there." : GOTO 740
770 IF W < 3 AND SP > 30 THEN 780 ELSE 790
780 PRINT "That's too fast for these weather and road conditions." : GOTO 740
790 PB = SP * SP / 7000 : 'Probability of mechanical breakdown is related to speed
800 RETURN
810 '
820 'Input desired driving hours subroutine
830 K = 0 : 'Counter for pushing too hard
840 INPUT "How many hours do you want to drive each day"; HP
850 IF K = 1 THEN 910 : 'Did we ask about pushing too hard already?
860 IF HP > 8 THEN PRINT "That's too much for both you and your car." : GOTO 840
870 IF HP < 2 THEN PRINT "No one is that lazy!" : GOTO 840
880 HC = HC + HP : IF J > 2 AND HC / J > 7.55 THEN 890 ELSE 910
890 PRINT "You've been pushing yourself and your crew pretty hard."
900 PRINT "You should probably back off a bit." : K = 1 : GOTO 840
910 PF = HP ^ 3 / 1000 - .15 : IF PF < .01 THEN PF = .01 : 'Probability of fatigue problem
920 RETURN
930 '
940 'Date subroutine
950 IF TT = TD THEN RETURN : 'Printed this date already?
960 IF TD < 19 THEN 990 ELSE IF TD < 50 THEN 1000 ELSE IF TD < 80 THEN 1010
970 IF TD < 111 THEN 1020 ELSE IF TD < 141 THEN 1030 ELSE IF TD < 172 THEN 1040
980 IF TD < 203 THEN 1050 ELSE GOSUB 3630 : GOTO 1070
990 MO$ = "February" : MD = TD + 11 : GOTO 1060
1000 MO$ = "March" : MD = TD - 18 : GOTO 1060
1010 MO$ = "April" : MD = TD - 49 : GOTO 1060
1020 MO$ = "May" : MD = TD - 79 : GOTO 1060
1030 MO$ = "June" : MD = TD - 110 : GOTO 1060
1040 MO$ = "July" : MD = TD - 140 : GOTO 1060
1050 MO$ = "August" : MD = TD - 171
1060 PRINT : PRINT "Date: " MO$; MD ", 1908" : TT = TD : RETURN
1070 PRINT : PRINT "It's September 1 and the winning car crossed the finish"
1080 PRINT "line in Paris over a month ago. Your factory refuses to give"
1090 PRINT "you any more money to continue. Better luck next time."
1100 GOTO 3890
1110 '
1120 'Weather subroutine
1130 ON W GOTO 1150, 1230, 1290, 1350, 1350, 1490
1140 '
1150 'Heavy snow and blizzard conditions
1160 RN = RND(1) : IF RN < .33 THEN 1170 ELSE IF RN > .83 THEN 1190 ELSE 1210
1170 GOSUB 960 : PW = .03 + .08 * RND(1) : 'Speed factor in blizzard
1180 PRINT "Blizzard conditions. Tough going today." : GOSUB 3710 : RETURN
1190 GOSUB 960 : PW = .05 + .1 * RND(1) : 'Speed factor in very heavy snow
1200 PRINT "You're stuck in a huge snow drift." : GOSUB 1530 : RETURN
1210 PW = .14 + .17 * RND(1) : RETURN : 'Speed factor on heavy snow day
1220 '
1230 'Snow conditions
1240 IF RND(1) < .1 THEN 1260 : '10% chance of getting stuck in snow
1250 PW = .3 + .4 * RND(1) : RETURN : 'Speed factor on normal snowy day
1260 PW = .15 + .1 * RND(1) : GOSUB 960 : PRINT "You have skidded into a ditch."
1270 GOSUB 1530 : RETURN : 'Hire farmer to pull you out of ditch?
1280 '
1290 'Rainy weather
1300 IF RND(1) < .2 THEN GOSUB 960 : GOTO 1320 : 'Bogged down in mud?
1310 PW = .35 + .4 * RND(1) : RETURN : 'Speed factor on normal rainy day
1320 PW = .02 + .04 * RND(1) : PRINT "You are totally bogged down in the mud."
1330 GOSUB 1530 : RETURN : 'Hire farmer to pull you out of mud?
1340 '
1350 'Cloudy and mixed weather
1360 RN = RND(1) : IF RN > .08 THEN 1470 ELSE GOSUB 960 : 'Normal cloudy day?
1370 IF RN < .01 THEN PRINT "An unexpected downpour!" : GOTO 1320
1380 PRINT "River ahead with no bridge. Some locals tell you there is a bridge"
1390 PRINT "'some distance' north. They also offer to take you across by boat"
1400 ZN = 3 + 2 * INT(3 * RND(1)) : PRINT "for $" ZN; : INPUT ". Want to go by boat";A$
1410 GOSUB 3530 : IF A = 1 THEN 1450 : 'Not willing to pay?
1420 GOSUB 2660 : 'Go to pay the bill routine
1430 IF A = 1 THEN 1450 : 'Still not enough money?
1440 PRINT "They got you across in" 2 + INT(3 * RND(1)) "hours." : PW = .3 : RETURN
1450 TZ = INT(1 + 2 * RND(1)) : PRINT "It took" TZ "day(s) for you to drive north ";
1460 PRINT "and find the bridge." : GOSUB 2590 : RETURN
1470 PW = .4 + .4 * RND(1) : RETURN : 'Normal cloudy day
1480 '
1490 'Clear and sunny
1500 IF RND(1) < .025 THEN GOSUB 960 : GOTO 1380 : 'River with no bridge
1510 PW = .45 + .5 * RND(1) : RETURN : 'Normal sunny day
1520 '
1530 'Pull you out of ditch subroutine
1540 ZN = 5 * INT(1 + 4 * RND(1)) : PRINT "A farmer offers to pull you out for $" ZN
1550 INPUT "Do you want to pay him to pull you out";A$ : GOSUB 3530
1560 IF A = 1 THEN 1610 : 'Not willing to pay?
1570 GOSUB 2660 : 'If not enough money try to get some
1580 IF A = 1 THEN 1610 : 'Still not enough money?
1590 RQ = INT(1.5 + 5 * RND(1)) : PRINT "It took" RQ "hours for him to pull you out."
1600 IF RQ < 5 THEN RETURN ELSE TZ = 1 : GOSUB 2590 : PW = PW * 1.5 : RETURN
1610 TZ = INT(1 + 1.3 * RND(1)) : PRINT "It took" TZ "day(s) for you and your mechanic"
1620 PRINT "to pull the car out by yourselves." : GOSUB 2590 : PW = PW * 1.5 : RETURN
1630 '
1640 'Mechanical breakdowns subroutine
1650 IF RND(1) > PB THEN RETURN : 'If no mechanical breakdown then return
1660 F = INT(1 + 15 * RND(1)) : IF F > 13 THEN F = INT(14 + 5 * RND(1)) : 'What malfunction
1670 BEEP : BEEP : BEEP : GOSUB 940 : 'Sound warning beeper and print date
1680 PRINT "Uh oh. You have a problem. It's a " FA$(F) "."
1690 PRINT "Here's what you can do about the problem:"
1700 PRINT TAB(7) "(1) Try to keep going with it"
1710 PRINT TAB(7) "(2) " FB$(F) ", cost $" FL(1, F)
1720 IF FC$(F) = "" THEN 1740 : 'Only one way to fix it?
1730 PRINT TAB(7) "(3) " FC$(F) ", cost $" FL(2, F)
1740 INPUT "Which would you like to do";FQ
1750 IF FQ = 1 THEN 1840 : 'Decided to do nothing?
1760 IF FQ = 2 OR FQ = 3 THEN 1770 ELSE PRINT "Please enter a number." : GOTO 1740
1770 FQ = FQ - 1 : FU = FT(FQ, F) : IF FU < 8 THEN FD$ = "hours" ELSE 1790
1780 IF FU < 5 THEN 1810 ELSE TZ = 1 : GOTO 1800 : 'Lose a day for repairs?
1790 FU = FT(FQ, F) / 8 : TZ = FU : IF FU = 1 THEN FD$ = "day" ELSE FD$ = "days"
1800 PW = PW * 1.5 : GOSUB 2590 : 'Allow for 1/2 day driven & increase day counters
1810 ZN = FL(FQ, F) : PRINT "Repairs will take" FU;FD$ " and will cost $" ZN
1820 GOSUB 2660 : 'Pay the repair bill
1830 IF A = 0 THEN RETURN : 'Enough money?
1840 PRINT "You try to nurse the car along to the next major city."
1850 IF FX = 0 THEN 1870 : 'Any unfixed malfunction?
1860 PRINT "But with the other problem you just can't make it and" : GOTO 1890
1870 IF RND(1) > .4 THEN 1900 : '60% chance that you can nurse it along
1880 GOSUB 3710 : PRINT : PRINT "Unfortunately, it just won't make it and"
1890 PRINT "reluctantly you admit defeat." : GOTO 3890
1900 PRINT "It looks like you'll make but at a drastically reduced speed."
1910 PW = PW * .5 : FX = F : RETURN : 'Cut speed factor in half, note unfixed item
1920 '
1930 'Accidents and special situations subroutine
1940 IF RND(1) > PF THEN 2100 : 'If driving long hours is not a problem, go on
1950 BEEP : BEEP : BEEP : BEEP : GOSUB 940 : PRINT "You dozed off and your car has run ";
1960 ON INT(1 + 4 * RND(1)) GOTO 1970, 1980, 1990, 2000, 2000
1970 PRINT "into a tree." : TZ = 2 : ZN = 24 : GOTO 2010
1980 PRINT "off the road." : TZ = 1 : ZN = 12 : GOTO 2010
1990 PRINT "into a gaping hole." : TZ = 1 : ZN = 18 : GOTO 2010
2000 PRINT "into a farmer's wagon." : TZ = 2 : ZN = 25
2010 PRINT "You can try to fix it or get a tow to the next village for $15."
2020 INPUT "Want to try to bang out the damage on the spot";A$ : GOSUB 3530
2030 IF A = 0 THEN 2070 ELSE PRINT "The tow costs $15 and the repairs cost $" ZN
2040 ZN = ZN + 15 : GOSUB 2660 : 'Pay the bills
2050 IF A = 0 THEN 2100 : 'Enough money now?
2060 PRINT "The locals impound your car for your unpaid debt." : GOTO 3890
2070 PRINT "You finally manage to do it but it takes" TZ "day(s)."
2080 PW = PW * 1.5 : GOSUB 2590 : 'Allow for 1/2 day driven & increase day counters
2090 '
2100 'Drive on railraod ties routine
2110 IF J< >2 AND J< >5 AND J< >13 AND J< >14 THEN 2190 : 'In area with railroads?
2120 IF RND(1) > .4 THEN 2190 ELSE GOSUB 940 : '40% chance to drive on rwy tracks
2130 PRINT "In this area of terrible roads, you can save some time by driving"
2140 PRINT "on the railraod tracks. However, it is murder on your wheels,"
2150 PRINT "tires, and whole car. "; : INPUT "Want to drive on the tracks";A$
2160 GOSUB 3530 : IF A = 1 THEN RETURN
2170 PW = PW * 1.7 : PB = PB * 1.25 : RETURN : 'Increase speed and chance of trouble
2180 '
2190 'No grease routine
2200 IF J< >15 AND J< >16 THEN RETURN : 'In central Russia?
2210 IF RND(1) > .2 THEN RETURN : '20% chance of no grease
2220 BEEP : BEEP : BEEP : GOSUB 940 : PRINT "Your differential is dry and there is"
2230 PRINT "no grease available here. However, you can get Vaseline."
2240 INPUT "Want to use it in place of grease";A$ : GOSUB 3530
2250 IF A = 0 THEN PRINT "Okay, you buy 20 jars for $4." : Z = Z - 4 : RETURN
2260 PRINT "The gears sound horrible. You'll have to cut your speed in half."
2270 PW = PW * .5 : RETURN
2280 '
2290 'Ocean voyage subroutine
2300 JV = 1 : TZ = INT(1 + 3.5 * RND(1)) : 'Length of time in port
2310 IF J = 12 THEN 2510 ELSE IF J = 10 THEN 2480
2320 IF J = 9 THEN 2420 ELSE IF J = 8 THEN 2390
2330 PRINT "You're stuck in port for" TZ + 1 "days before you can get a steamer"
2340 PRINT "for Seattle. You use the time to get new countershaft"
2350 PRINT "housings, springs, wheels, drive chains, and tires."
2360 IF Z > 300 THEN PRINT "The cost of these items is $164." : Z = Z - 164 : GOTO 2380
2370 PRINT "These were all furnished by the local Thomas Flyer dealer."
2380 TZ = TZ + 1 : TD = TD + 3 : GOSUB 2590 : GOSUB 3660 : RETURN
2390 PRINT "It took 3 days on the steamer. The next steamer for Valdez"
2400 PRINT "Leaves in" TZ "days. Nothing to do but wait." : GOSUB 2590
2410 GOSUB 3660 : TD = TD + 7 : RETURN
2420 PRINT "The steamer made many stops up the coast and it took 7 days."
2430 PRINT "It is apparent that the race organizers have never been in Alaska"
2440 PRINT "and have no idea that it is impossible to drive on the snow and"
2450 PRINT "ice at all, much less across the Bering Strait to Russia. You'll"
2460 PRINT "have to return to Seattle. Next steamer goes in" TZ "days."
2470 GOSUB 2590 : GOSUB 3660 : TD = TD + 7 : RETURN
2480 PRINT "It took 7 days to get back to Seattle. Now you have a" TZ "day"
2490 PRINT "wait before you can get a freighter for Japan."
2500 GOSUB 2590 : GOSUB 3660 : TD = TD + 21 : RETURN
2510 PRINT "The freighter across the Pacific takes a leisurely 21 days making"
2520 PRINT "stops at Hawaii, Guam, and the Philippines. Also the Chinese"
2530 PRINT "crewmen made sandals out of your leather fenders and mud flaps."
2540 PRINT "You can't replace them in Japan, but you can at Vladivostock,"
2550 PRINT "Russia. There you'll have to spend several days arranging for"
2560 PRINT "fuel also. But hurry now. A steamer to Russia leaves tonight."
2570 GOSUB 3660 : TD = TD + 7 : RETURN
2580 '
2590 'Time delay and hotel bills routine
2600 T = T + TZ : TD = TD + TZ : 'Increment time counters
2610 ZN = 10 * TZ : GOSUB 2660 : 'Pay for hotel and meals
2620 IF A = 0 THEN RETURN : 'Did we have enough money?
2630 PRINT : PRINT "You don't even have enough money to pay for meals."
2640 PRINT "That's the end of the road for you." : PRINT : GOTO 3890
2650 '
2660 'Pay the bills routine
2670 IF Z < ZN THEN GOSUB 2710 ELSE 2690 : 'Enough money to pay bills?
2680 IF Z < ZN THEN A = 1 : RETURN : 'Couldn't get money from home
2690 Z = Z - ZN : A = 0 : RETURN : 'Subtract money from kitty
2700 '
2710 'Need more money subroutine
2720 ZB = ZB + 1 : IF ZB < 3 THEN ZW = 1000 ELSE ZW = 500 : 'Money request and amount
2730 PRINT : PRINT "You don't have enough money to continue. Your only hope is"
2740 PRINT "to send a telegram back to Mr. Thomas at the factory and ask"
2750 PRINT "for more money. Remember, telegrams in 1908 used all capital"
2760 PRINT "letters, had no commas, and were short."
2770 INPUT "What is your message";A$ : PRINT "Sending telegram now…"
2780 GOSUB 3590 : IF ZB > 3 THEN 2940
2790 AS = 0 : AP = 0 : L = LEN(A$) : IF L < 12 THEN 2920
2800 FOR I = 1 TO L - 2 : AT$ = MID$(A$, I, 3) : 'Look at 3-letter groups in telegram
2810 IF AT$ = "PLE" OR AT$ = "BEG" OR AT$ = "SOR" OR AT$ = "IMP" THEN AP = 1
2820 IF AT$ = "SOO" OR AT$ = "QUI" OR AT$ = "EAR" OR AT$ = "FAS" OR AT$ = "HUR" THEN AS = 1
2830 IF AT$ = "IMM" OR AT$ = "ONC" OR AT$ = "URG" THEN AS = 1
2840 NEXT I : IF AP = 0 THEN 2880 ELSE IF AS = 0 THEN 2860
2850 PRINT "Mr. Thomas wired back $ "ZW" and said 'GOOD LUCK!" : Z = Z + ZW : RETURN
2860 PRINT "Mr. Thomas didn't know you needed the money right away and waited"
2870 PRINT "3 days before wiring back $" ZW : Z = Z + ZW : TZ = 3 : GOSUB 2590 : RETURN
2880 IF AS = 0 THEN 2910
2890 PRINT "Mr. Thomas wired back, 'YOU COULD AT LEAST BE POLITE,' but did"
2900 ZW = ZW / 2 : PRINT "include a draft for $" ZW : Z = Z + ZW : RETURN
2910 PRINT "Mr. Thomas was offended by your telegram and refused to" : GOTO 2930
2920 PRINT "Your message was short all right. Too short. Mr. Thomas didn't"
2930 PRINT "send any money. Sorry." : RETURN
2940 PRINT "Mr. Thomas wires back: I AM FED UP WITH THIS ADVENTURE STOP"
2950 PRINT "YOU WILL GET NO MORE MONEY FROM ME STOP" : RETURN
2960 '
2970 'Subroutine to put verbal data into constants
2980 FOR I = 1 TO 6 : READ C$(I) : NEXT I
2990 FOR I = 1 TO 6 : READ W$(I) : NEXT I
3000 DATA "hard packed gravel", "muddy ruts", "slightly improved wagon tracks"
3010 DATA "built for narrow carts", "practically non-existent", "horrible"
3020 DATA "blizzard conditions", "snow and sleet", "rain"
3030 DATA "cloudy with a chance of rain", "mixed", "sunny and dry"
3040 RETURN
3050 '
3060 'Location, expected weather, road conditions, need to use rail,
3070 ' expected days to next location, distance to next location
3080 FOR I = 1 TO 20 : READ X, LA$(I), LB$(I), WX(I), C(I), TX(I), DX(I) : NEXT I
3090 RETURN
3100 DATA 1, "New York", "New York", 2, 1, 8, 897
3110 DATA 2, "Kendallville", "Indiana", 1, 1, 6, 166
3120 DATA 3, "Chicago", "Illinois", 3, 2, 7, 634
3130 DATA 4, "Omaha", "Nebraska", 6, 3, 4, 482
3140 DATA 5, "Laramie", "Wyoming", 2, 3, 7, 467
3150 DATA 6, "Ogden", "Utah", 6, 1, 8, 1237
3160 DATA 7, "San Francisco", "California", 5, 7, 8, 0
3170 DATA 8, "Seattle", "Washington", 5, 7, 8, 0
3180 DATA 9, "Valdez", "Alaska", 5, 7, 8, 0
3190 DATA 10, "Seattle", "Washington", 5, 7, 25, 0
3200 DATA 11, "Kobe", "Japan", 4, 4, 4, 350
3210 DATA 12, "Tsuruga", "Japan", 4, 7, 7, 0
3220 DATA 13, "Vladivostock", "Russia", 3, 5, 15, 558
3230 DATA 14, "Tsitsihar", "Manchuria", 5, 6, 10, 659
3240 DATA 15, "Chita", "Russia", 3, 3, 8, 1116
3250 DATA 16, "Kansk", "Russia" 4, 3, 6, 1075
3260 DATA 17, "Omsk", "Russia", 5, 1, 7, 820
3270 DATA 18, "Perm", "Russia", 3, 2, 14, 1090
3280 DATA 19, "St. Petersburg", "Russia", 3, 1, 8, 1575
3290 DATA 20, "Paris", "France", 0, 0, 0, 0
3300 '
3310 'Mechanical breakdown descriptions, time to fix, cost
3320 FOR I = 1 TO 18
3330 READ X, FA$(I), FB$(I), FC$(I), FT(1, I), FL(1, I), FT(2, I), FL(2, I) : NEXT I : RETURN
3340 DATA 1, "tire blowout", "Patch the hole", "Replace the tire", 2, 1, 2, 7
3350 DATA 2, "skipping cylinder", "New spark plugs", "Grind cylinder", 1, 2, 8, 2
3360 DATA 3, "rough running engine", "Do a tune up", "", 4, 5, 0, 0
3370 DATA 4, "binding axle bearing", "Regrind bearing", "Get a new one", 8, 2, 4, 8
3380 DATA 5, "cracked spring", "New spring", "Weld angle iron to it", 8, 26, 8, 4
3390 DATA 6, "cracked wheel", "New wheel", "Weld brace on it", 2, 42, 8, 4
3400 DATA 7, "slipping clutch", "Adjust clutch", "New clutch plate", 4, 4, 8, 54
3410 DATA 8, "stripped gear", "Weld teeth back on", "New gear", 16, 6, 8, 24
3420 DATA 9, "radiator leak", "Weld a patch on it", "", 4, 2, 0, 0
3430 DATA 10, "brakes failure", "Replace the linings", "", 8, 7, 0, 0
3440 DATA 11, "crack in the countershaft housing", "A new housing", "", 24, 40, 0, 0
3450 DATA 12, "broken drive pinion" "Weld teeth back on", "New pinion", 16, 6, 8, 18
3460 DATA 13, "broken rear axle", "Get a new axle", "", 16, 68, 0, 0
3470 DATA 14, "cracked transmission housing", "New one from factory", "", 24, 60, 0, 0
3480 DATA 15, "broken motor support", "Make a new one of scrap iron", "", 16, 16, 0, 0
3490 DATA 16, "worn down clutch shaft", "A new clutch shaft", "", 8, 28, 0, 0
3500 DATA 17, "cracked frame", "Weld on braces of angle iron", "", 24, 26, 0, 0
3510 DATA 18, "total transmission failure", "A new one from factory", "", 40, 225, 0, 0
3520 '
3530 'Check for yes or no answer
3540 IF A$ = "" OR A$ = "Y" OR A$ = "y" THEN A = 0 : RETURN
3550 IF A$ = "N" OR A$ = "n" THEN A = 1 : RETURN
3560 PRINT "Don't understand your answer of ";A$; "."
3570 INPUT "Please enter Y for 'yes' or N for 'no.'";A$ : GOTO 3530
3580 '
3590 'Telegraph routine
3600 FOR I = 1 TO 4 : X = 1 + 3 * RND(1) : FOR K = 1 TO X : BEEP : NEXT K
3610 FOR K = 1 TO 500 : NEXT K : NEXT I : RETURN
3620 '
3630 'Warning beeper routine
3640 PRINT : FOR I = 1 TO 3 : BEEP : BEEP : FOR K = 1 TO 500 : NEXT K : NEXT I : RETURN
3650 '
3660 'Ready to go? routine
3670 PRINT : PRINT "Press any key when you're ready to go aboard."
3680 WHILE LEN(INKEY$) = 0 : WEND
3690 RETURN
3700 '
3710 'Pause routine
3720 FOR I = 1 TO 500 : NEXT I : RETURN
3730 '
3740 'Finished the race in Paris!
3750 FOR K = 1 TO 3 : GOSUB 3720 : BEEP : BEEP : BEEP : NEXT K : CLS : X = 0
3760 FOR I = 1 TO 30 : FOR K = 1 TO 100 : NEXT K : LOCATE 10, 30 : PRINT X$ : BEEP
3770 IF X = 0 THEN X$ = "CONGRATULATIONS!" : X = 1 : GOTO 3790
3780 X$ = "" : X = 0 : 'X$ = 17 spaces to erase congratulations
3790 NEXT I : PRINT : PRINT
3800 IF TD < TL THEN 3830 ELSE IF TD = TL THEN 3850
3810 PRINT "You made it to Paris! The German Protos beat you by"
3820 PRINT TD - TL "days but just to finish is a great honor!" : GOTO 3860
3830 PRINT "You reached Paris first! The next car is" TL - TD "days behind."
3840 GOTO 3860
3850 PRINT "You reached Paris in a dead tie with the French Motobloc!"
3860 PRINT : PRINT "You reached Paris in" TD "days. In 1908, the Thomas Flyer"
3870 PRINT "won the race reaching Paris on July 30 after 169 days." : GOTO 3970
3880 '
3890 'End of race and summary statistics
3900 PRINT : GOSUB 3630 : PRINT
3910 PRINT "Sorry you were unsuccessful. Only three of the"
3920 PRINT "cars in the 1908 race ever finished." : PRINT
3930 PRINT "In the" TD "days since the start of the race on February 12, 1908,"
3940 PRINT "you covered" INT(DC) "miles. You almost made it to"LA$(J + 1) ", ";
3950 PRINT LB$(J + 1) ". " : PRINT "Not bad, but you can do better." : PRINT
3960 '
3970 PRINT : INPUT "Would you like to try again (Y or N)";A$ : GOSUB 3530
3980 IF A = 0 THEN PRINT "Okay. Good Luck!" : GOSUB 3720 : CLS : RUN
3990 PRINT "Okay. So long for now." : GOSUB 3720 : KEY ON : CLS : END
4000 '
4010 'Subroutine to print the instructions
4020 CLS : PRINT TAB(18) "The Longest Automobile Race, 1908" : 1908 : PRINT
4030 PRINT " In this program, you are the captain of the Thomas Flyer team."
4040 PRINT "It is your job to get the car from New York to Paris—east to west—
4050 PRINT "as quickly as possible. The race starts on Febraury 12, 1908."
4060 PRINT " You must overcome many problems : bad weather, accidents,"
4070 PRINT "mechanical breakdowns, fatigue, and a lack of gas stations."
4080 PRINT " For each leg of the trip, buy as much gas as you need, but no"
4090 PRINT "more. You car gets approximately 14 mph, although this will vary."
4100 PRINT "You will carry what fuel you can and ship the rest ahead by rail to"
4110 PRINT "locations along your route to be held for you (called 'spotting')."
4120 PRINT " Your car has a top speed of 54 mph. However, the probability"
4130 PRINT "of a breakdown increases substantially at speeds over 35 mph. Like-
4140 PRINT "wise, driving more than six hours per day increases your chance of"
4150 PRINT "having an accident. But don't forget, this IS a race."
4160 PRINT " If you get stuck, you can pay someone to pull you out (costs"
4170 PRINT "money) or try to get out on your own (costs time)."
4180 PRINT " You can choose to repair a mechanical problem on the spot or"
4190 PRINT "wait until the next large town to get it fixed. Either choice has"
4200 PRINT "associated risks."
4210 PRINT " If and when you run out of money, you can wire Mr. Thomas for"
4220 PRINT "more, but your request must be carefully and politely worded Also,"
4230 PRINT "your telegram must be in all UPPER CASE letters."
4240 PRINT TAB(21) "Press any key to continue.";
4250 WHILE LEN(INKEY$) = 0 : WEND : CLS : RETURN

Return to Table of Contents | Previous Section | Next Section