Turbo Pascal Text Adventure Primer cover: BEACON, the adventure the primer builds in Turbo Pascal 2.0, mid-game on the Tatung Einstein
← Back to Modules
module
22

Where You Go From Here

Introduction

That is the primer. You have a twelve-room adventure written by you, which reads its world from the disc and runs on its own from the 0: prompt. More than that, you have tried every job it does with words in more than one way, and measured each on the machine.

What You Found Out

  • Turbo's own string routines beat loops written in Pascal. Splitting with Pos, Copy and Delete took 3.3 seconds for 500 lines, walking the line 5.3.
  • The Einstein's DELETE key does nothing at a Readln, and a line read a key at a time can do far more: capitals as you type, only the characters you want, never too long.
  • First letters forgive, whole words never confuse. Zork kept six letters of every word; Alice and the March Hare kept whole words and added short ones as synonyms.
  • A sorted table is found in a handful of comparisons: seven for 121 words, where reading straight down took 121.
  • Text in a program costs a byte a character, twice over. In a text file it costs a wait; in a typed file with Seek, disc space.
  • Squeezing text works and costs time. Three letters in two bytes saved 30 per cent of BEACON's text, common words 21 per cent, and each took over half a second to undo for a long message, in Pascal.
  • And the real games chose. Infocom packed everything and read the story from the disc as it went; SYNTAXSOFT kept it plain.

What The Primer Left Alone

  • Saving a game in progress. BEACON's state is a room number, six places and five flags: a record, and a typed file of one record would keep it.
  • Objects inside objects, the lantern in the boat, the matches in the cupboard, as true containers rather than hidden places.
  • IT and ALL: remembering the last noun, and taking everything in the room.
  • Several commands in one line, separated by THEN or a full stop.
  • Untyped files and BlockRead, which read 128 bytes at a time straight into memory: the way to read a file of your own design a piece at a time.
  • Packing in machine code. S14's unpacker was slow because Pascal built the string a character at a time. The Turbo course's S39 showed inline machine code; an unpacker written that way would be another matter.

Your Own Adventure

BEACON's world is BEACON.TXT. Copy it, change the rooms, the exits and the messages, and run MAKEDAT: you have a different island, and the program has not changed. To go further, the words, the things and the puzzles are each in one place in BEACON.PAS: the table at the top, Start, and the verb procedures. A new puzzle is a new flag, a message or two in BEACON.TXT, and a few lines in the verb that sets it and the one that tests it.

Where Next

  • The Turbo Pascal course, if you came here first.
  • The BBC BASIC course builds an adventure too, DRIFT, in four rooms on a drifting spaceship: the same kind of game in another language.
  • The Z80 assembly course, for the machine underneath, and the speed that the unpackers in S14 and S15 wanted.

Thank you for reading. If something in the primer is wrong, or did not work on your Einstein, please tell us through the contact form on the site, and we will put it right.

Summary

Every job a text adventure does with words has more than one answer, and on the Einstein the answers can be measured. You measured them, and built a game from the best.

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.