Tays house adventure deciphered

The Calormen website provides an online Applesoft BASIC emulator developed in javascript. You can enter or upload your code into the emulator and run it immediately, without needing to install an emulator on your PC. The website also offers many examples of Applesoft BASIC source code, including games and graphic demos.

Among these programs, I found a text adventure game called Tays House Adventure, developed by Floyd McWilliams. The goal is to find treasures while avoiding traps in the house of your obviously mad Uncle Tays. While the concept itself is not very original, what really caught my attention was the way the BASIC program was written; all character strings are encrypted, preventing a hacker – or a curious player – from inspecting the source code to crack the game.

For example :

To better understand how the game works, I wrote a Python program that decrypts all the character strings and outputs a BASIC program in which everything is readable. The goal is to obtain a clean Applesoft BASIC program with no encrypted data.


Go to the emulator page, ans select the Text Adventure (Floyd McWilliams) program. You can download the source code using icon.

I had to correct the program using Visual Studio Code, as the Applesoft BASIC extension reported several errors, such as invalid variable names and line numbering issues. Here is the fixed version of the program::

Below is the Python program that processes the BASIC source file and decrypts all strings.
The decryption routine is located at line 10000 of the original BASIC program, which made it fairly easy to translate this part into Python.

Once extracted, the Python script can be used as follows:

The deciphered BASIC listing is displayed on standard output by default, unless you specify an output file using the -o option.

Here is an extract from the output file :

The decrypted BASIC program still needs a small adjustment: the decryption code must be removed from subroutine starting at line 10000:

The fully decrypted and working version of Tays house adventure can be downloaded here :

You can now play Tays House Adventure on a real Apple II or on your favourite emulator.

Additional ressources about the game can be found here :

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *