Tays house adventure deciphered

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 having an emulator installed on your PC. You can also find on the website numerous examples of source code in Applesoft BASIC, such as games and graphic demos.

Among these programs, I’ ve found a text adventure game called Tays House Adventure developed by Floyd McWilliams. The aim is to find treasures while avoiding traps in the house of your obviously mad Uncle Tays. Nothing very original, but what caught my attention was the way how the BASIC program was written; all character strings are encrypted, to avoid a hacker/player inspecting the source code to crack the game. For example :

So I wrote a program in Python that decrypts all character strings and returns a BASIC program where everything is readable. The aim is to obtain an Applesoft BASIC program with no encrypted data.


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

I had to correct the program thanks to Visual Studio Code, since Applesoft BASIC extension displayed several errors: invalid variable names and line numbering errors. Here is the program fixed:

You can find hereafter the Python program that go through the previous BASIC program and decrypts all strings. The subroutine located on line 10000 of the BASIC program performs the decryption so it was easy to translate this portion of code into Python code.

Once untared, the Python program is to be used as follows:

The deciphered BASIC listing will be display on standard output, unless you specify the output file with -o option.

Here is an extract of the output file :

The deciphered BASIC program needs to be tweaked slightly, by removing the decryption from subroutine located from line 10000:

The decrypted and operational Tays house adventure program can be downloaded here :

Now you can play Tays House Adventure on your Apple II or your favourite emulator.

You can find some ressources about this game here :

Laisser un commentaire

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