Archive for the ‘magic-caves’ Tag

Magic Caves (1977)   Leave a comment

It’s been a while since we’ve gotten this deep into the past; 1977 is the same year as Crowther/Woods Adventure and the first version of Zork. However, the year is clearly displayed on the first line of the BASIC source code we’re dealing with today:

0010 REM @ COPYRIGHT 1977 JOHN B. TRENHOLME

This is another obscurity unearthed by gschmidl (he downloaded it way back in 1999 and it had been lurking amongst his old files), and there was no indication what kind of computer this was even for. It turns out to be for a very specific form of BASIC. To explain, I’ll need to take the story a little further back—

A 1974 picture of Jorge González Martén from La Nación. Source.

Jorge González Martén was born in Costa Rica in 1926. While he went to Mexico for secondary school with plans to go on to medical school, his plans didn’t work out, and in the same year WWII ended he went back to Costa Rica to work for United Fruit. This is where he had his first encounter with an IBM computer (with businesses this was the mechanical punch card era; while IBM had already built the Mark I in 1944 it was for defense/scientific research). Despite not being electronic, this was enough to spark an interest in computers, and he studied the devices intensely, becoming head of the Mechanized Technical Office at the National Bank of Costa Rica in 1947. This let him get his hands on the full suite of IBM punch card devices.

Feed unit schematic, from a 1953 operation manual for an electromechanical IBM 407.

In 1951, Martén had the opportunity to participate in a scholarship program instigated by Harry Truman two years before; a few people from Costa Rica were selected and he was able to go to George Washington University to study electromechanical machines, getting experience with government, finance, and the automotive industry and their use of computers. Afterwards he moved back to Costa Rica, but Walter Oreamuno (another Costa Rican who worked for a time alongside Martén) convinced him to move back to the United States to be a consultant for IBM.

Walter Oreamuno, from a 1969 Forbes story.

Their stay at IBM didn’t last long, as the duo decided in 1955 to split off and form their own company. Management Assistance Inc. (MAI) was established in New York City, with Martén as president. From there they set up global operations, starting in Costa Rica, Mexico, and South America generally, but moving through Canada and Europe as well.

The twist of fate that set them on the eventual route to our target (the unusual species of BASIC) was in January 1956, when a New York judge ordered IBM that they had to end their practice of lease-only with their machines. Essentially, IBM’s power over tabulation machines (both mechanical and digital) was tantamount to monopoly force, and the ruling was intended to improve the competitive environment (it was only removed in 1996).

Oreamuno and Martén realized they could now set up a business where they went to companies leasing IBM hardware, buy the hardware outright from IBM, then lease it back to the original company at lower cost than IBM. Quoting from Forbes from 1969:

The arithmetic was perfect. IBM was depreciating its equipment at such a rapid rate that MAI could buy used IBM punch-card equipment for as little as 25% of the original price. It could then lease them at far less than IBM was charging. IBM charged just as much for ten-year-old equipment as it did for two-year-old.

The company’s concept held as long as the conditions above held. MAI managed to get enough financing to get the scheme going, and the duo managed to score a gigantic profit.

Bulging with cash, Oreamuno bought every piece of IBM punchcard equipment he could. In a few years revenues soared from $4 million to over $40 million, earnings went from a deficit to a $2.1-million profit. By the time White Weld brought out a stock offering in early 1965 and again in 1966 MAI stock had soared to $36 from $4 in 1963.

The problem with the business was: what if rather than gradual obsolescence, IBM products had sudden and complete obsolescence? While MAI was still buying punched-card equipment, IBM was busy developing digital computers, and the System/360 in particular was getting to the point where businesses were willing to change over. MAI was originally not worried (being an international company, and other countries being slower to adopt cutting-edge technology) but by 1967 they became stuck with enough unsellable mechanical punch card product that they had to do tax write-offs and refinancing to stay afloat. By 1969 they were on the verge of bankruptcy.

MAI in 1969, from Forbes. Shipping units for lease on the left, returned units on the right.

