***TL;DR:*** *Play my little game [here](http://gopher.judges119.me:70/labyrinth) for web users or at gopher://gopher.judges119.me:70/labyrinth for Gopher users.* ## Gopher I've written [some]({{< relref "/ops/2019-05-14-playing-around-with-gopher.md" >}}) [posts]({{< relref "/dev/2019-05-21-my-site-on-gopher.md" >}}) recently about the [Gopher protocol](https://en.wikipedia.org/wiki/Gopher_(protocol)) and how I've been exploring and playing around with it a bit. I don't know what attracts me to it so much, potentially just the simplicity of it, the relatively unknown nature of it across the modern web/dev crowd, or even just the desire to resuscitate a dead standard. Then one night I had a sudden brainwave while out to dinner with friends. The directory nature of the Gopher protocol makes it a perfect candidate for "Choose Your Own Ending" style books. While Gopher is commonly used in a hierarchical fashion as an information retrieval protocol, there's nothing to stop you making it more of a graph structure, which would be perfectly suited to a story with branching endings. ## Build To prove out my hypothesis, I decided to build a little labyrinth, using a [maze generator](http://www.mazegenerator.net) I found online to generate a 5x5 maze. I then assigned coordinates to the maze, using "00" as the top-left and "44" as the bottom right, with the first digit being the x-axis (right) and the second being the y-axis (down). The Gopher daemon I'm running ([PyGopherd](http://gopher.quux.org:70/devel/gopher/pygopherd)) uses a file called "gophermap" for the index of a folder (much like index.html is for many HTTP/HTML web servers). So I created a folder for each coordinate, and in that a `gophermap` file in which I put the story text as well as instructions (such as "North", "East", "Take laser blaster"). Some areas have subfolders, which apply to actions taken within a particular coordinate/room/area. ## Play I've also made the game available to play publicly [here](http://gopher.judges119.me:70/labyrinth) for web users or at gopher://gopher.judges119.me:70/labyrinth for Gopher users. It's very short, with a defined start and end, but was mostly designed to prove out a concept. ## Next The game successfully showed that you can do some forms of interactive fiction within the Gopher standard, which is fantastic because I want to explore this more. Although this game was more location based (with commands to move location), I want to work on building something more story/choice based, so the branching links are you choosing different actions. Future **future** goal is to find some way of using the "full text search" function of the [Gopher standard](https://tools.ietf.org/html/rfc1436) to potentially take user input, allowing people to play a full text adventure game from the safety of the gopher console (or web browser).