As a way to continue to learn/improve/update my python skills I decided to return to my teen years and port a very small, not very good, text adventure that appeared in Issues 9-13 of the Input magazine.
Unlike this person I didn't get to buy these magazines from the new agent and experience the thrill of getting one every week as at the time of our household didn't have a computer. I know this paragraph speaks to a very different time.
It wasn't until late '87 did a computer enter our household. Soon after that I discovered coding in Amiga Basic. It was a terrible language, I am not sure I noticed the difference between what you could do with it compared with what professionally programmers could do with an Amiga 500 (that is people not using Amiga Basic). It was however the language that pulled me in, later Amos Basic allowed me to progress onto better things.
This was a time of no internet and my parents where not going to spend money on books about this obscure interest. They did have a friend who had purchased most of the Input magazines and offered to pass them. Until you no longer live it you really don't appreciate how information scarcity can hold back your development. I really didn't know what I didn't know. The Input magazine helped as they developed many different types of programs. All I had to do was understand the printed code meant for 8-bit computers and port it to Amiga Basic.
To be fair my parents did buy me some Amiga magazines including a few non gaming ones like Amiga Shopper. Probably if I had known which books and nagged enough I would have been able to get at least some information. Getting hold of a C-compiler or something like that would have been impossible.
As a child/teen I spent a great deal of time understanding and porting the text adventure listings. For a long time writing a text adventure was one of my go to problems when attempting to learn a new programming language. So why not enjoy the nostalgia and port it one more time.
It is not a faithful port, I added text in certain places but kept the descriptions as faithful as possible.
The code is here. I was going to put it up on github but really was not sure how I feel about the whole CodePilot issue floating around now, where Microsoft is using code on github in a way to drive profits. I may end up moving away from github, and a goal of this site is to be fairly permanent record, independent of changes in the web that happen over time.
The goal was to get familiar with optional typing, Enumerations and
decorators. I eventually moved away from decorators to register commands
you can type to a simple match
statement. Yep it is not
quite as cool but I was not trying to create a generic text adventure
engine, just a specific one. I guess it let me easily see what single
letters had already been used. A small bit of code in the decorator
function could have validated that with ease as well.
It is not great python but on the road to write lots of python code to burn it into my head it was not a bad 600 lines.
It was also fun to revive the memories of the past.
I consider the code in the public domain, so please enjoy the mess I have created!