However, this happened to be right when the minicomputer boom was starting (see my writeup on Thissala and Data General for more) and González Martén (still president) asked the board of directors permission to develop a minicomputer. This was a heavy risk but MAI was still a large company and potentially able to handle it. Martén ended up leaving the company for Costa Rica (presumably in frustration) before funding was wrangled together, but Oreamuno managed to finish securing the money and talked Martén into coming back.

1973 MAI newsletter, via Bitsavers.

Hence, the development of what would be dubbed the Basic Four with Martén in charge of design, with people from MAI and Silicon Valley. This swerve saved the company, which broke off their own Basic Four division, and announced 500 installations by 1973. (After finishing the initial design, Martén retired from the company for good, using his earned millions to go into politics in Costa Rica.)

1975 ad, from Facebook.

By 1975, the division made two-thirds of the company profit.

(In the TV ad above, notice how it distinguishes between “too big”, mainframes where “you’ll pay a big price”, and too small, where “you’ll just be playing games”. Part of the reason business computers lasted over personal computers — for a while, at least — was the impression that the product category was frivolous.)

By 1977 Basic Four machines were still quite hot with businesses; MAI had 40% growth every year from 1975 to 1979. The main extra gimmick was the accounting-oriented BASIC (called Business Basic) with custom features (essentially: what if COBOL, but BASIC format instead). Competitor Data General made their own Business Basic and based it off MAI’s. Back to that Magic Caves source code, let’s consider the next two lines:

0015 PRECISION 9
0020 PRINT ‘CS’,@(15),”*** THIS IS THE MAGIC CAVES GAME ***”,’LF’

PRECISION is a very MAI Business Basic specific command, and it’s meant to set the decimal precision being used (even Data General’s Business Basic doesn’t use it). This is the sort of thing hobbyists of the 70s generally didn’t care about but accountants did. (Keep in mind also, MAI went straight from old-school punch card mechanical machines to building the Basic Four.) Another example from a MAI Business Basic manual:

PRINT output expr:”###,##0.00+”

