# Let's play Zork

> Source: <https://www.dpolakovic.space/blogs/zork.html>
> Published: 2023-11-24 20:00:00+00:00

## Let's play Zork

*24 Nov 2023 - A hollow voice says "Fool".*

Recently I saw a rerun of The Big Bang Theory on TV. It was quite refreshing
since I don't rewatch any series, with the only exception being Black Books.
One of the aired episodes that day was the one
where Sheldon mentions playing a buggy beta version of Zork[[*](#notes)].
Suddenly, I remembered that I wanted to try out this old text adventure since
I watched the episode back in 2010 or so. I considered it super weird then
to play videogames without the... well, video part. But I played many tabletop
RPGs since, so I am now well aware of using imagination as a game mechanic.
And I've seen Zork appear many times on online forums and even in Call of Duty
Black ops which I played on Xbox360.
So I assume this rerun was the last straw and the "call to
adventure" I was waiting for. Let's start with preparation for the descent.

Firstly, we will need to
[obtain the game](https://eblong.com/infocom/#zork1)
and
[the manual](http://infodoc.plover.net/manuals/zork1.pdf) might
also come handy. (If you already have ZORK I, you can
[jump here](#play).)
For enjoyers of adavnced LISP, I include source code
for the
[Infocom version](https://github.com/historicalsource/zork),
[MIT release](https://github.com/MITDDC/zork)
as well as the
[mainframe versions](https://github.com/heasm66/mdlzork).
And in order to actually use game files, we will need package *frotz*.

```
	  sudo apt install frotz
```

Frotz is licensed as free software under GPLv2+ but you won't find it in the Free software directory. I tried to contact its maintainer David Griffith about this issue, but recieved no answer so far. But the frotz source code is available[here](https://gitlab.com/DavidGriffith/frotz)for every Z-machines enthusiasts which favors Graham Nelson's specification standard 1.0.

Anyway, we will use frotz interpreter to run the game files.
Don't forget to use the full path to the directory where you downloaded or moved
the game files. A *Games* directory at the home might be a good idea.

```
	  frotz ~/Games/zork1-r88-s840726.z3
```

We can also make an alias in your*.bashrc*file to start the game from everywhere. Or... we can unleash our inner hacker and create a bash script that will run any version of Zork we downloaded simply by argument.

``` bash
	  #!/bin/bash

	  # Define a dictionary of aliases
	  declare -A dictionary=(
	    ["r2"]="zork1-r2-sAS000C.z1"
	    ["r15"]="zork1-r15-sXXXXXX.z2"
	    ["r88"]="zork1-r88-s840726.z3"
	    ["r52"]="zork1-invclues-r52-s871125.z5"
	  
	    # You can add more zork versions here
	  )
	  
	  # Check if the correct number of arguments is provided
	  if [ $# -ne 1 ]; then
	    echo "Usage: zork "
	    exit 1
	    # Or we can hard code any version to be default e.g.
	    # cd ~/Games/ && frotz zork1-r88-s840726.z3
	  fi

	  # Check if alias exists in the dictionary
	  alias="$1"
	  file="${dictionary[$alias]}"

	  if [ -z "$file" ]; then
	    echo "Zork version '$alias' not found."
	    exit 1
	  fi

	  # Cd to your directory where you store the game files
	  #
	  # note:
	  # you could use full path to file with frotz command
	  # but your saved game files would be then stored at ~
	  cd ~/Games/

	  # Profit!
	  frotz "$file"
```

In order to run this script from everywhere in our file system, we will save it under name*zork*(without ".sh") and move it into our bash PATH. For me it will be

*~/.local/bin*. After that we will need to "chmod-ex" our script to make it executable.

```
	  chmod +x zork
```

And now we can run any version of Zork we like by using the release number of desired version as argument for our script.

```
	  zork r52
```

This script can come in handy as different builds have different bugs
and command responses. The first two versions (r2 and r5) will teleport player
to a random location when a nonsense travel command is given, like GO WALL
or GO TREE. In all versions except for *solid gold* (r52) you can
pour water from the bottle even if the bottle isn't open. And every version
suffers from EXAMINE OVERBOARD problem. You can check the full list of differences
in
[Infobugs](http://graeme.50webs.com/infobugs/zork1.htm) and
[Microheavens](https://www.microheaven.com/InfocomBugs/zorki.shtml)
zork sections. Exploiting those older buggy versions sounds fun and I, as
a real adventurer, picked up release r15 the "Hack of 15.UG3AU5" version.

The game itself is pretty straight forward. Our adventure takes place
circa 300 years after the fall of the Greatest Underground Empire, and we
take the role of nameless adventurer seeking fame and fortune in the ruins
of the once unmatched empire. The manual explains that the game is played by
typing commands and awaiting the response from the game. It is basically a
Read Eval Print Loop with a complex parser and a score system. And just like any
REPL, Zork counts your lines - in this case, commands or actions. The goal is
to retrieve treasures and *put* them into the *trophy case*
with the least actions possible. The more we return, more we score. The manual
gives no information on how many treasuers are out there or if we lose
when we waste too many turns. However, it mentions five times to draw a map
as we play, so I will.

*Let's play.*

*wooden door with strange gothic lettering*in the living room of the house, which is worth looking into. I will leave this intentionally blank. It is time to move elsewere.

I found a canyon to the east of the house, so I went there.
I arrived at the canyon view and continued to the west through
the forest. I stopped next to the big tree with suspiciously looking
lower branches. This is a hint. After climbing the tree, I found a bird's
nest with a jewel-encrusted egg. What a luck! I grab it and run with it to
the trophy case before it's *rightful owner* comes for it. (I have
a feeling that it is not the bird.) On my way back I got lost a little in
the forest, but somehow I appeared in the clearing behind the house. Jumped
through the kitchen window, spent some time (turns) trying to *put*
the egg jewel into the trophy case and... Success! First treasure
collected, 10 score earned, totaling on 20 right now.

So far so good. The forest on the east had a few more roads to go, but I am
not sure if I got lost because of some glitch or if the forest was too thick.
Either way, I exit the house and march to the west this time.
*One hundred moves later*... Dead end, just like the canyon on the east
and forests on the north and south.
I am going back to house to regroup and look for more clues. After further
examination of the house, I see only a chimney in the kitchen and a rug in the
living room. I bet on a rug as it nicely ties the room together.
"With the rug moved, the dusty cover of a closed trap-door appears."
I hastily open the trap-door and descent into the darkness. The score jumped
to 25 points.

With someone's help, the trap door closes above my head. I am in a dark cellar and
the ancient sword starts to glow a little. Tension rises. As I put my foot in
the room to the north, a nasty-looking troll blocking my way out. First enemy
encounter. The troll seems to be wielding an axe and my sword glows very brightly now.
I charge the troll, but he nimbly jumps away and reaches me with his ax.
The game responds with *Ouch!* so I assume it is just a flesh wound...

Never mind I restore the game, enter the room again and after a long fight troll dies with another swing of my blade. As soon as he breathes his last breath, his body disappears in sinister black fog and my sword is no longer glowing. My score is 45 now, but as I try to lift his blody axe, I realize my inventory is full. I'll stick with the sword.

As I look around, I see labyrinth to the west and a long passage to the east.
I try to circle the cellar I came from, which leads me to the Mirror room. In it, there
is only a mirror which seems to be responding to touch but nothing else. Two other
exits from the room lead to the same cave, making it the dead end with the only way
down into the cave. But as I try to leave the mirror room I realize that this
is not the same passage I came in... It took me a lot of reloads (*restores*) to realize that
the mirror is a portal to another mirror room.

I am redrawing my map and teleporting back to the first mirror room, which I mark with a letter "A" now. The map is starting to look very complicated, and it's much bigger than I expected. I have the temptation to draw it in some visual tool on PC but for now I am staying OG with pencil. I haven't found anything of value so far and I am afraid to go on this new mirror branch so soon.

I return back to the first room, cellar, and try to focus on going another
direction than east as it, too holds many rooms. I go south and
enter the gallery. A loot at last. But then, out of nowhere
I spot somebody in the room with me. He says nothing, but
holds a bag. At this point I have no idea what to do. I am not sure if
I can say something (in this game) but I just don't want to attack someone
who is not hostile to me.
I am reaching for the manual. There is mention of both *say* and *tell* keywords on
page 19, but the game doesn't recognize them somehow. This might be a trait of my buggy build.
Nevermind, I try waving.
Not working. I will wave my glowing sword, showing I am armed and dangerous.
Nothing. As a somewhat veteran of D&D I will try one last effort to stay civilized - *wait.*

I restored from the last save point in the circle room and run straight to the
gallery. I enter the room with sword in my hand, but the room is empty(?).
I will spare you of my
hundreds of reloads but it works like this. The thief shows up whenever
you pick up or come to something worth points. He will take it whether it
is in a room or on you. You can fight him but I was out of luck.
I tried knife, but that was doing no damage at all, sword performed best
but he was always quicker than me and troll's ax hit him too, but after
first hit he stole my stuff and left. Command *follow thief* doesn't
work - boy I hate him. But I was able to "bug him out" by taking the
painting, saving and restoring the just saved game. He didn't come back.

But still, my inventory is getting full, and I will have to carry things out to the trophy case. So the new plan is to look for a way out and then try to scavenge for other valuables. And nothing screams more "way out" than a maze. I go back to the cellar (again), this time with painting and enter the maze to the west. I will mark down all of my moves on separate sheet of paper and drop items to be my breadcrumbs. And I will save often, just in case the old friend shows up.

I managed to navigate myself to the treasure inside the maze. It is the skeleton key and the bag of coins. Score is 64. I do know my way back, but I need to get out another way, hopefully leading me to the house again. I managed to navigate to the room with evil cyclops. I must say that the whole maze solving took me about 1,5 hours of which I had to deal with thief at least 10 times. I am more than ready to kill the beast standing before me or die trying. I charge the monster and after a tough one-sided battle...

Ok. New plan. Don't leave the sandwich in the maze and let's try to bribe the cyclops with it. At this point, I knew how to solve the maze from the top of my head. I face the beast again, this time without the sword, holding only a small sub with peppers. He likes my proposition and takes my bottle with water too. The beast falls asleep after a good lunch. I tried to look around the room and I saw stairs up, but as soon as I enter the treasure room on the upper floor... the thief, again. I am carrying the painting, the bag of coins and just in front of our eyes, there is a beautiful silver chalice.The score is 79 and it is time to play his own game.

I gave him my sword. He is stunned by this gesture and examines the weapon. Then suddenly, out of nowhere, I sneak behind him and struck him dead with knife from the attic. Well, it was like three attacks but nevertheless RETRIBUTION! With the thief dead, I take my sword back and drop the knife as insturment of a cold murder. Then there is the silver chalice lying on the ground, but I am unable to take it as the inventory is full. I want to drop the garlic, but I am not sure if this underground is vampire-free, so I will stick with the garlic and I drop the rope. I am sure I won't regret it later... The score is just one point short of 100.

Sadly, no exit from the treasure room and cyclops room is also a dead end. My patience is slowly fading away and I access the World Wide Web for hints. I found a pretty nice map which told me that there was another way out of the maze. It's the cryptic grating room from clearing next to the house! I close the map and rush to it. But yeah, the grating is locked and I left the skeleton key inside the maze... Went back for the key, emerged on the surface and delivered the treasures back to the living room in 2 rounds because of a small inventory. Score is sitting way up on 115.

And right now, I am considering ending this adventure as the score is above 100
and my lust for retro gaming has been somewhat satisfied. I typed *score* to see
that I reached the rank of Junior Adventurer, which is
[4th rank out of 8](https://ganelson.github.io/inform-website/book/WI_9_3.html).
As much as I want to say that it was fun, I feel tricked into playing a
puzzle game with very little adventure in it.
The lack of usefull information and overall "story" puts this
game on the same level as some rogue-likes. It is good but not something
I can see falling into. At least not now. If you consider playing it,
here are my key takeaways from this short gameplay:

- get lamp
- drawing a map is neccessity
- downloading the map when stuck is not a shame
- drop items in maze to find your way out
- use
*up, down, SE, SW, NE, NW*directions (in maze) too - thief is son of a bitch, play dirty because he will

*Planetfall*and

*Lurking Horror*. But that is a story for next time. Hopefully, a longer and a story...

* Well-spread trivia says that "zork" was a jargon word for unfinished
software at MIT back in the 1970s. So we could say that Sheldon played a
"zork of the Zork". However, I could not find any source to back this
up. ESR's
[jargon file](https://www.catb.org/~esr/jargon/html/go01.html)
knows the keyword "zork" only as the game and the most quoted source,
[Down From the Top of Its Game: The Story of Infocom, Inc.](https://archive.org/stream/infocom-paper-2000-12-15/infocom-paper_djvu.txt)
does not contain this information either. If you happen to know a relevant
source that could prove this historical trivia, please reach me via
[email](mailto:email@dpolakovic.space).
