Eaten by a Grue: podcast on Infocom games, text adventures and interactive fiction
The original Zork source code in MDL which is available here:
<a href="http:&#x2F;&#x2F;retro.co.za&#x2F;adventure&#x2F;zork-mdl&#x2F;" rel="nofollow">http:&#x2F;&#x2F;retro.co.za&#x2F;adventure&#x2F;zork-mdl&#x2F;</a><p>It&#x27;s also here on github: <a href="https:&#x2F;&#x2F;github.com&#x2F;itafroma&#x2F;zork-mdl" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;itafroma&#x2F;zork-mdl</a><p>It is fascinating to read, and really beautiful code, quite understandable even if you don&#x27;t know MDL, and practically a form of literature.<p>I played the original Zork on MIT-DM and also the Infocom versions of course. Reading the source code is like seeing the behind-the-scenes underground rooms and passages at Disneyland!<p>While I was playing Zork, I found a bug. First some context: when you&#x27;re battling the troll, you can give things to him, and he eats them! Sometimes he drops his axe, and you can pick it up and kill him with it. He blocks the exits until you kill him.<p>So I tried &quot;give axe to troll,&quot; and he ate his own axe, then cowered in terror: &quot;The troll, disarmed, cowers in terror, pleading for his life in the guttural tongue of the trolls.&quot;
Not satisfied with that, I tried &quot;give troll to troll&quot;, and he devoured himself: &quot;The troll, who is remarkably coordinated, catches the troll and not having the most discriminating tastes, gleefully eats it.&quot;<p>...Except that I still could not get out of the exit, because every time I tried, it said &quot;The troll fends you off with a menacing gesture.&quot;<p>I figured there must be a troll flag that wasn&#x27;t getting cleared when the troll devoured itself. And sure enough, I found it in the code, and it&#x27;s called &quot;TROLL-FLAG!-FLAG&quot;!<p>Here is an excerpt of the MDL troll code, where you can see the bug, where it should clear the troll flag when the troll devours itself, but doesn&#x27;t (well that&#x27;s how I would fix it!):<p><a href="https:&#x2F;&#x2F;github.com&#x2F;itafroma&#x2F;zork-mdl&#x2F;blob&#x2F;be079a4ed234071222e991d0da0f9e8c7f96d125&#x2F;act1.mud#L1337" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;itafroma&#x2F;zork-mdl&#x2F;blob&#x2F;be079a4ed234071222...</a><p><pre><code>               &lt;COND (&lt;VERB? &quot;THROW&quot; &quot;GIVE&quot;&gt;
                      &lt;COND (&lt;VERB? &quot;THROW&quot;&gt;
                             &lt;TELL
    &quot;The troll, who is remarkably coordinated, catches the &quot; 1 &lt;ODESC2 &lt;PRSO&gt;&gt;&gt;)
                            (&lt;TELL
    &quot;The troll, who is not overly proud, graciously accepts the gift&quot;&gt;)&gt;
                      &lt;COND (&lt;==? &lt;PRSO&gt; &lt;SFIND-OBJ &quot;KNIFE&quot;&gt;&gt;
                             &lt;TELL
    &quot;and being for the moment sated, throws it back.  Fortunately, the
    troll has poor control, and the knife falls to the floor.  He does
    not look pleased.&quot; ,LONG-TELL1&gt;
                             &lt;TRO .T ,FIGHTBIT&gt;)
                            (&lt;TELL
    &quot;and not having the most discriminating tastes, gleefully eats it.&quot;&gt;
                      &lt;REMOVE-OBJECT &lt;PRSO&gt;&gt;)&gt;)
                     (&lt;VERB? &quot;TAKE&quot; &quot;MOVE&quot;&gt;
                      &lt;TELL
    &quot;The troll spits in your face, saying \&quot;Better luck next time.\&quot;&quot;&gt;)
                     (&lt;VERB? &quot;MUNG&quot;&gt;
                      &lt;TELL
    &quot;The troll laughs at your puny gesture.&quot;&gt;)&gt;)
              (&lt;AND ,TROLL-FLAG!-FLAG
                    &lt;VERB? &quot;HELLO&quot;&gt;&gt;
               &lt;TELL &quot;Unfortunately, the troll can&#x27;t hear you.&quot;&gt;)&gt;&gt;
</code></pre>
The troll bugs are also in Zork I! Here&#x27;s a newspaper article from January 8 1985 about &quot;Infocom Glitches Bug Game Players&quot;!<p><a href="http:&#x2F;&#x2F;articles.sun-sentinel.com&#x2F;1985-01-18&#x2F;features&#x2F;8501020995_1_typing-troll-adventure-games" rel="nofollow">http:&#x2F;&#x2F;articles.sun-sentinel.com&#x2F;1985-01-18&#x2F;features&#x2F;8501020...</a><p>And here&#x27;s another article from March 29, 1985: &quot;Zork I Fuddles Mental Health With Choices&quot;:<p><a href="http:&#x2F;&#x2F;articles.sun-sentinel.com&#x2F;1985-03-29&#x2F;features&#x2F;8501120597_1_trap-door-computer-games-troll" rel="nofollow">http:&#x2F;&#x2F;articles.sun-sentinel.com&#x2F;1985-03-29&#x2F;features&#x2F;8501120...</a>