This allows built-in digit-placement meant for accounting purposes (# is filled with “0” if unused). PRINT also allows for arbitrary position skips; going back to the Magic Caves source, it includes…

PRINT @(32),”Quit”,@(45),”(e)Xamine caves”

…which jumps to column 32 and then column 45 to display the two pieces of text. This is built-in due to the common need for financial layouts.

The author, John Burgess Trenholme, was not a businessperson at all but rather a scientist. In the 60s he worked on a doctorate in material sciences with CalTech, taking a year in the middle to go aid in the founding of the Indian Institute of Technology at Kanpur:

During graduate school, he spent a year working in India to set up a low-temperature laboratory at the Indian Institute of Technology. John’s wife Keren describes this as a deeply meaningful experience that changed how he viewed the world and his relationship with other people. After India, John journeyed around the world before returning to Cal Tech. He enjoyed meeting people and developed an understanding of the complexities of other cultures.

His 1969 doctoral thesis was SUPERCONDUCTING PROXIMITY EFFECT CURRENTS IN INDIUM ABOVE ITS TRANSITION TEMPERATURE and in 1972 he joined the famed Lawrence Livermore National Labs, producing over 60 research papers mainly focused on lasers before dying in 2020.

The Shiva Laser at LLNL, which went online in 1977. Public domain via Maxine Trost. This was used for a background in Tron.

For our purposes: sometime, in 1977, he saw Adventure. He also (based on references you’ll see shortly) was familiar with both Wumpus and Caves from the People’s Computing Company. He decided to combine them together into one program; this is as close as a “missing link” sort of game we’ve seen here. While Zork had an outright Wumpus reference, and the Wumpus makes an appearance in the David Long variants of Adventure, Magic Caves not only makes references but resembles Caves/Wumpus in gameplay. The only other analogy game I can think of is Treasure Hunt from 1978.

I have a download of the original BASIC and a Windows executable here. Note that some bugs (potentially coming from a bad data transfer) have been fixed, but other authentic bugs likely remain. Any typos you see are authentic.

*** THIS IS THE MAGIC CAVES GAME ***

While wandering through a deep forest, you come upon an old man, who tells you of a nearby series of caverns with fabulous treasures, but also fearsome dangers. “Many have entered to get rich,” he says, “but few have returned.” You decide to go in. He tells you as you set off, “They say that magic works down there.”

I will act as eyes, hands and feet for you. Just tell me what to do, and I will obey. However, I am not very smart, so only tell me one or two words at a time; I really only read the first letter of each word. The action words I know are:
Drop (thing)    Help            Move (way)      Use (thing)
Get (thing)     Inventory       Quit         (e)Xamine caves
For example, to move downward, say Move Down or M D (not MD).
You can acquire or give up things with get and drop. You use a thing to defend yourself. Don’t G, M, OR U dangerous critters.

The game asks you to give a seed (the map is randomly generated) and a level of difficulty (from 0, easy, to 100, difficult).

*** You are in cave 1
This is the entrance pit. Above is daylight, but in all other directions it is dark.
A flickering oil Lamp burns dimly.
Move 1 – Score 0 – Your command? g lamp
Ok
Move 2 – Score 0 – Your command? m n
*** You are in cave 28
Slippery mud makes the footing treacherous.
A piece of hard, grey Flint is here.

The game always starts you at the entrance pit with a lamp, but all rooms and objects after are randomly placed. The goal is to get as high a score as possible from finding treasures. From the source code, where S9 is the score:

7040 IF S9<0 THEN PRINT "Better luck next time!"; GOTO 7100
7050 IF S9<1000 THEN PRINT "You need more practice."; GOTO 7100
7060 IF S9<2000 THEN PRINT "You did pretty well!"; GOTO 7100
7070 IF S9<2500 THEN PRINT "You're really very good!!"; GOTO 7100
7080 IF S9<2800 THEN PRINT "You did a fantastic job!!!"; GOTO 7100
7090 PRINT "That's the highest possible score!!!!"

Hitting 2800 (the max score) will immediately take you to the end-game display. Oddly, there is no need to return to the start and escape; in fact, if you try to go up from the start, you are informed:

This isn’t a forest game.

Part of a map from Caves (PCC May 1973). Both Caves and Wumpus always gave cave numbers like Magic Caves, but they didn’t have room descriptions (except for The Public Caves where people could add their own).

If you type H for help, a “tall wizard” offers to teleport you to the start for a cost of 100 points.

Move 40 – Score 300 – Your command? help
A tall wizard with piercing eyes appears in a puff of green smoke. Hey says, “I can whisk you out of here, but it will cost you 100 points.”
Do you want to go? y
*** You are in cave 1
This is the entrance pit. Above is daylight, but in all other directions it is dark.

It took me a while to realize this is simply the treasure-deposit spot; you get 50 points for finding a treasure (not picking it up!) and 100 for depositing it here. Curiously, more valuable than treasures are the monsters throughout the complex, which give 200 points each for being killed. So the treasure is almost a side-quest to clearing out the enemies, and the best way to play is to ignore the treasure at the start and scoop it up after everything is cleared out.

Below is the map of my first playthrough, difficulty 10:

Seed 99. It’s possible I missed a room or two, my apologies if so, I scrounged carefully but you need to test n/s/e/w/u/d in every single room.

A sample of combat:

Move 128 – Score 400 – Your command? m s
*** You are in cave 21
there is a deep fissure in the center.
A big black snake tries to wrap you in its coils!
Move 129 – Score 400 – Your command? use wand
Red smoke flows from the wand and surrounds the snake!
There is no effect on the snake!!!
A big black snake tries to wrap you in its coils!
That was close! The snake almost got you!
Move 130 – Score 400 – Your command? use axe
You swing the bronze axe at the snake!

Congratulations! You killed the snake!

Enemies have “matched” weapons; if you get the right match, you will win 100% of the time at a combat, and even if you don’t match, you still will have a chance of winning. Weapons are an axe, a bird, a flint, a knife, a ring, a sword, a toad, and a wand, and if some of those seem strange, keep in mind the command is “use” and these are the messages for each item:

8060 PRINT “You swing the bronze axe at”,; GOTO 8140
8070 PRINT “The little bird darts forward and pecks”,; GOTO 8140
8080 PRINT “The flint hits a rock; sparks fly onto”,; GOTO 8140
8090 PRINT “You thrust your knife toward”,; GOTO 8140
8100 PRINT “Blue light springs from the ring onto”,; GOTO 8140
8110 PRINT “You swing your sword straight at”,; GOTO 8140
8120 PRINT “The toad’s long tongue darts out to hit”,; GOTO 8140
8130 PRINT “Red smoke flows from the wand and surrounds”,; GOTO 8140

The game seems to have the concept of “appropriate matchups” but I wasn’t fully able to puzzle out the system. At one point, I faced off against a pirate and only had a wand and axe…

*** You are in cave 16
You must crawl under a low roof over cobbled stones.
‘Magic word QENSA’ is carved on the wall here.
A bearded pirate swings his cutlass at your head!
Move 147 – Score 700 – Your command? use axe
You swing the bronze axe at the pirate!
There is no effect on the pirate!!!
A bearded pirate swings his cutlass at your head!
AAARRRRRGGGHHHHHHH!!!! The pirate got you!

Unfortunately, you are now dead.
As a result, your score is 400.

I can reincarnate you, but it will cost 100 points.
Shall I do it? yes
*** You are in cave 1
This is the entrance pit. Above is daylight, but in all other directions it is dark.

…but the actual correct weapon (as I guessed correctly, although I had to check in source later to confirm) is a sword. This meant I won round 2:

You swing your sword straight at the pirate!

Congratulations! You killed the pirate!

The word QENSA inside the room means you can SAY QENSA and teleport there right away; it’s most of the way through the map so it lets you save some time (although if there’s an enemy there, it gives them a shot at hitting you!)

After clearing out every enemy I toted all treasures I could find back to the start, giving me a total of 1450 points (“You did pretty well!”). I gave another shot at difficulty 40. I wanted to try a deathless run this time for the possibility of a max score. I planned to leave all treasures behind at first and only pick up the “weapons” until everything was clear. Unfortunately…

…I discovered something new that could happen while playing.

*** You are in cave 22
Lacy curtains of stalactites hang down
from the ceiling on all sides.
A shimmering Opal reflects the light.
Move 115 – Score 350 – Your command? m s
In that direction there is a deep, dangerous pit.
Move 116 – Score 350 – Your command? m e
*** You are in cave 33
Everything is covered by a thick dust layer.
A jewel-studded Crown is on the ground.
A big black snake tries to wrap you in its coils!
AAARRRRRGGGHHHHHHH!!!! The snake got you!

Unfortunately, you are now dead.
As a result, your score is 100.

You can die immediately upon entering a room. There’s no “armor” or the like so this is just a “slot machine” scenario; you sometimes will just die. (Certainly something considered reasonable in 1977!) I stopped there and decided for one more try, cranking the difficulty down to 20.

Unfortunately, I died even quicker this time. I took a strategy of toting the treasures back upon spotting them (knowing the way is clear, I can get at least some points) figuring as I got later in the game with more weapons I would wait on the rest. I got a wand early which had done well against spiders I had faced before, but this time, the “hug spider” decided to ignore it.

*** You are in cave 34
A hug spider web is strung overhead.
A piece of hard, grey Flint is here.
A monstrous spider spins a sticky web toward you!
That was close! The spider almost got you!
Move 72 – Score 600 – Your command? use wand
Red smoke flows from the wand and surrounds the spider!
There is no effect on the spider!!!
A monstrous spider spins a sticky web toward you!
AAARRRRRGGGHHHHHHH!!!! The spider got you!

Unfortunately, you are now dead.
As a result, your score is -100.

The intent here really is meant to be more on the Wumpus end of the spectrum, with multiple replays and trying to beat a previous score rather than allowing for a sure-fire procedure. This is hence more of a quasi-adventure or strategy game, but clearly is riffing off original Adventure (“I will act as eyes, hands and feet for you”) with a foot in the past. Crowther/Woods was such a strong model to follow that most late-70s authors jumped directly to that design instead of trying to make a hybrid.

Coming up: the unexpected relationship between British Mensa and football management simulations.

Posted November 19, 2026 by Jason Dyer in Interactive Fiction, Video Games

Tagged with