In honour of the Raspberry Pi, I have rewritten an old program I first wrote over thirty years ago on a time-shared computer my school shared with every other school in Birmingham, using a 110 baud teletype.

History

Back in 1979 I was doing my A-level in Computer Science, and this was one of the programs I submitted. I wrote it on a 110baud teletype talking to a time-shared computer somewhere in the Birmingham Council Treasury department. As I left school, they took possession of a new Research Machines 380Z that the PTA had bought them for around £10,000. But, with only a longing glance over my shoulder, I got my A-level and proceeded to Manchester University. That's relevant because that is where the JMB exam board was based, which came in very handy when on registering for our courses we found that we did not have the right paperwork and had to queue up outside the JMB office to get it.

So I registered on the course and started lectures, and was introduced to the computer centre's computer. As part of that I was looking around to see what was there and how it was used and stuff. Imagine my surprise, when I found the program I had written, and sent to the JMB office just around the corner, was already on the computer!

After a few enquiries, it turned out that, in the intervening time between June and October, an enterprising pupil at my old school had converted the program to run on the 380Z and submitted it to a magazine. A staff member in the computer centre had seen it and reconverted it to run on the rather more impressive computer there.

I've not got the original listing unfortunately, so I've re-written it in Python.

Backstory

You fall down a pit into a dangerous dungeon. The dungeon is a grid of identical rooms, some of which contain monsters. It is dark and you start stumbling around. If you can survive long enough you can gather items to help you find your way out, some of the monsters are friendly and will give you stuff and if you can beat the evil ones you can take stuff off them, but as you work your way up and out, the monster become more evil and more difficult to beat.

In the centre of the dungeon is a deep well of healing water, but there is a cost.

The Code

You don't have to type this in if you don't want to; copy-and-paste if you must.

There are still a few bugs in there and there is plenty of room for enhancements. I've used BASIC style for the most part, except where I could not bear not to use objects, so it should be accessible to those of you who learned to program on the Spectrum or BBC Micro by typing in programs from magazines. There are no comments; there never were in the magazines.

There have been a few fixes. In fact I've just had to make a fix to let it work with Python 2.6, because that's what is on the Raspberry Pi. The if statement in line 101 (or wherever I've just made it move to) is valid Python.