I’ve always been a fan of Zork. If you’ve been playing games awhile (and I mean a whiiiile) then you probably are too. For those of you who aren’t familiar with it, its the original text adventure game. No graphics. Just type actions, and get text feedback. It created the whole genre of Interactive Fiction. You can actually still play it online
Recently I was on vacation and looking for a project and happened to spot Eric Lippert’s blog series describing his implementation of the Zork engine (called a ZMachine) in order to learn OCaml. I realized he was deciphering the mess that is the ZMachine spec that had always seemed a bit opaque to me. Its a seriously interesting bit of engineering to make an actual cross platform virtual machine that ran on the old Apple II TRS-80, Commodores, etc in the 80s. But a lot of their optimizations make for dense and confusing bit twiddling.
I got inspired and started building my own version in C# in an object oriented fashion with current C# techniques and libraries and unit tests.
Mine is called Leaflet and I just put it up on GitHub and will be updating it slowly. I have some oddball plans to see what I can do with this and still make sense. As an example, a while back I did an experiment with someone else’s implementation by adding Cortana’s voice recognition and Text to Speech to make it work on my Windows Phone.
Its a .NET PCL (will run on Azure, Windows, and Linux!)
Its not optimized… yet
Its object oriented.
Its very much in progress…
I plan to write a series of posts here on some of the things I’ve learned along the way.
maybe someday I’ll revisit and reimplement it in F#.