Having a "Choose Your Own Adventure" style game for readers to look at was suggested to me, so I quickly wrote one up. The code is designed to be very simple, despite its length. There is no accompanying chapter, but I do provide a short description page.
The source code:
The description page:
These links are also on the Extras page on the main site.