Turbo Pascal Text Adventure Primer cover: BEACON, the adventure the primer builds in Turbo Pascal 2.0, mid-game on the Tatung Einstein
course · new for 2026

Turbo Pascal Text Adventure Primer

The TatungBytes logo
TatungBytes

A text adventure is almost nothing but text. The player types a sentence; the program has to read it, take it apart, recognise its words, and answer with a paragraph of prose, again and again, on a machine with very little memory to spare. This primer takes that one subject and goes deep, in Borland's Turbo Pascal 2.00A on the Tatung Einstein.

It follows on from our Turbo Pascal course. It does not teach the language again; it assumes the menu, the editor, records, files and procedures, and says which section of the Turbo course to look back at when it leans on one.

What It Is

Every job a text adventure does with words is done here two or three different ways, side by side, and each is measured on the Einstein: reading the command with Readln and with a line editor of your own; splitting it into words with Pos and by walking the line; recognising words whole and by their first letters; turning them into numbers; finding them by a straight search and by a binary search; storing the game's prose in the program, in a text file, in a file of records reached with Seek, and squeezed, three letters to every two bytes or with common words replaced by single codes. You see what each costs, in seconds, in bytes of memory and in disc space.

Then it opens up three real adventures from the TatungBytes library, Zork, The Hitchhiker's Guide to the Galaxy and Alice and the March Hare, and shows how their authors did the same jobs: one Infocom program shared by four stories, text packed into five-bit codes, a dictionary that keeps only six letters of every word, a story read from the disc as you play; and SYNTAXSOFT's plain text and word list with a number beside every word. A dozen lines of Pascal rebuild a Zork dictionary entry byte for byte.

It all goes into BEACON, a twelve-room adventure of your own: shipwrecked below a dark lighthouse, with a ship heading for the rocks. It reads its world from files on the disc, understands sentences like UNLOCK THE DOOR WITH THE KEY, and is built a section at a time from the best of each technique, ending as a program that runs on its own.

Twenty-two sections and five appendices, each section with the code to type, what you should see, single changes to try, exercises with tested answers, and the failures we actually hit. It is written for both a real Einstein and MAME.

What You Need

MAME, the Einstein ROM, and the Text Adventure Primer Disc, which carries Turbo Pascal 2.00A set up for the Einstein, BEACON finished, and the files its world lives in, so you never type the game's prose. If you are new to the emulator, the Turbo Pascal course's second section sets it up.

How It Was Made

The same way as our other courses. Nothing here is taken from a later Turbo Pascal or from what is written elsewhere about these games: every string routine was tested on Turbo Pascal 2.00A, and everything said about Zork, Hitchhiker's and Alice was read off their own discs or seen by playing them. What is written about Infocom's format was treated only as something to test; where a test could have come out differently and did not, it is in the primer, and where none was run, it is not. Every listing, change and worked solution was compiled and run before it was written down. The primer was written and checked under emulation; if you follow it on a real Einstein we would like to hear what differs.

This primer was written with Claude Code, directed by Gavin Watson. We say so openly because we think it is the right way to use these tools, and because you deserve to know how the thing you are learning from was built.

Get the Newsletter

New guides, disk images and community finds, roughly once a quarter. No spam, we promise, this isn't Tatung's marketing department.
Your subscription could not be saved. Please try again.
Your subscription has been successful.

Newsletter

Subscribe to our newsletter and stay updated.

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.