
Zork source code, 1977 - braythwayt
https://github.com/MITDDC/zork
======
dws
A bit of context that's gone missing: In 1977, the Fortran source for
Adventure, by Crowther and Woods, leaked from Stanford and starting making the
rounds on PDP-10 magtapes. Zork, from MIT, came along shortly thereafter, and
was seen as more than bit of MIT taking a slap at Stanford by saying, "Now,
here's how to do this right. First, one creates a Dungeon Definition Language.
..."

~~~
GetLampVR
BTZ Assembler (better than zork) discussed by Robert Pinsky here
[https://m.youtube.com/watch?v=9dj3XiJKhYQ](https://m.youtube.com/watch?v=9dj3XiJKhYQ)

[http://www.ifwiki.org/index.php/BTZ](http://www.ifwiki.org/index.php/BTZ)

------
larsbrinkhoff
I was the one who excavated these files from MIT's tape archives.

~~~
DonHopkins
This seems to be an earlier version than the one that included the One Lousy
Point Donald Woods Stamp (a tribute to one of the authors of Adventure). Isn't
there another version of the later Zork source code in MDL floating around,
that has the Don Woods Stamp?

I worked with him at Sun on NeWS -- he's a great PostScript hacker! When you
logged into his workstation, /etc/motd said "Welcome to Adventure. Would you
like instructions?" \-- but don't type "yes" to the Unix shell or you'll
regret it. Here's his implementation of QuickSort in PostScript, and he also
wrote the Spider card game for NeWS that shipped with OpenWindows (which is a
nice clean well documented example of NeWS PostScript code), and he wrote a
bunch of Open Look widgets and user interface plumbing for The NeWS Toolkit,
too:

[https://donhopkins.com/home/code/quicksort.ps.txt](https://donhopkins.com/home/code/quicksort.ps.txt)

[https://donhopkins.com/home/news-
tape/fun/spider/spider.ps](https://donhopkins.com/home/news-
tape/fun/spider/spider.ps)

[http://www.icynic.com/~don/](http://www.icynic.com/~don/)

Here's a great interview with Don Woods from GET LAMP, in which he mentions
playing Zork at MIT over the ARPANET. He describes the point at which he
stopped playing Zork, when he had almost solved the entire game, but then they
added a whole bunch of new stuff to the game that night. So he realized he
would never completely solve it, and finally stopped playing.

I presume the "One Lousy Point" stamp is a cheeky tribute to Don Woods' ordeal
playing Zork, because it's so damned hard to figure out how to find it (which
I won't spoil):

[https://www.youtube.com/watch?v=A8Z1cKUxD9c](https://www.youtube.com/watch?v=A8Z1cKUxD9c)

    
    
        ---v----v----v----v----v---
        |         _______         |
        >  One   /       \     G  <
        | Lousy /         \    U  |
        > Point |   ___   |    E  <
        |       |  (___)  |       |
        >       <--)___(-->    P  <
        |       / /     \ \    o  |
        >      / /       \ \   s  <
        |     |-|---------|-|  t  |
        >     | |  \ _ /  | |  a  <
        |     | | --(_)-- | |  g  |
        >     | |  /| |\  | |  e  <
        |     |-|---|_|---|-|     |
        >      \ \__/_\__/ /      <
        |       _/_______\_       |
        >      |  f.m.l.c. |      <
        |      -------------      |
        >                         <
        |   Donald Woods, Editor  |
        >     Spelunker Today     <
        |                         |
        ---^----^----^----^----^---

~~~
larsbrinkhoff
It's a very early version. Zork development began arund June 1977, so this is
just six month in.

I believe the officially final version is from 1981, and is the one Bob Supnik
distributes. Macsyma developer Eric Swenson made off with a 1979 version, but
it's virtually identical. I'm not aware of any more preserved versions beyond
these three.

------
anthk
If you like text adventures with something easier than Zork, try Anchorhead.
Then, Curses. Yes, alike-passages are clunky and old-school cool, but nowadays
since Anchorhead the games are long and good enough to be both enjoyed and not
get lost by design in several places (if any, just several ones as a single or
two puzzles, not as a mechanic).

Curses can be unbearabily difficult, but not on the "unwinnable by design" as
the others, at least not as the old Infocom games.

Vicious Cycles is cool too albeit short.

And Slouch over Bedlam is damn poetry made into a text adventure. Pure
steampunk.

~~~
LeoPanthera
Suggesting Curses as people's second game is extremely mean. It's shockingly
difficult.

~~~
anthk
Well, its sequel Jigsaw is far worse. If so, set Curses it as the fourth
recommended game.

------
DonHopkins
>GIVE TROLL TO TROLL

The troll, who is not overly proud, graciously accepts the gift and not having
the most discriminating tastes, gleefully eats it.

~~~
jschwartzi
It is pitch black. You are likely to be eaten by a grue.

>

~~~
sfj
Having the troll eat itself wouldn't remove the light source. The troll didn't
have a light to begin with, it can see in the dark.

~~~
DonHopkins
What's wonderful about this bug is that giving the troll to itself to eat gets
rid of the troll, but doesn't clear the TROLL-FLAG. ;( So then when you try to
exit the room to the NORTH, EAST or SOUTH, you get TCHOMPed, and the non-
existent troll fends you off with a menacing gesture! ;) So you are truly
fucked, and can't finish the game.

>EAST

The troll fends you off with a menacing gesture.

    
    
        #ROOM {"MTROL"
    
        "You are in a small room with passages off in all directions. 
        Bloodstains and deep scratches (perhaps made by an axe) mar the
        walls."
               "The Troll Room"
               %<> #EXIT {"WEST" "CELLA"
                  "EAST" #CEXIT {"TROLL-FLAG" "CRAW4" %,TCHOMP}
                  "NORTH" #CEXIT {"TROLL-FLAG" "PASS1" %,TCHOMP}
                  "SOUTH" #CEXIT {"TROLL-FLAG" "MAZE1" %,TCHOMP}}
               (#FIND-OBJ {"TROLL"})}
    
        <PSETG TCHOMP "The troll fends you off with a menacing gesture.">

------
raldi
If you like this, you may like "I spent my weekend hacking Zork" (2012):
[https://www.reddit.com/r/raldi/comments/10dtch/i_spent_my_we...](https://www.reddit.com/r/raldi/comments/10dtch/i_spent_my_weekend_hacking_zork/)

~~~
exlurker
Thank you for that, very interesting read!

------
braythwayt
Jason Scott:
[https://twitter.com/textfiles/status/1258483768010190849](https://twitter.com/textfiles/status/1258483768010190849)

Jason cloned the repository here:
[https://github.com/historicalsource/zork-1977-source](https://github.com/historicalsource/zork-1977-source)

------
acd
Adventure text games like Zork to a huge extent increased my English language
skills. In order to play adventure games as a kid which I loved doing I had to
understand the text. When I encountered words I did not understand I looked
them up in a dictionary doing learning while playing.

------
theonething
pretty expressive code:

    
    
      >       <SET DUMMY? T>>>
          <COND (<OR <AND <MEMQ <SET O <FIND-OBJ "CANDL">> 
      <AOBJS .WIN>>
            <1? <OLIGHT? .O>>>
              <AND <MEMQ <SET O <FIND-OBJ "TORCH">> <AOBJS .WIN>>
            <1? <OLIGHT? .O>>>>
          <UNWIND
           <PROG ()
            <COND (.DUMMY?
            <TELL
      "I didn't realize that adventurers are stupid enough to light a 
      " 1 <ODESC2 .O> " in a room which reeks of coal gas.
      Fortunately, there is justice in the world.">)
           (<TELL
      "Oh dear.  It appears that the smell coming from this room 
      was coal gas.  I would have thought twice about carrying a 
      " 1 <ODESC2 .O> "in here.">)>
            <FWEEP 7>
            <JIGS-UP "   BOOOOOOOOOOOM      ">>
           <JIGS-UP "   BOOOOOOOOOOOM      ">>)>)>>
    

So if you come into this room with a candle or a torch, you're a dummy and get
told as much. And then the jigs up, BOOOOOOM

------
tosh
Great way to learn more about Zork and the Z-machine:

Eric Lippert wrote an ocaml implementation and blogged about it

[https://ericlippert.com/2016/02/03/north-of-
house/](https://ericlippert.com/2016/02/03/north-of-house/)

------
neotek
Is it possible to play Zork for the first time without a guide or manual of
some kind? Could I fire up a copy today and dive straight in or do I need some
external information?

Edit: and a follow-up question, is there a good Z-Machine interpreter for the
macOS terminal?

~~~
fenomas
You can definitely dive into Zork fresh and have fun, and probably make it a
fair ways into the game. But you will almost certainly hit a wall somewhere in
the middle, as some of the puzzles (and also one important game mechanic) are
pretty non-obvious, and the game doesn't signpost how to proceed.

Real releases of the game worked around this with "Invisiclues", which were
sets of questions ("How do I get past the troll?") with increasingly specific
hints that one is meant to uncover one by one. If you get the game files from
a usual sort of place, the invisiclues will probably be included (possibly in
the form of a z-machine game file).

Note that the preceding all applies to normal released versions of the game,
the source in TFA could be older/different/etc.

For Z-machine on mac, I use one called "Zoom". But it's a windowed app, I
don't know if it can run in the terminal or if there are alternatives.

~~~
DonHopkins
Zork definitely has some puzzles that are practically impossible to figure
out, without some help.

The ITS operating system that Zork was developed on was a extremely open, with
very little security, but lots of obscurity.

ITS was like the original "social network," where users would hang out and
socialize, with lots of visibility and awareness of each other and what
they're doing, where everybody could see each other's files and read each
other's email, with programs like "INQUIR" for telling other people about
yourself, "WHOIS" and "FINGER" for finding out about other people, "WHOJ" to
see who's on and what they're doing, "SEND" and "REPLY" for sending immediate
messages back and forth, "UNTALK" for multi-window chatting, "MAIL" for
sending email, "RMAIL" and "BABYL" for reading email, etc.

And (important to Zork) also "OS" (Output Spy) to spy on other people's
sessions over their shoulders!

Only two people could play Zork at once on DM, and only after east coast
business hours. Usually there were a few other people just hanging out, spying
on the two lucky people playing, chit chatting with each other and the players
by sending messages and email, etc.

It was considered perfectly normal and inoffensive behavior for people to spy
on each other and learn about running Lisp, hacking Emacs, or playing Zork.
(As long as you're not creepy or obnoxious about it, but people tended to be
polite and follow the Tourist Policy, and people liked to help each other
learn. And if you liked creepy obnoxious stuff, you could subscribe to REM-
DIARY-READERS!)

[https://medium.com/@donhopkins/mit-ai-lab-tourist-
policy-f73...](https://medium.com/@donhopkins/mit-ai-lab-tourist-
policy-f73b77075631)

>TOURIST POLICY AND RULES FOR TOURIST USE OF ITS MACHINES

>It has been a long standing tradition at both the Laboratory for Computer
Science and the Artificial Intelligence Laboratory at MIT to allow non-
laboratory people to use the laboratories’ computers during off hours. During
the early days of the laboratories’ existence a non-laboratory person (such
people have come to be called tourists) could gain access to one of the
computers by direct personal contact with a laboratory member. Furthermore,
tourist access was controlled because access to the laboratories’ computers
was de facto achieved through on site terminals. A tourist sponsored by a
laboratory member would generally receive some guidance and tutelage
concerning acceptable behavior, proper design techniques for hardware and
software, proper programming techniques, etc. The expectation on the
laboratories’ part was that a large percentage would become educated in the
use of the advanced computing techniques developed and used in our
laboratories and thereby greatly facilitate the technology transfer process. A
second expectation was that some percentage would become interested and expert
enough to contribute significantly to our research efforts. Tourists in this
latter group would at some point in time graduate out of the tourist class and
become laboratory members. In actual fact a number of former and present staff
members and faculty earned their computational wings in just this fashion.
[...]

MIT-DM was the Dynamic Modeling Lab's PDP-10 running a slightly different
version of ITS, and it was the only ITS machine that had any form of file
protection, which was primarily used to hide the Zork source code. But even
that was essentially only security through obscurity, which was why the source
was eventually leaked.

Zork had its own end-game, but getting an account on MIT-DM was like the pre-
game, and logging into MIT-DM itself was like the Zork Lobby where you'd hang
out waiting for your turn and socializing.

You could get an account on most of the ITS machines just by asking nicely and
using the right magic words, like mentioning Lisp on MIT-AI, or Macsyma on
MIT-MC, or SomewhatBasic on MIT-ML. But Zork was so sought after that DM was
one of the harder ITS machines to get an account on -- you couldn't just say
you wanted to play Zork or hack Lisp: you had to say you were interested in
MDL for some plausible sounding mumbo jumbo like "algebraic applications". But
they still knew you just wanted to play Zork, though.

PDP-10/its: Incompatible Timesharing System (github.com)

[https://news.ycombinator.com/item?id=13514918](https://news.ycombinator.com/item?id=13514918)

[https://github.com/PDP-10/its](https://github.com/PDP-10/its)

~~~
larsbrinkhoff
I always wondered what and where that DM ITS directory hiding feature was. I
have looked, but I haven't found it.

~~~
DonHopkins
Probably in plain sight, disguised as a COBOL compiler.

------
traes
MDL looks really interesting. Is there any similar modern-day language for
more advanced (graphically and input wise) adventure games? Because if not I
might build one...

~~~
kd5bjo
In the ‘90s (?), LucasArts and Sierra both developed VMs for graphical
adventure games (SCUMM and AGI); you can look into languages targetting those.

Inform is a more modern language for text adventures.

Ink is an open-source embeddable language for dialog trees and story puzzles.
You’ll need to bring your own game engine, but there’s a Unity3d plugin to
help.

~~~
kevinmchugh
Inform is the most direct descendant of Zork. It was inspired by the work of
Infocom, a company founded by most of the authors of the MIT Zork. Folks
especially enamored of Zork should start there. Inform has some support for
displaying images.

~~~
metroholografix
Inform is not a descendant of Zork, it has no connection to it besides
producing output files in ZMachine / Z-Code format, which is well-specified so
that anyone can write a generator.

As far as programming the actual story goes, it's an independent
implementation based on entirely different principles (Zork was written in MDL
which was a Lisp).

------
tyingq
I'm not sure there's enough of the MDL environment around to actually get it
running. The effort is here: [https://muddlers.org/](https://muddlers.org/)

~~~
larsbrinkhoff
The Muddle interpreter and runtime is alive and well:
[https://github.com/PDP-10/its/tree/master/src/mudsys](https://github.com/PDP-10/its/tree/master/src/mudsys)

------
georgeecollins
This is kind of weird to see because I can remember back in the 90's doing
Infocom re-releases at Activision. Activision bought Infocom in the late 80's,
so in theory they owned all the source code to games like Zork. I remember
going through back up of old Infocom drives, there were some really good
design ideas. But not the actual source code for their text adventure engine.

~~~
larsbrinkhoff
This version is from before Infocom was founded.

------
ggm
Having been exposed to the original (I believe from DECUS tapes but I am
unsure from this distance in time) back in the 70s' I played the BSD fortran
cross-port on machines I had, but the thing is, the nostalgia kick is
satisfied from low degrees of engagement.

I think my personal tabular room-connectivity map I hand crafted in vi is
still lurking on backup media, it was fun making it.

No robots and washing machines here.

------
microtherion
I'm kind of curious about the license status of this. Zork has been
commercially sold (on iOS) within the last 10 years, and I don't quite know
how this source would be MIT's to give away, unless there is a deal with
whatever legal entity owns Infocom's intellectual property these days.

~~~
duskwuff
Infocom wasn't founded until 1979 -- this source code is from an earlier
version of the game which was widely distributed among PDP-10 systems.

The original authors might have a copyright claim, but it's not clear that
Infocom (or its heirs) would.

~~~
larsbrinkhoff
I contacted the original authors except Marc, who's email address I don't
have. They had no objections. Marc responded on Reddit and seems OK with it.

~~~
microtherion
That's great, and I did not mean to cast aspersions on the legality or ethics
of the release. I just was somewhat uncomfortable not to see any mention of
legal terms in the repo, or a mention that the authors were OK with the
release.

~~~
larsbrinkhoff
As far as I understand, some MIT legal department OK'ed this release. Your
question about a license is of course very legitimate, and someone posted a
GitHub issue about it.

------
zomglings
First time I've seen CodeMeta - does anyone have any experience and opinions
of it? Looks like it's optimized for citations and doesn't really help with
how to execute the code.

Maybe Dockerfile is becoming the programmer's version of what this
codemeta.json file is doing (I guess for researchers)?

------
monkeycantype
This is amazing, On the same day this was going up, I was talking to my son
about text based games and saying I always wanted to play zork but never have

------
ChicagoDave
I recommend emulating a PDP-11 on a pi and connecting an LA120 green bar paper
terminal.

This is how I play Zork.

~~~
larsbrinkhoff
This is an earlier version for the PDP-10.

~~~
ChicagoDave
Heh. Believe me I know. I played the Fortran version in high school. Been
obsessed with interactive fiction since 1979.

------
hardmaru
What's the license of the code?

~~~
sjwright
_So sue me_ (SSM1.0)

------
butterisgood
;"GLOBAL VARIABLES WHICH ARE MONADS MUST BE HERE!"

uh, hmmmm. 1977?

~~~
th0ma5
See here:
[https://en.wikipedia.org/wiki/Monad_(functional_programming)...](https://en.wikipedia.org/wiki/Monad_\(functional_programming\)#History)

~~~
newmana
Or better yet, from the MDL documentation [https://mdl-
language.readthedocs.io/en/latest/08-truth/#824-...](https://mdl-
language.readthedocs.io/en/latest/08-truth/#824-object-properties-1)

