In particular the following diff for each README.md (with all the
index.html files rebuilt):
-Watch the following [Our Favorite Universe](https://www.youtube.com/@OurFavoriteUniverse) YouTube show:
+Watch the [Our Favorite Universe](https://www.youtube.com/@OurFavoriteUniverse)
+YouTube show for this entry:
780 lines
34 KiB
HTML
780 lines
34 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||
|
||
<!-- END: this line ends content from: inc/top.default.html -->
|
||
<!-- START: this line starts content from: inc/head.default.html -->
|
||
|
||
<head>
|
||
<link rel="stylesheet" href="../../ioccc.css">
|
||
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap" rel="stylesheet">
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||
<title>2024/mills - Prize in ℤ₃</title>
|
||
<link rel="icon" type="image/x-icon" href="../../favicon.ico">
|
||
<meta name="description" content="2024 IOCCC entry mills - Prize in ℤ₃">
|
||
<meta name="keywords" content="IOCCC, 2024, IOCCC 2024, IOCCC entry, mills, Prize in ℤ₃">
|
||
</head>
|
||
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
|
||
<!-- END: this line ends content from: inc/head.default.html -->
|
||
|
||
<!-- -->
|
||
<!-- This web page was formed via the tool: bin/readme2index.sh -->
|
||
<!-- The content of main section of this web page came from: 2024/mills/README.md -->
|
||
<!-- -->
|
||
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2024/mills/README.md !!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2024/mills/README.md !!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2024/mills/README.md !!! -->
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
|
||
<!-- Markdown content was converted into HTML via the tool: bin/md2html.sh -->
|
||
|
||
<!-- START: this line starts content from: inc/body.default.html -->
|
||
|
||
<body>
|
||
|
||
<!-- END: this line ends content from: inc/body.default.html -->
|
||
<!-- START: this line starts content from: inc/topbar.default.html -->
|
||
|
||
<div class="theader">
|
||
<nav class="topbar">
|
||
<div class="container">
|
||
<div class="logo">
|
||
<a href="../../index.html" class="logo-link">
|
||
IOCCC
|
||
</a>
|
||
</div>
|
||
|
||
<div class="topbar-items">
|
||
<div class="item">
|
||
<span class="item-header">
|
||
Entries
|
||
</span>
|
||
|
||
<div class="sub-item">
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../years.html" class="sub-item-link">
|
||
Winning entries
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../authors.html" class="sub-item-link">
|
||
Winning authors
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../location.html" class="sub-item-link">
|
||
Location of authors
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../bugs.html" class="sub-item-link">
|
||
Bugs and (mis)features
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#fix_an_entry" class="sub-item-link">
|
||
Fixing entries
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#fix_author" class="sub-item-link">
|
||
Updating author info
|
||
</a>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="item">
|
||
<span class="item-header">
|
||
Status
|
||
</span>
|
||
|
||
<div class="sub-item">
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../news.html" class="sub-item-link">
|
||
News
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../status.html" class="sub-item-link">
|
||
Contest status
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../next/rules.html" class="sub-item-link">
|
||
IOCCC rules
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../next/guidelines.html" class="sub-item-link">
|
||
IOCCC guidelines
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../markdown.html" class="sub-item-link">
|
||
Markdown guidelines
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../SECURITY.html" class="sub-item-link">
|
||
Security policy
|
||
</a>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="item">
|
||
<span class="item-header">
|
||
FAQ
|
||
</span>
|
||
|
||
<div class="sub-item">
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html" class="sub-item-link">
|
||
Frequently asked questions
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../quick-start.html#enter" class="sub-item-link">
|
||
Enter the IOCCC
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#compiling" class="sub-item-link">
|
||
Compiling entries
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#running_entries" class="sub-item-link">
|
||
Running entries
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#help" class="sub-item-link">
|
||
How to help
|
||
</a>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="item">
|
||
<span class="item-header">
|
||
About
|
||
</span>
|
||
|
||
<div class="sub-item">
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../index.html" class="sub-item-link">
|
||
Home page
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../social.html" class="sub-item-link">
|
||
IOCCC social media
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../about.html" class="sub-item-link">
|
||
About the IOCCC
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../judges.html" class="sub-item-link">
|
||
The judges
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../thanks-for-help.html" class="sub-item-link">
|
||
Thanks for the help
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../contact.html" class="sub-item-link">
|
||
Contact us
|
||
</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</nav>
|
||
|
||
<div class="header-mobile-menu">
|
||
<noscript>
|
||
<a href="../../nojs-menu.html" class="topbar-js-label">
|
||
Please Enable JavaScript
|
||
</a>
|
||
</noscript>
|
||
|
||
<button id="header-open-menu-button" class="topbar-mobile-menu">
|
||
<img
|
||
src="../../png/hamburger-icon-open.png"
|
||
alt="hamburger style menu icon - open state"
|
||
width=48
|
||
height=48>
|
||
</button>
|
||
|
||
<button id="header-close-menu-button" class="hide-content">
|
||
<img
|
||
src="../../png/hamburger-icon-closed.png"
|
||
alt="hamburger style menu icon - closed state"
|
||
width=48
|
||
height=48>
|
||
</button>
|
||
|
||
<div id="mobile-menu-panel" class="hide-content">
|
||
<div class="mobile-menu-container">
|
||
|
||
<div class="mobile-menu-wrapper">
|
||
<div class="mobile-menu-item">
|
||
Entries
|
||
</div>
|
||
<div class="mobile-submenu-wrapper">
|
||
|
||
<a class="mobile-submenu-item" href="../../years.html">
|
||
Winning entries
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../authors.html">
|
||
Winning authors
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../location.html">
|
||
Location of authors
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../bugs.html">
|
||
Bugs and (mis)features
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#fix_an_entry">
|
||
Fixing entries
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#fix_author">
|
||
Updating author info
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../thanks-for-help.html">
|
||
Thanks for the help
|
||
</a>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="mobile-menu-wrapper">
|
||
|
||
<div class="mobile-menu-item">
|
||
Status
|
||
</div>
|
||
<div class="mobile-submenu-wrapper">
|
||
|
||
<a class="mobile-submenu-item" href="../../news.html">
|
||
News
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../status.html">
|
||
Contest status
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../next/rules.html">
|
||
IOCCC rules
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../next/guidelines.html">
|
||
IOCCC guidelines
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../markdown.html">
|
||
Markdown guidelines
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../SECURITY.html">
|
||
Security policy
|
||
</a>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="mobile-menu-wrapper">
|
||
<div class="mobile-menu-item">
|
||
FAQ
|
||
</div>
|
||
<div class="mobile-submenu-wrapper">
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html">
|
||
Frequently asked questions
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../quick-start.html#enter">
|
||
Enter the IOCCC
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#compiling">
|
||
Compiling entries
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#running_entries">
|
||
Running entries
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#help">
|
||
How to help
|
||
</a>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="mobile-menu-wrapper">
|
||
<div class="mobile-menu-item">
|
||
About
|
||
</div>
|
||
<div class="mobile-submenu-wrapper">
|
||
|
||
<a class="mobile-submenu-item" href="../../index.html">
|
||
Home page
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../social.html">
|
||
IOCCC social media
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../about.html">
|
||
About the IOCCC
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../judges.html">
|
||
The judges
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../contact.html">
|
||
Contact us
|
||
</a>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<script>
|
||
var headerOpenMenuButton = document.getElementById("header-open-menu-button");
|
||
var headerCloseMenuButton = document.getElementById("header-close-menu-button");
|
||
var mobileMenuPanel = document.getElementById("mobile-menu-panel");
|
||
|
||
headerOpenMenuButton.addEventListener("click", () => {
|
||
headerOpenMenuButton.classList.remove("topbar-mobile-menu");
|
||
headerOpenMenuButton.classList.add("hide-content");
|
||
|
||
headerCloseMenuButton.classList.remove("hide-content");
|
||
headerCloseMenuButton.classList.add("topbar-mobile-menu");
|
||
|
||
mobileMenuPanel.classList.remove("hide-content");
|
||
mobileMenuPanel.classList.add("topbar-mobile-panel");
|
||
});
|
||
|
||
headerCloseMenuButton.addEventListener("click", () => {
|
||
headerCloseMenuButton.classList.remove("topbar-mobile-menu");
|
||
headerCloseMenuButton.classList.add("hide-content");
|
||
|
||
mobileMenuPanel.classList.add("hide-content");
|
||
mobileMenuPanel.classList.remove("topbar-mobile-panel");
|
||
|
||
headerOpenMenuButton.classList.add("topbar-mobile-menu");
|
||
headerOpenMenuButton.classList.remove("hide-content");
|
||
});
|
||
</script>
|
||
|
||
<!-- END: this line ends content from: inc/topbar.default.html -->
|
||
<!-- START: this line starts content from: inc/header.default.html -->
|
||
|
||
<div class="header">
|
||
<a href="../../2011/zucker/index.html">
|
||
<img src="../../png/ioccc.png"
|
||
alt="IOCCC image by Matt Zucker"
|
||
width=300
|
||
height=110>
|
||
</a>
|
||
<h1>The International Obfuscated C Code Contest</h1>
|
||
<h2>2024/mills - Prize in ℤ₃</h2>
|
||
<h3>Infocom v3 story interpreter</h3>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/header.default.html -->
|
||
<!-- START: this line starts content from: inc/navbar.mid.html -->
|
||
|
||
<div class="navbar">
|
||
<a class="Left" href="../maffiodo/index.html">← 2024/maffiodo</a>
|
||
<a class="Left" href="../index.html">↑ 2024 ↑</a>
|
||
<a class="Left" href="../stedolan/index.html">2024/stedolan →</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/winner/blob/master/2024/mills/prog.c">C code</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/winner/blob/master/2024/mills/Makefile">Makefile</a>
|
||
<a class="Right" href="#inventory">Inventory</a>
|
||
<a class="Right" href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fwww.ioccc.org%2F2024%2Fmills%2Findex.html">✓</a>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/navbar.mid.html -->
|
||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||
|
||
<div class="content" id="content">
|
||
|
||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||
<!-- START: this line starts content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
|
||
|
||
<!-- START: this line starts content generated by: bin/output-index-author.sh -->
|
||
|
||
<h2 id="author">Author:</h2>
|
||
<ul>
|
||
<li>Name: <a href="../../authors.html#Christopher_Mills">Christopher Mills</a><br>
|
||
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
|
||
</ul>
|
||
|
||
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
|
||
|
||
<!-- END: this line ends content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
|
||
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||
|
||
<!-- BEFORE: 1st line of markdown file: 2024/mills/README.md -->
|
||
<h2 id="award-presentation">Award presentation:</h2>
|
||
<p>Watch the <a href="https://www.youtube.com/@OurFavoriteUniverse">Our Favorite Universe</a>
|
||
YouTube show for this entry:</p>
|
||
<blockquote>
|
||
<p><a href="https://www.youtube.com/watch?v=sXdTonHUN8s">IOCCC28 - 2024/mills - Prize in ℤ₃</a></p>
|
||
</blockquote>
|
||
<h2 id="to-build">To build:</h2>
|
||
<pre><code> make all</code></pre>
|
||
<h2 id="to-use">To use:</h2>
|
||
<pre><code> ./prog foo.z3 foo.sav</code></pre>
|
||
<p>The <code>foo.z3</code> is an <a href="https://en.wikipedia.org/wiki/Infocom" title="Infocom">Infocom</a> version 3 <a href="https://en.wikipedia.org/wiki/Z-machine" title="Z-machine">Z-machine</a> file,
|
||
and <code>foo.sav</code> is file that is written when you enter the command <code>SAVE</code>
|
||
and read when you enter the command <code>RESTORE</code>.</p>
|
||
<h2 id="try">Try:</h2>
|
||
<pre><code> ./try.sh
|
||
|
||
For your first try, we suggest selecting games 0 or 1</code></pre>
|
||
<h2 id="alternate-code">Alternate code:</h2>
|
||
<h3 id="alternate-build">Alternate build:</h3>
|
||
<pre><code> make alt</code></pre>
|
||
<h3 id="alternate-use">Alternate use:</h3>
|
||
<pre><code> ./try.alt.sh
|
||
|
||
For your first try, we suggest selecting games 0 or 1</code></pre>
|
||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||
<p>What is the “<strong>Prize in ℤ₃</strong>”? The “<em>double-struck Z</em>” is <strong>NOT</strong>
|
||
a reference to a set of integers, nor is the “<em>double-struck Z subscript
|
||
3</em>” a reference to a ring of 3-adic integers. Instead, it is a reference
|
||
to the 3rd version of a certain <a href="https://en.wikipedia.org/wiki/Z-machine">virtual machine</a>.</p>
|
||
<p>To fully appreciate the brilliance of this implementation, we suggest
|
||
illuminating the source code. But be careful not to get lost in the
|
||
labyrinthine twists and turns of this source code and get eaten by a Grue!</p>
|
||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||
<h3 id="west-of-house">West of House</h3>
|
||
<pre><code> You are standing in an open field west of a white house, with a boarded
|
||
front door.
|
||
|
||
There is a small mailbox here.</code></pre>
|
||
<p>These are the opening lines from the legendary <a href="https://en.wikipedia.org/wiki/Zork" title="Zork">Zork</a>, one of the most
|
||
influential and successful games of the early computer era. You can play a
|
||
demo version with the submitted program using the following command:</p>
|
||
<pre><code> ./prog minizork.z3 minizork.sav</code></pre>
|
||
<p><em>Minizork</em> is a publicly-available demo version of the original <em>Zork</em>, but
|
||
the program can play any of the classic <a href="https://en.wikipedia.org/wiki/Infocom" title="Infocom">Infocom</a> text adventure games that
|
||
run on the version 3 of the <a href="https://en.wikipedia.org/wiki/Z-machine" title="Z-machine">Z-machine</a>, a <a href="https://en.wikipedia.org/wiki/Virtual_machine" title="Virtual machine">virtual machine</a> which
|
||
Infocom used to run its mainframe-developed games on the 8-bit microcomputers
|
||
of the 1980’s.</p>
|
||
<p>Although there were several iterations of the Z-machine, this program
|
||
implements version 3, which was used for dozens of Infocom’s most famous and
|
||
influential <a href="https://en.wikipedia.org/wiki/Interactive_fiction" title="Interactive fiction">interactive fiction</a> games of the 1980’s, including:</p>
|
||
<ul>
|
||
<li>The <em>Zork</em> Trilogy (<em>Zork I</em>, <em>Zork II</em> and <em>Zork III</em>) and the related
|
||
Enchanter Trilogy (<em>Enchanter</em>, <em>Sorcerer</em> and <em>Spellbreaker</em>)</li>
|
||
<li>The <em>Planetfall</em> series (<em>Planetfall</em> and <em>Stationfall</em>)</li>
|
||
<li><em>The Hitchhiker’s Guide to the Galaxy</em> (by Douglas Adams)</li>
|
||
<li><em>The Lurking Horror</em> (Lovecraftian horror)</li>
|
||
<li><em>Plundered Hearts</em> (romance)</li>
|
||
<li><em>Leather Godesses of Phobos</em> (best left unsaid)</li>
|
||
</ul>
|
||
<p>If you are new to interactive fiction, you might want to try one of the two
|
||
Infocom “four-in-one” demo samplers. These include a gentle introductory
|
||
tutorial to interactive fiction and some sample puzzles from <em>Zork I</em>,
|
||
<em>Planetfall</em>, <em>Infidel</em>, <em>The Witness</em>, <em>Trinity</em> and <em>Leather Godesses of
|
||
Phobos</em>. You can run them by typing:</p>
|
||
<pre><code> ./prog sampler1_R55.z3 sampler1.sav</code></pre>
|
||
<p>or</p>
|
||
<pre><code> ./prog sampler2.z3 sampler2.sav</code></pre>
|
||
<p>In addition to the Infocom games, there is an entire community of interactive
|
||
fiction authors who write modern games which can be downloaded from sites
|
||
like <a href="https://ifdb.org" title="IFDB">The Interactive Fiction Database</a>, <a href="https://www.ifwiki.org" title="IFWiki">The Interactive Fiction Wiki</a>,
|
||
and <a href="https://www.ifarchive.org" title="IFArchive">The Interactive Fiction Archive</a>. I’ve included a few “story files”
|
||
compiled for the Z3 machine from these sites for your enjoyment, but I’ll
|
||
point out in particular <a href="https://ifdb.org/viewgame?id=plvzam05bmz3enh8" title="Curses">Curses</a> by Graham Nelson, the author of
|
||
<a href="https://ganelson.github.io/inform-website" title="Inform 7">Inform</a>, a literate programming system for writing interactive fiction.
|
||
You can of course run it with</p>
|
||
<pre><code> ./prog curses-r10.z3 curses.sav</code></pre>
|
||
<p>By now you’ve probably figured out that <code>prog</code> takes two command-line
|
||
arguments, the first being the “story file” which is the game itself, and
|
||
the second (optional) parameter being the “save file”, which is the file
|
||
the game will write if you type <code>SAVE</code> and read if you type <code>RESTORE</code>.
|
||
The second parameter is optional, but if you don’t use it, you won’t be able
|
||
to <code>SAVE</code> your game (think of this as an “Ironman” mode). Make sure that if
|
||
you switch story files, you also switch save files, because a <code>RESTORE</code> from
|
||
an unrelated story file will invoke what the C Standard Committee refers to
|
||
as <a href="https://en.wikipedia.org/wiki/Undefined_behavior" title="Undefined Behavior">“Undefined Behavior”</a>.</p>
|
||
<p>You can use this command-line template to run any other “version 3” games you
|
||
find, including the original Infocom ones. If you are lucky, you can find
|
||
the original files in one of the (sadly out-of-print) collections like
|
||
<a href="https://en.wikipedia.org/wiki/The_Lost_Treasures_of_Infocom" title="The Lost Treasures of Infocom">The Lost Treasures of Infocom</a>, or you could download a copy of the
|
||
<a href="http://www.infocom-if.org/downloads/downloads.html" title="Zork Trilogy">Zork Trilogy</a> (which was given away free as part of an Activision
|
||
promotion long ago). There are of course other places one might find Infocom
|
||
story files, but since they are not in the public domain I cannot give
|
||
pointers to them. Maybe Microsoft will decide to release them from
|
||
abandonware status now that they have bought Activision…</p>
|
||
<p>Finally, I have also included a copy of <a href="https://en.wikipedia.org/wiki/Colossal_Cave_Adventure" title="Collosal Cave Adventure">Colossal Cave Adventure</a>, which
|
||
may be better known by it’s PDP-10 file name <em>ADVENT</em>. You can run it with</p>
|
||
<pre><code> ./prog advent.z3 advent.sav</code></pre>
|
||
<p><em>ADVENT</em> is the original interactive fiction title by Crowther and Woods that
|
||
inspired <em>Zork</em> and gave us hacker shibboleths like <a href="https://en.wikipedia.org/wiki/Xyzzy_(computing)" title="Xyzzy">Xyzzy</a> and “You are
|
||
in a maze of twisty little passages, all alike.”</p>
|
||
<h3 id="it-is-pitch-black.-you-are-likely-to-be-eaten-by-a-grue.">It is pitch black. You are likely to be eaten by a grue.</h3>
|
||
<p>So what makes the Z3 machine an interesting obfuscation target? Good question!</p>
|
||
<p>The IOCCC has seen all manner of virtual machines over the years, from
|
||
Commodore PETs to IBM PC’s that can run Windows™ and even a mainframe or
|
||
two, so what is so challenging about a VM that ran on the TRS-80 and the
|
||
Apple II?</p>
|
||
<p>Well, a lot really. If you’ve got nothing better to do, take a look at the
|
||
<a href="https://www.inform-fiction.org/zmachine/standards" title="Z-Machine Standards">Z-Machine Standards Document</a> which is a detailed reverse-engineering
|
||
effort of Infocom’s interpreter. A Z-machine implementation has to handle
|
||
the byte-code for an exceptionally complicated byte-code interpreter, which
|
||
in turn has to do a lot of high-level operations such as:</p>
|
||
<ul>
|
||
<li>Text encryption, decryption and decompression using a packed 5-bit modal
|
||
encoding and tables of “abbreviations”</li>
|
||
<li>Lexical input parsing and mapping words through a compressed dictionary
|
||
and a “word separator” table</li>
|
||
<li>Screen output that includes automatic word-wrapping and a status line
|
||
that shows the current room, number of moves and score (or current time,
|
||
for timed games like <em>Deadline</em>).</li>
|
||
<li>Maintaining an “Object tree” that holds the state of the objects in the
|
||
game, their containment relationships, <em>attributes</em> (openable, open, worn,
|
||
concealed, locked, etc.) and <em>properties</em> (name, description, capacity,
|
||
exits, methods, etc.)</li>
|
||
<li>Support for “virtual memory” – the virtual machine’s address space was
|
||
larger than the 16-bit addressing of the computers of the era, and certainly
|
||
larger than the 32 kilobytes of physical memory. These restrictions require
|
||
the interpreter to deal with multiple types of addresses to get at the
|
||
different types of storage.</li>
|
||
<li>File I/O for saving, restoring and restarting the game.</li>
|
||
<li>Dynamic memory areas such as the “header” and various other tables that
|
||
are used as sideband global communication between the interpreter and the
|
||
story file. Either or both can change the state, so it needs to be
|
||
explicitly checked.</li>
|
||
<li>An exceptionally <a href="https://en.wikipedia.org/wiki/Complex_instruction_set_computer" title="CISC">CISC</a>-like variable-length bytecode with variadic
|
||
parameters and complicated encodings.</li>
|
||
</ul>
|
||
<p>The interpreter is complicated because of the Herculean task the <em>Zork</em>
|
||
implementors set for themselves. <em>Zork</em> itself was originally written on a
|
||
PDP-10 mainframe at MIT running a version of Lisp called <a href="https://en.wikipedia.org/wiki/MDL_(programming_language)" title="MDL">MDL</a>. It was
|
||
designed to have a more natural parser than the two-word parser of <em>ADVENT</em>.
|
||
<em>Zork</em> itself escaped into the wild because of MIT’s connection to
|
||
<a href="https://en.wikipedia.org/wiki/ARPANET" title="ARPANET">ARPANET</a>. Contributions and requests from the player-base caused the
|
||
program to grow in size until it filled the mainframe’s megabyte of memory.
|
||
When the newly-founded Infocom decided to port their grad-school project to
|
||
the world of microcomputers, they needed to somehow move a megabyte of MDL
|
||
code onto 8-bit microcomputers with 32 kilobytes of memory. They got there by
|
||
chopping the program into three separate parts, creating a stripped-down
|
||
subset of MDL called <a href="https://www.ifwiki.org/ZIL" title="ZIL">ZIL</a> (for Zork Implementation Language) and
|
||
targeting the compiled ZIL bytecode to run on the Z-machine interpreter. The
|
||
Z-machine data types were specifically designed to reduce the memory footprint
|
||
as much as possible (including packed properties and compressed string
|
||
encodings) but the ZIL code was still too large (at over 100 kilobytes), so
|
||
the interpreter was designed to page in parts of the story file from the
|
||
floppy disk, one of the first uses of <a href="https://en.wikipedia.org/wiki/Virtual_memory" title="Virtual Memory">virtual memory</a> on personal
|
||
computers.</p>
|
||
<p>All of the above was described in a much clearer fashion by Infocom employees
|
||
in a paper called <a href="https://mud.co.uk/richard/htflpism.htm" title="ZIL paper">How to Fit a Large Program into a Small Machine</a>,
|
||
which I only discovered after writing the previous paragraph, alas. I include
|
||
it here for the curious, because you can never have enough links in your
|
||
IOCCC write-up.</p>
|
||
<h3 id="a-hollow-voice-says-fool.">A hollow voice says “Fool.”</h3>
|
||
<p>It took me many iterations to make the interpreter fit inside the IOCCC size
|
||
limits.</p>
|
||
<p>The original quite compact C program was maybe still 50% too large even after
|
||
doing as much minification as possible. I won’t go into the details of the
|
||
next iterations of reduction (that would spoil all the fun), but suffice to
|
||
say, the steps I took share some similarities to the steps the <em>Zork</em>
|
||
implementors took to do their heroic reduction. It was only by completely
|
||
throwing out any attempt to make the source code look “pretty” was I able to
|
||
cross the <code>iocccsize</code> Rule 2b limitation of 2,053, and this included abusing
|
||
the whitespace rules.</p>
|
||
<p>Of course, by time the contest was announced, the size limit had increased
|
||
which means I had to go back and undo some of my heroics because now I had
|
||
enough wiggle room to make the source more picturesque. I have however
|
||
included a version of the original source (<code>prog.alt.c</code>) for your perusal and
|
||
amusement.</p>
|
||
<!--
|
||
|
||
Copyright © 1984-2025 by Landon Curt Noll and Leonid A. Broukhis. All Rights Reserved.
|
||
|
||
You are free to share and adapt this file under the terms of this license:
|
||
|
||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||
|
||
For more information, see:
|
||
|
||
https://creativecommons.org/licenses/by-sa/4.0/
|
||
|
||
-->
|
||
<!-- AFTER: last line of markdown file: 2024/mills/README.md -->
|
||
|
||
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
|
||
|
||
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
|
||
|
||
<div id="inventory">
|
||
<h1 id="inventory-for-2024mills">Inventory for 2024/mills</h1>
|
||
</div>
|
||
<h2 id="primary-files">Primary files</h2>
|
||
<ul>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/mills/prog.c">prog.c</a> - entry source code</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/mills/Makefile">Makefile</a> - entry Makefile</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/mills/prog.alt.c">prog.alt.c</a> - alternate source code</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/mills/prog.orig.c">prog.orig.c</a> - original source code</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/mills/try.alt.sh">try.alt.sh</a> - script to try alternate code</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/mills/try.sh">try.sh</a> - script to try entry</li>
|
||
</ul>
|
||
<h2 id="secondary-files">Secondary files</h2>
|
||
<ul>
|
||
<li><a href="2024_mills.tar.bz2">2024_mills.tar.bz2</a> - download entry tarball</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/mills/README.md">README.md</a> - markdown source for this web page</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/mills/advent.z3">advent.z3</a> - Colossal Cave Adventure</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/mills/curses-r10.z3">curses-r10.z3</a> - Hunting about in the attic of your family home</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/mills/.entry.json">.entry.json</a> - entry summary and manifest in JSON</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/mills/fantasydimension.z3">fantasydimension.z3</a> - Fantasy world adventure via an enigmatic airlock</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/mills/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/mills/minizork.z3">minizork.z3</a> - Demo version of the original Zork</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/mills/moonglow.z3">moonglow.z3</a> - Spacecraft lands in a nearby corn field</li>
|
||
<li><a href=".path">.path</a> - directory path from top level directory</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/mills/sampler1_R55.z3">sampler1_R55.z3</a> - 1984 Infocom interactive fiction tutorial with 4 game samples</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/mills/sampler2.z3">sampler2.z3</a> - 1997 Infocom interactive fiction tutorial with 3 game samples</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/mills/submarine-sabotage.z3">submarine-sabotage.z3</a> - Serving aboard top-secret Puny class submarine</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/mills/tristam.z3">tristam.z3</a> - Surviving on Tristam island after a crash</li>
|
||
<li><a href="index.html">index.html</a> - this web page</li>
|
||
</ul>
|
||
<hr style="width:10%;text-align:left;margin-left:0">
|
||
<h4>
|
||
Jump to: <a href="#">top</a>
|
||
</h4>
|
||
|
||
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
|
||
|
||
<!-- END: this line ends content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
|
||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||
<!-- START: this line starts content from: inc/footer.inventory.html -->
|
||
|
||
<!--
|
||
|
||
Copyright © 1984-2025 by Landon Curt Noll. All Rights Reserved.
|
||
|
||
You are free to share and adapt this file under the terms of this license:
|
||
|
||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||
|
||
For more information, see:
|
||
|
||
https://creativecommons.org/licenses/by-sa/4.0/
|
||
|
||
-->
|
||
|
||
<div class="footer">
|
||
|
||
<div id="copyright"><h3>Copyright © 1984-2025 by Landon Curt Noll:
|
||
<a href="https://creativecommons.org/faq/#what-does-some-rights-reserved-mean"
|
||
target="_blank"
|
||
rel="license noopener noreferrer">Some Rights Reserved</a></h3>
|
||
<p>
|
||
This work is <b>licensed by Landon Curt Noll</b> under
|
||
<b><a href="https://creativecommons.org/licenses/by-sa/4.0/?ref=chooser-v1"
|
||
target="_blank"
|
||
rel="license noopener noreferrer"
|
||
style="display:inline-block;">CC BY-SA 4.0</a></b>.
|
||
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
|
||
src="../../png/cc.png"
|
||
alt="cc inside circle symbol">
|
||
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
|
||
src="../../png/by.png"
|
||
alt="person inside circle symbol">
|
||
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
|
||
src="../../png/sa.png"
|
||
alt="arrow looping back on itself inside circle symbol"><br>
|
||
You should <b>carefully review</b> the
|
||
<b><a href="https://creativecommons.org/licenses/by-sa/4.0/legalcode.en"
|
||
target="_blank"
|
||
rel="license noopener noreferrer">CC BY-SA 4.0 LEGAL CODE</a></b>
|
||
before using the licensed material.<br>
|
||
You may wish to review the
|
||
<b><a href="../../license.html"
|
||
target="_blank"
|
||
rel="license noopener noreferrer">highlights of some of the key features and terms</a></b>
|
||
of <b>CC BY-SA 4.0</b>.<br>
|
||
</p>
|
||
</div>
|
||
|
||
<div id="coda"><h3>Coda</h3>
|
||
<p>
|
||
<a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fwww.ioccc.org%2F2024%2Fmills%2Findex.html" rel="nofollow">Nu HTML check this web page</a><br>
|
||
<a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a><br>
|
||
</p>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/footer.inventory.html -->
|
||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||
|
||
</body>
|
||
</html>
|
||
|
||
<!-- END: this line ends content from: inc/bottom.default.html -->
|