build index.html for all winners

Updated manifest as per recent file changes.

Updated winner `.winner.json` to reflect the manifest changes.

Added [bin/all_run.sh](bin/all_run.sh) tool to run a command over
all winning entries.

These tools had slight improvements in the help usage message:

* bin/gen-author.sh VERSION="1.3.1 2024-01-16"
* bin/gen-inventory.sh VERSION="1.0.1 2024-01-16"
* bin/pandoc_wrapper.sh VERSION="1.3.1 2024-01-16"
* bin/subst.default.sh VERSION="1.1.1 2024-01-16"
* bin/subst.winner-index.sh VERSION="1.1.1 2024-01-16"

The `bin/readme2index.sh` tool was improved so that
if the `index.html` file exists and the tool forms
the exact same content, then the file `index.html`
file is NOT touched.

* bin/readme2index.sh VERSION="1.1 2024-01-16"

We used the following command to generate `index.html` files
for all winning entries:

```sh
bin/all_run.sh -v 3 bin/readme2index.sh
```

NOTE: We have not (yet) built HTML files above the winner directory
level (e.g., no year level nor top level HTML), nor have be built
non-index HTML files for winners.

NOTE: By default we are running `pandoc(1)` with:

```
--fail-if-warnings=true
```

This means that any problems with markdown to HTML
generates an error.  This is done to be sure that
the HTML conversion is clean.

We had to fix the following `README.md` files:

* `2000/rince/README.md`

The reference [^2] was never used.  We made a guess that [^2] applies
to the same spot as [^1].  Perhaps there is a better spot where
[^2] applies?

NOTE: For every reference, there MUST be some place where that
reference is used.

* 2012/vik/README.md

The string "$...$" is assumed to be a TeX encoded string.

NOTE: Every "$..$" needs to be backslashed as in "\$..\$".

* 2018/burton1/README.md

The reference [2] was duplicated.  We changed the
second [2] to [3].

NOTE: Every reference needs to have a unique number.

* 2020/carlini/README.md

The string "$...$" is assumed to be a TeX encoded string.

NOTE: Every "$..$" needs to be backslashed as in "\$..\$".

We also found 2 errors in the `author/author_handle.json` file set:

* author/Anonymous_2001.json

The `author/Anonymous_2001.json` file was missing.

* author/Jari_Arkko.json

The winner ID for `1989_jar.1` had a typo.
This commit is contained in:
Landon Curt Noll committed 2024-01-17 00:32:39 -08:00
1 parent 893cd915b6
commit c1466f5165
350 files changed
+95242 -4217

No files matched your search

+291 -13
View File
@@ -1,4 +1,6 @@
<!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 -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,303 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 1991/ant/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>1991 ant</title>
<meta name="description" content="IOCCC year: 1991 IOCCC winner: ant winner index page">
<meta name="keywords" content="IOCCC,1991,ant,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>1991/ant</title>
<meta name="description" content="1991 IOCCC winner ant">
<meta name="keywords" content="IOCCC, 1991, IOCCC 1991, IOCCC winner, ant">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>1991 ant</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>1991/ant</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.first.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F1991%2Fant%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1991/ant/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left Disabled" href="#">first entry</a>
<a class="Left" href="../index.html">&uarr; 1991 &uarr;</a>
<a class="Left" href="../brnstnd/index.html">brnstnd &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.first.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#Anthony_C_Howe">Anthony C.
Howe</a><br> Location: <a
href="/temp-test-ioccc/location.html#CA">CA</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> all</span></code></pre></div>
<p>There is an <a href="#alternate-code">alternate version</a> that
might feel a bit more familiar to vi(m) users.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./ant</span> some_file</span></code></pre></div>
<p>NOTE: the file must already exist and not specifying any arg will
make the program exit without doing anything.</p>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> hill</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./ant</span> hill</span></code></pre></div>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> mole</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./ant</span> mole</span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>This version changes the commands slightly so that to go to the first
column you should enter <code>0</code>, to go to the last column you
should enter <code>$</code>, to quit you should enter <code>q</code>, to
go back a word you should enter <code>b</code> and to go forwards a word
you should enter <code>w</code>. Also, and perhaps most useful, rather
than having to hit ctrl-L (form-feed, <code>\f</code>) to get back to
command mode you can use the usual ESC (<code>\x1b</code>).</p>
<p>These will make it slightly less unwieldy for those familiar with
vi(m); the rest was unchanged.</p>
<h3 id="alternate-build">Alternate build:</h3>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>ant.alt</code> as you would <code>ant</code> above with the
changes in the input keys. See the author’s remarks for the remaining
keys.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>The author was kind enough to supply a list of references below, in
case you are still confused after read the source! :-)</p>
<p>BTW: you’ve most likely heard the joke that if you want a
pseudo-random string of characters you can put a user unfamiliar with
vi(m) in a vi(m) session (in insert mode) and ask them to exit. Well in
this case you’re likely to have this problem if you ARE a vi(m) user!
:-) … especially if you don’t read the information below. This means if
you’re reading this in vi(m) you’ll have to exit this like in normal
vi(m) and then try the same with <code>./ant</code> only to fail.
:-)</p>
<p>NOTE: to enter form feed you should be able to hit
<code>ctrl-L</code>. This will allow you to exit insert mode rather than
ESC like in normal vi(m). See the author’s commands section for other
commands.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>Ant’s Editor vIOCCC91</p>
<p>Text files consists of lines of printable text or tab characters. A
line can be of arbitrary length and is delimited by either a newline or
the end of file. Carriage return is mapped to newline on input and
ignored on output. Tab stops are every eight columns. Non-printable
characters may have unpredictable results depending on the
implementation of <code>curses</code>.</p>
<h3 id="commands">Commands</h3>
<ul>
<li>h j k l left, down, up, right cursor movement</li>
<li>H J K L word left, page down, page up, word right</li>
<li><label><input type="checkbox" />beginning and end of
line</label></li>
<li>t b top and bottom of file</li>
<li>i enter insert mode, form-feed to quit</li>
<li>x delete character under the cursor</li>
<li>W write buffer to file</li>
<li>R refresh the screen</li>
<li>Q quit</li>
</ul>
<h3 id="exit-status">Exit status</h3>
<ul>
<li>0 success</li>
<li>2 missing edit filename</li>
</ul>
<h3 id="about-this-entry">About this entry</h3>
<p>The <code>BUF</code> size should be set at compile time to 32767.
This value was used because the Sozobon C compiler for the Atari ST has
16 bit ints and a limit on the size of arrays &amp; structures of 32k.
Also the WatCom C compiler for the PC also has 16 bits ints. On machines
that have 32 bit ints (most unix boxes), a larger value for
<code>BUF</code> could be used.</p>
<p>It is recommend that compact memory model be used on PC class
machines. Small memory model may work too provided <code>BUF</code> is
not too large.</p>
<p>The character constants <code>'\b'</code>, <code>'\f'</code>,
<code>'\n'</code>, <code>'\r'</code>, <code>'\t'</code> are used in
order to provide more portable code, since the compiler should handle
the translation of them into the native character set. Note that
<code>'\f'</code> (form-feed) was used to exit insert mode because
K&amp;R C had no escape constant for the escape-key.</p>
<p>My goals for this project were to learn and experiment with the
Buffer Gap Scheme [Fin80][net90], write a useful and <em>portable</em>
program, and meet the requirements of the IOCCC. I initially planned to
have a mini <code>curses</code> built-in like the <a
href="/1989/tromp/README.md">IOCCC Tetris entry from a previous
year</a>, however this was not as portable as using a
<code>curses</code> library with
<code>TERMINFO</code>/<code>TERMCAP</code> support.</p>
<p>I plan to post follow-ups such as unobfuscated versions and bugs
fixes to comp.editors. Reposts of the editor.101, gap.doc, and
editor.102 can be found in the same group every so often.</p>
<p>This entry will display a file with long lines, but has trouble
scrolling the screen with long lines. Paging up and down should work
correctly, however.</p>
<h3 id="references">References:</h3>
<p>[Fin80] Craig A. Finseth, “Theory and Practice of Text Editors
or<br />
A Cookbook For An EMACS”, TM-165, MIT Lab. for Computer<br />
Science</p>
<p>[KeP81] Kernighan &amp; Plauger, “Software Tools in Pascal”,<br />
Addison-Wesley, 81, chapter 6</p>
<p>[Mil86] Eugene W. Myers &amp; Webb Miller, “Row-replacement
Algorithms for Screen Editors”, TR 86-19, Dept. of Computer
Science,<br />
U. of Arizona</p>
<p>[MyM86] Eugene W. Myers &amp; Webb Miller, “A simple
row-replacement<br />
method”, TR 86-28, Dept. of Computer Science, U. of Arizona</p>
<p>[Mil87] Webb Miller, “A Software Tools Sampler”, Prentice Hall, 87
ISBN 0-13-822305-X, chapter 5</p>
<p>[net90] “Editor 101/102” articles from comp.editors</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-1991ant"><a name="inventory"></a>Inventory for
1991/ant</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/ant/ant.c">ant.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/ant/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/ant/ant.alt.c">ant.alt.c</a>
- alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/ant/ant.orig.c">ant.orig.c</a>
- original source</li>
<li><a href="1991_ant.tar.bz2">1991_ant.tar.bz2</a> - download winning
source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/ant/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/ant/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/ant/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F1991%2Fant%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+401 -13
View File
@@ -1,4 +1,6 @@
<!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 -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,413 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 1991/brnstnd/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>1991 brnstnd</title>
<meta name="description" content="IOCCC year: 1991 IOCCC winner: brnstnd winner index page">
<meta name="keywords" content="IOCCC,1991,brnstnd,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>1991/brnstnd</title>
<meta name="description" content="1991 IOCCC winner brnstnd">
<meta name="keywords" content="IOCCC, 1991, IOCCC 1991, IOCCC winner, brnstnd">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>1991 brnstnd</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>1991/brnstnd</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F1991%2Fbrnstnd%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1991/brnstnd/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../ant/index.html">&larr; ant</a>
<a class="Left" href="../index.html">&uarr; 1991 &uarr;</a>
<a class="Left" href="../buzzard/index.html">buzzard &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#Daniel_J_Bernstein">Daniel J.
Bernstein</a><br> Location: <a
href="/temp-test-ioccc/location.html#US">US</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> all</span></code></pre></div>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./sorta</span> <span class="op">&lt;</span> sorta.itailrec</span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>For info on more examples, read the <a
href="sorta.README.md">sorta.README.md</a> file.</p>
<p>The author wished to win the “most useful program” award and
documented this in the source code. The judges were unmoved by this
blatant attempt to influence the contest and rejected this idea… so we
gave it the “Best of Show” instead!!</p>
<p>NOTE: One should remove the final trailing newline to obtain the
original source file. This step is not needed to compile this entry.</p>
<p>To have a chance to compile under a modern CPP, we had to replace
<code>#D</code> with <code>#define</code>.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This is an interpreter for the programming language SORTA, a systems
and numerical programming language with features sorta from C, sorta
from FORTH, and sorta from Ada.</p>
<p>SORTA lets you manipulate files and spawn programs easily, has
bitwise operators, and gives you absolutely brilliant error messages
like ‘?’ (that’s the C bit). SORTA programs work with a stack (that’s
the FORTH bit)—actually two stacks, one for integers and one for
strings. And all SORTA operations are strongly typed, detect practically
any failure, and garbage-collect (that’s the Ada bit).</p>
<p>SORTA also contains features you might not expect from such a small
interpreter: arbitrary-length string input and concatenation, for
instance, not to mention infinite-depth tail recursion.</p>
<p>SORTA ignores its arguments (though it makes them available to the
script); it takes all commands, character by character, from its
standard input. Unrecognized commands are repeated with a ‘?’.</p>
<p>SORTA maintains an <code>i</code> stack for integers and an
<code>s</code> stack for strings. It also keeps track of
<code>programs</code>, one for each character. Operations are silently
ignored if the relevant stacks are too low, except as noted for
<code>s</code>, <code>S</code>, and <code>!</code>. If the
<code>i</code> stack or <code>s</code> stack (or the stack of buffered
macro commands) grows too high, SORTA will exit silently with exit code
2. (Compile parameter <code>-Do=250</code> controls what ‘too high’
means; you should not make <code>o</code> larger than 250.) I don’t
think it’s possible to crash the interpreter.</p>
<p>Here, then, is the SORTA programming language. All non-digits delimit
numeric constants. Spaces and newlines are ignored except as numeric
delimiters.</p>
<h3 id="basic-operations">Basic operations</h3>
<ul>
<li><code>q</code>: quit</li>
<li><code>number</code>: push that number on top of the <code>i</code>
stack</li>
<li><code>"string"</code>: push that string on top of the <code>s</code>
stack, no length limit</li>
<li><code>[string]</code>: push that string on top of the <code>s</code>
stack, no length limit</li>
<li><code>#</code>: make top of <code>i</code> stack non-destructively
in ASCII, push result onto <code>s</code> stack</li>
<li><code>`</code>: print top of <code>s</code> stack
non-destructively</li>
<li><code>$</code>: print top of <code>s</code> stack non-destructively
without newline</li>
<li><code>d</code>: drop (pop) top of <code>i</code> stack</li>
<li><code>D</code>: dup (duplicate) top of <code>i</code> stack</li>
<li><code>'</code>: dup top of <code>s</code> stack</li>
<li><code>s</code>: pop top of <code>i</code> stack. If it is
<code>n</code>, swap <code>(n+1)</code>th-top of <code>i</code> stack
with top. <code>1s</code>, for example, swaps the top two elements;
<code>2s</code> swaps the top with the third down; etc. This always pops
the top of the <code>i</code> stack, even upon failure.</li>
<li><code>S</code>: pop top of <code>i</code> stack, then act just like
<code>s</code> but upon <code>s</code> stack</li>
<li><code>l</code>: pop top of <code>s</code> stack, push its length
onto <code>i</code> stack</li>
<li><code>a</code>: push argc onto <code>i</code> stack</li>
<li><code>A</code>: pop top of <code>i</code> stack, push
<code>argv[i]</code> on top of <code>s</code> stack</li>
<li><code>T</code>: concatenate top two elements of <code>s</code>
stack</li>
<li><code>_</code>: negate top of <code>i</code> stack</li>
<li><code>+</code>: pop top two elements of <code>i</code> stack, add,
push back sum</li>
<li><code>*</code>: pop top two elements of <code>i</code> stack,
multiply, push back product</li>
<li><code>/</code>: pop top two elements of <code>i</code> stack,
divide, push back quotient</li>
<li><code>&gt;</code>: pop top two elements of <code>i</code> stack,
compare, push back 1 or 0 as in C</li>
<li><code>&amp;</code>: pop top two elements of <code>i</code> stack,
NAND, push back bitwise result Note that NAND is sufficient to construct
all bitwise operations, as demonstrated by <code>icalc</code> in <a
href="sorta.README.md">sorta.README.md</a>.</li>
</ul>
<h3 id="system-operations">System operations</h3>
<ul>
<li><code>o</code>: pop top of <code>s</code> stack and top two of
<code>i</code> stack; <code>open(s1,i2,i1);</code> leave result on
<code>i</code> stack</li>
<li><code>O</code>: pop top of <code>i</code> stack,
<code>close()</code> it</li>
<li><code>u</code>: pop top of <code>i</code> stack, <code>dup()</code>
it, push result back on</li>
<li><code>F</code>: <code>fork()</code>, push result on <code>i</code>
stack. This is not always safe while SORTA is reading keyboard input or
a script, as the forked programs share file descriptors. It is always
safe inside a program (see below).</li>
<li><code>P</code>: <code>pipe()</code>, push two ends
<code>&lt;p0&gt; &lt;p1&gt;</code> onto <code>i</code> stack. In case of
trouble, <code>push &lt;?&gt; &lt;-1&gt;</code> onto <code>i</code>
stack.</li>
<li><code>w</code>: <code>wait()</code>, push successful result (or
<code>-1</code> if no children) on <code>i</code> stack</li>
<li><code>!</code>: <code>execvp()</code> top of the <code>s</code>
stack. Arguments are the next things down on the <code>s</code> stack,
in reverse order from popping; the first character of each string is
lopped off. There must be an empty string somewhere in the
<code>s</code> stack to terminate the argument list. If the
<code>execve()</code> fails, any operation involving current members of
the <code>s</code> stack has undefined effects, and <code>-1</code> is
pushed onto the <code>i</code> stack.</li>
</ul>
<h3 id="high-level-language-operations">High-level language
operations</h3>
<ul>
<li><code>:x</code>: copy the top of the <code>s</code> stack into a
program labeled by character <code>x</code></li>
<li><code>=x</code>: pop the top of the <code>i</code> stack. If it was
nonzero, execute the program labeled by character <code>x</code>. Note
that a digit at the end of a program will merge with any digits after
<code>=x</code>; in that case you usually want to add a space at the end
of the program.</li>
</ul>
<p>Common idioms: To drop the top of the <code>s</code> stack,
<code>ld</code>. To do a <code>&lt;</code>, <code>1s&gt;</code>. To
unconditionally execute the program labeled by character <code>x</code>,
<code>1=x</code> (or any nonzero number followed by <code>=x</code>). To
print the top of the <code>i</code> stack non-destructively,
<code>#</code> (or <code>#$</code> if you don’t want the newline). To
subtract, <code>_+</code>. To do mod or and or any of the other missing
operations, combine the available operations as illustrated below. To
introduce a comment,
<code>[ this is a comment string which is promptly eliminated ]ld</code>.</p>
<p><code>SORTA</code>’s requirements: it wants <code>fork()</code>,
<code>execvp()</code>, <code>open()</code>, <code>close()</code>,
<code>dup()</code>, <code>pipe()</code>, and <code>wait()</code>, so it
obviously won’t even compile on a non-UNIX machine. It also assumes that
you have a size-256 character set and that the characters between
<code>'0'</code> and <code>'9'</code> are exactly the digits in order.
It does <em>not</em> depend on ASCII, despite the code appearance. Also
note that SORTA does not attempt to declare <code>malloc()</code>, so
you will get some warnings about illegal pointer combinations. Also note
that there are unreachable statements in SORTA.</p>
<p>While the program source of course depends highly on
<code>#define</code>s for obfuscation, I like to think that this code
has those little touches, those professionally sharpened edges that mark
true software engineering. Observe, for instance, how <code>i</code> and
<code>s</code> are the string and integer stacks respectively. It’s
these little things that make you feel at home in an otherwise utterly
useless piece of code. They’re what make an obfuscation work.</p>
<p>The character pool (<code>I</code> after cpp) makes it rather painful
to see the effect of commands at a glance. I can just imagine people
spending hours bouncing between the pool and the rest of the code, or
accidentally changing the pool without realizing its importance. Without
documentation and example scripts, someone would find it a challenge to
figure out what the arrays are used for, let alone that SORTA is a
scripting language.</p>
<p>Another nice feature is that the SORTA language itself encourages you
to write not merely obfuscated but plain incomprehensible scripts (like
the <a href="sorta.README.md">examples in sorta.README.md</a> —after
working with the language for a while, I guess I can read it pretty
easily, but I also think FORTH is a beautiful language). The numbers
running around everywhere will make people think of ASCII, even though
the code is not ASCII-dependent. What’s your first thought when you see
several <code>arrays[256]</code>? This is pretty standard obfuscation
otherwise. I like the way that unbalanced macro braces can throw off the
reader in <code>if(c&gt;0){y+1]=z[c];</code>, and I had fun covering the
alphabet with <code>#define</code>s, but that’s nothing special.</p>
<p>Possible future extensions to SORTA include string extraction and
matching, reading from files into strings, and encrypting the string
pool to further confuse the judges. I don’t think I can fit this into
the size limit, unfortunately.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-1991brnstnd"><a name="inventory"></a>Inventory for
1991/brnstnd</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/brnstnd.c">brnstnd.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/brnstnd.orig.c">brnstnd.orig.c</a>
- original source</li>
<li><a href="sorta.README.html">sorta.README.html</a> - SORTA language
infomation</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/try.sh">try.sh</a>
- how to run</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/try.txt">try.txt</a>
- input data for try.sh</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.i2+2">sorta.i2+2</a>
- SORTA source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.iarg0">sorta.iarg0</a>
- SORTA source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.icalc">sorta.icalc</a>
- SORTA source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.idup">sorta.idup</a>
- SORTA source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.iecho">sorta.iecho</a>
- SORTA source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.ifact1">sorta.ifact1</a>
- SORTA source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.ifact2">sorta.ifact2</a>
- SORTA source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.ifact3">sorta.ifact3</a>
- SORTA source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.iio">sorta.iio</a>
- SORTA source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.irot13">sorta.irot13</a>
- SORTA source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.isleep">sorta.isleep</a>
- SORTA source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.itailrec">sorta.itailrec</a>
- SORTA source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.iwhosort">sorta.iwhosort</a>
- SORTA source</li>
<li><a href="1991_brnstnd.tar.bz2">1991_brnstnd.tar.bz2</a> - download
winning source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/README.md">README.md</a>
- markdown source for index.html</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/brnstnd/sorta.README.md">sorta.README.md</a>
- markdown source for sorta.README.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F1991%2Fbrnstnd%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+244 -13
View File
@@ -1,4 +1,6 @@
<!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 -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,256 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 1991/buzzard/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>1991 buzzard</title>
<meta name="description" content="IOCCC year: 1991 IOCCC winner: buzzard winner index page">
<meta name="keywords" content="IOCCC,1991,buzzard,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>1991/buzzard</title>
<meta name="description" content="1991 IOCCC winner buzzard">
<meta name="keywords" content="IOCCC, 1991, IOCCC 1991, IOCCC winner, buzzard">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>1991 buzzard</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>1991/buzzard</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F1991%2Fbuzzard%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1991/buzzard/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../brnstnd/index.html">&larr; brnstnd</a>
<a class="Left" href="../index.html">&uarr; 1991 &uarr;</a>
<a class="Left" href="../cdupont/index.html">cdupont &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#Sean_Barrett">Sean Barrett</a><br>
Location: <a href="/temp-test-ioccc/location.html#null">unknown</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> all</span></code></pre></div>
<p>There is an <a href="#alternate-code">alternate version</a> which
might feel more at home for vi(m) users in navigation.</p>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code>STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a
href="/bugs.md#1991-buzzard">1991 buzzard in bugs.md</a>.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./buzzard</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>This version changes the keys <code>f</code> for forward,
<code>l</code> for left and <code>r</code> for right by default to
<code>k</code> for forward, <code>l</code> for right and <code>h</code>
for left, which is more natural for those who use vi(m). Also one can
just hit <code>q</code> followed by enter to quit the maze. It is
problematic to reconfigure the keys except by modifying the code
directly so the keys are not made a <code>-D</code> at the compiler.</p>
<h3 id="alternate-build">Alternate build:</h3>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./buzzard.alt</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>You will be A-mazed.</p>
<p>You are invited to try to cheat, … if you can figure out how! :-)</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="how-to-play">How to play</h3>
<p>When the game starts, you are at the far end of the maze from the
exit, looking down a corridor. To move forward, type <code>f</code> and
press return. To turn 90 degrees right, type <code>r</code>; and for
left, <code>l</code>. You can put multiple commands on one line, and the
new view will be drawn after all the moves.</p>
<p>The game ends if you get out the exit (you’ll know it when you see
it) or when you type <code>^D</code> (EOF).</p>
<h3 id="hints-on-how-to-cheat">Hints on how to cheat</h3>
<p>You can, of course, cheat by looking at the maze map. The question
you need to ask yourself, though, is what sequence of characters marks
the place where you can escape the maze?</p>
<p>The algorithm is quite bizarre–the primary nested loop that generates
it goes top to bottom on the display, looping forward then backward from
the current position to draw the left side and then the right side.</p>
<h3 id="advanced-usage-notes">Advanced usage notes</h3>
<p>The program can also be run from other files containing mazes. The
maze should be laid out graphically in the obvious format; newlines
separate physical rows in the maze; a space indicates a corridor, and
any other character is a wall. Tabs are also considered walls, so make
sure to convert tabs to spaces before using it.</p>
<p>Usage:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./buzzard</span> [filename [escape-char [start-x start-yNNN</span></code></pre></div>
<p>Filename is the name of the file containing the maze. This defaults
to <code>buzzard.c</code> or rather <code>__FILE__</code>.</p>
<p>Escape-char is the character in the maze that represents the exit.
You can put more than one exit in the maze (for example, you could make
all ’!’s in the maze be exits).</p>
<p>Start-x and start-y mark the coordinates where you begin playing. Y
coordinate is down the rows in the files, X is to the right through the
characters of each line. Both X and Y begin counting from 0. The default
is start-x = 4, start-y = 5, which is needed for the buzzard.c, but
would probably be inappropriate for other mazes.</p>
<h3 id="bugs">BUGS:</h3>
<p>You can’t change that at start you’re facing down (“south”).</p>
<p>The drawing algorithm cannot handle open spaces (two successive
side-corridors with no wall between them). In fact, it cannot handle
small dog-legs properly, although the error is subtle.</p>
<p>The exit is drawn like a normal corridor from the side view; it’s
only displayed as the exit when you are facing it.</p>
<p>Improper command line arguments are not handled nicely.</p>
<p>Mazes with openings at the edges will cause the drawing program to
reach into arbitrary parcels of memory.</p>
<p>The program assumes that tabs are set to 8 characters.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-1991buzzard"><a name="inventory"></a>Inventory for
1991/buzzard</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/buzzard/buzzard.c">buzzard.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/buzzard/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/buzzard/buzzard.alt.c">buzzard.alt.c</a>
- alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/buzzard/buzzard.orig.c">buzzard.orig.c</a>
- original source</li>
<li><a href="1991_buzzard.tar.bz2">1991_buzzard.tar.bz2</a> - download
winning source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/buzzard/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/buzzard/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/buzzard/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F1991%2Fbuzzard%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+192 -13
View File
@@ -1,4 +1,6 @@
<!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 -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,204 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 1991/cdupont/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>1991 cdupont</title>
<meta name="description" content="IOCCC year: 1991 IOCCC winner: cdupont winner index page">
<meta name="keywords" content="IOCCC,1991,cdupont,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>1991/cdupont</title>
<meta name="description" content="1991 IOCCC winner cdupont">
<meta name="keywords" content="IOCCC, 1991, IOCCC 1991, IOCCC winner, cdupont">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>1991 cdupont</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>1991/cdupont</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F1991%2Fcdupont%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1991/cdupont/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../buzzard/index.html">&larr; buzzard</a>
<a class="Left" href="../index.html">&uarr; 1991 &uarr;</a>
<a class="Left" href="../davidguy/index.html">davidguy &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#Christian_Dupont">Christian
Dupont</a><br> Location: <a
href="/temp-test-ioccc/location.html#FR">FR</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> all</span></code></pre></div>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./cdupont</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Why is the following label necessary?</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>sorryfor_this_unused_but_very_needed_label<span class="op">:</span></span></code></pre></div>
<p>Notice that if you C beautify (cb) or pre-process this program, it
will no longer work correctly, if at all. (go ahead, try it… :-))</p>
<p>NOTE: One should remove the final trailing newline to obtain the
original source file. This step is not needed to compile this entry.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>The source code holds the letters of the message. Each letter,
combined with another key letter, is used to compute the coordinates of
the next letter and key. Thus, the message is code. That is why I use
silly comments, most often badly spaced.</p>
<p>The space character sequence between the words is given by a simple
computation in an octal constant (given here as an hex value, of
course).</p>
<p>This way, any message can be mixed into a code, since the keys allow
you to place the meaningful letters wherever you want.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-1991cdupont"><a name="inventory"></a>Inventory for
1991/cdupont</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/cdupont/cdupont.c">cdupont.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/cdupont/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/cdupont/cdupont.orig.c">cdupont.orig.c</a>
- original source</li>
<li><a href="1991_cdupont.tar.bz2">1991_cdupont.tar.bz2</a> - download
winning source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/cdupont/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/cdupont/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/cdupont/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F1991%2Fcdupont%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+254 -13
View File
@@ -1,4 +1,6 @@
<!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 -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,266 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 1991/davidguy/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>1991 davidguy</title>
<meta name="description" content="IOCCC year: 1991 IOCCC winner: davidguy winner index page">
<meta name="keywords" content="IOCCC,1991,davidguy,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>1991/davidguy</title>
<meta name="description" content="1991 IOCCC winner davidguy">
<meta name="keywords" content="IOCCC, 1991, IOCCC 1991, IOCCC winner, davidguy">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>1991 davidguy</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>1991/davidguy</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F1991%2Fdavidguy%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1991/davidguy/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../cdupont/index.html">&larr; cdupont</a>
<a class="Left" href="../index.html">&uarr; 1991 &uarr;</a>
<a class="Left" href="../dds/index.html">dds &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#David_Applegate">David
Applegate</a><br> Location: <a
href="/temp-test-ioccc/location.html#US">US</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> all</span></code></pre></div>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./davidguy</span> ip_address:server.screen</span></code></pre></div>
<p>where <code>ip_address</code> in an IP address of an X server.</p>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./davidguy</span> 127.0.0.1:0.0</span></code></pre></div>
<p>Of course, you may need to supply a more reasonable address. :-)</p>
<h2 id="also-try">Also try:</h2>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cp</span> <span class="at">-f</span> davidguy guydavid</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./guydavid</span> 127.0.0.1:0.0</span></code></pre></div>
<p>Can you determine why this makes a difference?</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>We permitted this type of entry to win because:</p>
<ul>
<li>it did not require X to be on the host system</li>
<li>both BSD and SVR4 have sockets</li>
</ul>
<p>Now that X11 and sockets have become ‘standard’, we plan to open up
the contest to programs that use them. Future rules will explain this
further.</p>
<p>We are pleased that this entry has helped bring new ‘life’ into the
contest.</p>
<h2 id="authors-remarks">Authors’ remarks:</h2>
<p>The program is a fully-functional X client. It talks directly to the
X server through a socket without using Xlib, Xt or any other wussy
toolkit junk. With no arguments, it will try to run locally using the
unix-domain socket (only on BSD :-( ) or you can give it a command line
argument identifying a display host address (in dotted octet notation,
like 127.0.0.1:0.0) where the X server is running. It handles color and
monochrome displays, and performs whatever byte-swapping and
bit-reversal is needed (so that the program works even when the server
and the client have different architectures). It buffers communication
to the X server for efficiency.</p>
<p>NOTE: The original source in davidguy.c used only an IP address
argument (assumed :0.0) and assumed the color of black and white.</p>
<p>The program doesn’t require any user interaction; you can just sit
back and watch it run. All the action takes place in the root window of
the display.</p>
<p>We think the program is interesting for these reasons:</p>
<ol type="1">
<li><p>It belongs to a class of programs that programmers make the
following complaints about: they require a mountain of code to implement
even the simplest program; and they must be linked with giant libraries
of hard-to-understand functions. In contrast to these complaints (made
by wimps, in our humble opinion), our program fits in under 1536 bytes,
doesn’t need any external functions except for a few system calls, and
doesn’t need to include any header files.</p></li>
<li><p>It implements an extremely efficient algorithm for the
computation it performs. One cool feature of the algorithm (at least as
far as this contest is concerned) is that its obscurity is fundamentally
necessary for its efficiency. In other words, even if we took steps to
present the algorithm clearly, (we haven’t) the relation of the
computation performed to the specification of what the program was
supposed to do would still be hard to understand.</p></li>
</ol>
<h3 id="quasi-spoiler-on-internals">Quasi-spoiler on internals:</h3>
<p>The program plays <a
href="https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life">Conway’s
Game of Life</a> in the root window’s background pixmap. It starts by
setting the background to random bits, and then plays Life, with one
Life cell for each pixel of the screen. In the game of Life, a cell
survives to the next round if 2 or 3 of its 8 neighbors are also alive,
and a cell is born if exactly 3 of its neighbors are alive. Otherwise, a
cell dies of exposure if it has only 0 or 1 neighbors, and dies of
overcrowding if it has 4 or more neighbors.</p>
<p>The algorithm used to compute the next generation is based on the
observation that a cell’s state in the next generation is a boolean
function of its current state, and the states of its 8 neighbors (i.e.,
a boolean function from 9 bits to 1 bit). This function can be computed
by a boolean circuit. In addition, intermediate values computed by the
circuit can be shared between neighboring cells, reducing the number of
gates per cell required. These ideas have been used before, to compute
the next generation through a series of <a
href="https://en.wikipedia.org/wiki/Bit_blit">bit blits</a>.</p>
<p>Instead of doing this, we map values in the circuit to bits in
registers, so that the next generation can be computed efficiently
within registers, minimizing memory access. As a result, the computation
of the next generation is performed with about 1.6 instructions per life
cell, consisting of .125 memory accesses, .17 shifts, and 1.3 logic
operations. The net result is that the time to transfer the bits to the
X server, and for the X server to draw them on the screen, dominates the
time to compute the next generation.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-1991davidguy"><a name="inventory"></a>Inventory
for 1991/davidguy</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/davidguy/davidguy.c">davidguy.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/davidguy/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/davidguy/davidguy.orig.c">davidguy.orig.c</a>
- original source</li>
<li><a href="1991_davidguy.tar.bz2">1991_davidguy.tar.bz2</a> - download
winning source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/davidguy/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/davidguy/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/davidguy/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F1991%2Fdavidguy%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+250 -13
View File
@@ -1,4 +1,6 @@
<!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 -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,262 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 1991/dds/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>1991 dds</title>
<meta name="description" content="IOCCC year: 1991 IOCCC winner: dds winner index page">
<meta name="keywords" content="IOCCC,1991,dds,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>1991/dds</title>
<meta name="description" content="1991 IOCCC winner dds">
<meta name="keywords" content="IOCCC, 1991, IOCCC 1991, IOCCC winner, dds">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>1991 dds</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>1991/dds</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F1991%2Fdds%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1991/dds/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../davidguy/index.html">&larr; davidguy</a>
<a class="Left" href="../index.html">&uarr; 1991 &uarr;</a>
<a class="Left" href="../fine/index.html">fine &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#Diomidis_Spinellis">Diomidis
Spinellis</a><br> Location: <a
href="/temp-test-ioccc/location.html#GR">GR</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> all</span></code></pre></div>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./dds</span> basic_program</span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./a.out</span> <span class="dv">2</span><span class="op">&gt;</span>/dev/null</span></code></pre></div>
<h2 id="try">Try:</h2>
<p>The author suggests trying:</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./dds</span> LANDER.BAS</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./a.out</span></span></code></pre></div>
<p>Notice that a file <code>a.c</code> has been generated. Can you tell
how <code>a.c</code> was produced? How does <code>a.c</code> relate to
<a href="LANDER.BAS">LANDER.BAS</a>?</p>
<p>What happens if you give the program a C program like itself?
Try:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./dds</span> dds.c</span></code></pre></div>
<p>You’ll get errors yes but what does the generated file look like?
What about other types of files?</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This obfuscated program translates BASIC programs into obfuscated C
programs by way of an obfuscated algorithm.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This program is a companion to the <a
href="/1990/dds/README.md">DDS-BASIC interpreter program</a> that was
submitted to <a href="/years.html#1990">the contest in 1990</a>. This
compiles BASIC programs into compilable C code and then compiles it. The
input format is almost identical to the input format of the DDS-BASIC
interpreter. The program needs an executable C compiler called
<code>cc</code> in your path in order to work.</p>
<h3 id="program-commands">Program commands:</h3>
<ul>
<li>variable names <code>A</code> to <code>Z</code></li>
<li>FOR var = exp TO exp</li>
<li>GOSUB exp</li>
<li>GOTO exp</li>
<li>INPUT variable</li>
<li>PRINT exp</li>
<li>REM any text</li>
<li>variables initialized to 0 on RUN</li>
<li>NEXT variable</li>
<li>RETURN</li>
<li>IF exp THEN exp</li>
<li>PRINT string</li>
<li>var = exp</li>
<li>END</li>
</ul>
<p>Expressions are the same as the expressions of the C language. Many
system calls and C library calls can be used.</p>
<h3 id="input-format">Input format:</h3>
<ul>
<li>Free format positioning of tokens on the line.</li>
<li>No space is allowed before the line number.</li>
<li>Exactly one space is needed after the <code>FOR</code> and
<code>NEXT</code> tokens.</li>
<li>ALL INPUT MUST BE UPPERCASE.</li>
</ul>
<h3 id="error-checking-error-reports">Error checking / error
reports:</h3>
<p>The compiler silently ignores many errors. Other errors may produce
errors in later phases of the compilation.</p>
<h3 id="can-you-figure-out-how-the-compiler-works">Can you figure out
how the compiler works?</h3>
<h4 id="hint">Hint:</h4>
<p>The compiler is NOT written in C, so this is really a meta-obfuscated
program. The C code is an interpreter for the four register, seven
instruction <code>COGNIMP$</code> machine that is contained in the
<code>s</code> string. (<code>COGNIMP$</code> is named after the
symbolic names of the seven instructions it defines (<code>Copy</code>,
<code>Output</code>, <code>Goto</code>, <code>iNcrement</code>,
<code>If</code>, <code>Match</code> and <code>Print</code>).</p>
<p>The <code>$</code> sign is used for labels. The actual compiler is
written in <code>COGNIMP$</code>. Browsing through the
<code>COGNIMP$</code> code we encourage you to examine the loops for
scanning the expression in the <code>IF</code> statement and the way a
decision tree is implemented in order to match the statements. (Of
course the <code>s</code> string is encoded by adding one to every
character of it just to confuse you).</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-1991dds"><a name="inventory"></a>Inventory for
1991/dds</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/dds/dds.c">dds.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/dds/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/dds/dds.orig.c">dds.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/dds/LANDER.BAS">LANDER.BAS</a>
- BASIC source code</li>
<li><a href="1991_dds.tar.bz2">1991_dds.tar.bz2</a> - download winning
source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/dds/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/dds/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/dds/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F1991%2Fdds%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+250 -13
View File
@@ -1,4 +1,6 @@
<!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 -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,262 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 1991/fine/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>1991 fine</title>
<meta name="description" content="IOCCC year: 1991 IOCCC winner: fine winner index page">
<meta name="keywords" content="IOCCC,1991,fine,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>1991/fine</title>
<meta name="description" content="1991 IOCCC winner fine">
<meta name="keywords" content="IOCCC, 1991, IOCCC 1991, IOCCC winner, fine">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>1991 fine</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>1991/fine</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F1991%2Ffine%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1991/fine/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../dds/index.html">&larr; dds</a>
<a class="Left" href="../index.html">&uarr; 1991 &uarr;</a>
<a class="Left" href="../rince/index.html">rince &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#Thomas_A_Fine">Thomas A.
Fine</a><br> Location: <a
href="/temp-test-ioccc/location.html#US">US</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> all</span></code></pre></div>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="bu">echo</span> text <span class="kw">|</span> <span class="ex">./fine</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<p>Make sure that you read the last line backwards! Credit goes to <a
href="/winners.html#Brian_Westley">Merlyn LeRoy (Brian Westley)</a> for
that. See his 22 August 1992 <a
href="https://groups.google.com/g/rec.puzzles/c/z_xVPMRVBtg/m/lyEYSAeBD4gJ">rec.puzzles
post</a>. Some others come from his 1989 entry as well. To those who
have a harder time reading backwards it says:
<code>Gary lent the rug</code>, rotated from
<code>the rug gary lent</code>!</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This filter, 80 chars plus a newline, fits into a single line on most
terminals (unless your terminal has a line wrap mis-feature :-)).</p>
<p>Note in 2023: fixing this entry to work with modern systems increased
the size, originally to 106 characters but it was dropped back down to
80 with clever use of the Makefile.</p>
<p>This entry is likely one of the smallest C implementations of this
filter, excluding programs that resort to command line or include file
tricks.</p>
<p>How does this program work? Which 3 bytes of C code can be changed
into 2 bytes, allowing the program to still work, but also stripping the
high bit off some input?</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>The author wishes to thank J Greely for the last 6 bytes.</p>
<p>Here’s about how it does it:</p>
<p>NOTE: Bits are referred to as 76543210, high to low.</p>
<ol type="1">
<li><p>Get the character in variable <code>a</code>. Note the fun way we
check for <code>EOF</code>. (thanks J).</p></li>
<li><p>Reverse bit 6, and strip bit 5. Bit 6 determines (mostly) whether
or not this character is a letter. Bit 5 would determine case if we
cared. Assign this value to variable <code>b</code> (We need to save it,
since we need to make 2 comparisons and maybe one operation with this
value). We can’t abuse our first variable, since it saves the bits we’re
changing.</p></li>
<li><p>Check this value to see if it is a letter. It must be non-zero -
if it is zero, then we have either the <code>@</code> (64) or the
<code>`</code> (96). It also must be less than 27 - this checks the
range for letters as well as implicitly checking the value of bit 6 (if
it was originally clear, it is set now, so <code>b</code> would be too
big).</p></li>
<li><p>If it is not a letter, the conditional expression inside of the
<code>putchar()</code> returns the original character (<code>a</code>).
Otherwise, it returns a really messy expression that performs the actual
rotation and fixes the fifth and sixth bits:</p>
<ul>
<li><ol type="A">
<li>Subtract 1, to get into the range 0-25 (for the modulo
operation).</li>
</ol></li>
<li><ol start="2" type="A">
<li>Add 13 to the character. Steps A and B are combined.</li>
</ol></li>
<li><ol start="3" type="A">
<li>Take this modulo 26 to make the addition wrap around.</li>
</ol></li>
<li><ol start="4" type="A">
<li>Fix bits 5 and 6, based on variable <code>a</code>.</li>
</ol></li>
<li><ol start="5" type="A">
<li>Add 1 back in (we took it out in step A.) This is okay to do
<em>after</em> step D, because we know the addition won’t trickle up
past the fourth bit (<code>b</code> would have to be 31 for this to
happen).</li>
</ol></li>
</ul></li>
</ol>
<p>Notice that this implementation operates only on characters with the
high bit clear. The high bit can be ignored without changing the size of
the program. Also, if you know you are only dealing with seven bit data,
the size can be reduced by one byte. These are left as exercises for the
student.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-1991fine"><a name="inventory"></a>Inventory for
1991/fine</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/fine/fine.c">fine.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/fine/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/fine/fine.orig.c">fine.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/fine/try.sh">try.sh</a>
- how to run</li>
<li><a href="1991_fine.tar.bz2">1991_fine.tar.bz2</a> - download winning
source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/fine/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/fine/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/fine/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F1991%2Ffine%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+249 -13
View File
@@ -1,4 +1,6 @@
<!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 -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,261 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 1991/rince/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>1991 rince</title>
<meta name="description" content="IOCCC year: 1991 IOCCC winner: rince winner index page">
<meta name="keywords" content="IOCCC,1991,rince,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>1991/rince</title>
<meta name="description" content="1991 IOCCC winner rince">
<meta name="keywords" content="IOCCC, 1991, IOCCC 1991, IOCCC winner, rince">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>1991 rince</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>1991/rince</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F1991%2Frince%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1991/rince/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../fine/index.html">&larr; fine</a>
<a class="Left" href="../index.html">&uarr; 1991 &uarr;</a>
<a class="Left" href="../westley/index.html">westley &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#James_Bonfield">James
Bonfield</a><br> Location: <a
href="/temp-test-ioccc/location.html#GB">GB</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> all</span></code></pre></div>
<p>There are two <a href="#alternate-code">alternate versions</a> which
allow one to not be restricted in movements or to change the maximum
number of movements, even if that’s fewer than the original program.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./rince</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>The first alternate version, <a href="rince.alt.c">rince.alt.c</a>,
disables a maximum move count so that anyone with enough patience and
time can complete the puzzle, without having to worry about how many
moves they make, assuming they don’t get stuck. The second version, <a
href="rince.alt2.c">rince.alt2.c</a>, allows one to reconfigure at
compilation the maximum number of moves, even if that is lowering the
count.</p>
<p>The author set the maximum number of moves to 484.</p>
<h3 id="alternate-build">Alternate build:</h3>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<p>This will build both alt versions where the first one,
<code>rince.alt</code>, has no restrictions in the number of movements
and the second one, <code>rince.alt2</code>, has a configurable maximum
number of moves allowed, defaulting to the entry’s max, 484.</p>
<p>To reconfigure the maximum number of moves to 700:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> clobber MAXMOVES=700 alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3>
<p>To run the first alt version:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./rince.alt</span></span></code></pre></div>
<p>To run the second alt version:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./rince.alt2</span></span></code></pre></div>
<p>Can you figure out how to make the two alternate versions equivalent
in functionality without modifying the code? That is can you make the
second alt version end up allowing any number of movements?</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>In 2023 this entry was updated to allow most ANSI C compilers to
compile the code and to fix a bug where the win or lose message was not
seen.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This program is a simple puzzle type game. (I’ll leave you to play it
to see the rest of it .. :-) .) The general idea was to try and write
the smallest playable game, but keep the playability and enjoyment
high.</p>
<h3 id="instructions">Instructions:</h3>
<p>Key to map:</p>
<pre><code> |
###### | | | /\ /--\ ==| /\ | | Directonal keys
###### Solid Wall | ----|| \/ /\ ||---- (unlock doors of
###### | \/ ==| \--/ \/ the same direction)
|\
| &lt;&lt; &gt;&gt; Doors. Unlocked by
Blank space | &lt;&lt; vvvvvv ^^^^^^ &gt;&gt; the above keys.
| &lt;&lt; &gt;&gt;
|\
___ | o__O\ O__O ^__^ /O__o\
/ \ &#39;Crushable&#39; | \___/ /----\ /----\ \___/ The four sprites for
\___/ boulder | _/_\ _/ \_ _/ \_ /_\_ your character :-)
|\
___ uncrushable | /\ Diamonds. They can either be found lying
/@@@\ boulder | &lt; &gt; around (if only!) or manufacture by pushing
\@@@/ | \/ two &#39;crushable&#39; rocks together.
|</code></pre>
<p>The general idea of the game is to collect all the diamonds. This
must be done in the minimum amount of moves. I’ve allowed a margin of 5
moves which brings the moves allowed to <code>484</code>. (alter the
value of <code>u</code> in the program to set the max moves
allowed).</p>
<p>There are two types of boulders. Both can be pushed around, but only
the hollow (crushable) ones can be turned into diamonds (by pushing it
onto another hollow one).</p>
<p>Of the four types of doors (and keys) only 3 have been defined. This
was done to keep the source as low as possible (as I only used 3 in the
map). To unlock a door simply push a key into the corresponding door.
Take care that it’s facing in the correct direction.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-1991rince"><a name="inventory"></a>Inventory for
1991/rince</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/rince/rince.c">rince.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/rince/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/rince/rince.alt.c">rince.alt.c</a>
- alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/rince/rince.alt2.c">rince.alt2.c</a>
- alternate alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/rince/rince.orig.c">rince.orig.c</a>
- original source</li>
<li><a href="1991_rince.tar.bz2">1991_rince.tar.bz2</a> - download
winning source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/rince/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/rince/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/rince/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F1991%2Frince%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+403 -13
View File
@@ -1,4 +1,6 @@
<!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 -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,415 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 1991/westley/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>1991 westley</title>
<meta name="description" content="IOCCC year: 1991 IOCCC winner: westley winner index page">
<meta name="keywords" content="IOCCC,1991,westley,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>1991/westley</title>
<meta name="description" content="1991 IOCCC winner westley">
<meta name="keywords" content="IOCCC, 1991, IOCCC 1991, IOCCC winner, westley">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>1991 westley</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>1991/westley</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.last.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F1991%2Fwestley%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1991/westley/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../rince/index.html">&larr; rince</a>
<a class="Left" href="../index.html">&uarr; 1991 &uarr;</a>
<a class="Left Disabled" href="#">last entry</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.last.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#Brian_Westley">Brian Westley</a><br>
Location: <a href="/temp-test-ioccc/location.html#US">US</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> all</span></code></pre></div>
<p>There is an <a href="#alternate-code">alternate version</a> that is
supposed to win all the time.</p>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code>STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a
href="/bugs.md#1991-westley">1991 westley in bugs.md</a>.</p>
<h2 id="to-use">To use:</h2>
<p>NOTE: we have provided a script to perform the below procedure which
we include for the interested. See the <a href="#try">try</a> section if
you just want to play.</p>
<p>Make and then run as follows:</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./westley</span> <span class="pp">[</span><span class="ss">move_location</span><span class="pp">]</span> <span class="kw">|</span> <span class="fu">tee</span> nextmove.c</span></code></pre></div>
<p>where the <code>move_location</code> is a digit from 1 to 9 that
represents a move on a tic-tac-toe board:</p>
<pre><code>1 2 3
4 5 6
7 8 9</code></pre>
<p>If you omit <code>move_location</code>, then the computer moves
first. For your next move, recompile <code>nextmove.c</code> and play it
again:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> nextmove</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./nextmove</span> move_location <span class="kw">|</span> <span class="fu">tee</span> nextmove.c</span></code></pre></div>
<h2 id="try">Try:</h2>
<p>We have provided the shell script, <a href="ttt.sh">ttt</a>, to make
it easier to play the game:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> ttt</span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./ttt</span> <span class="pp">[</span><span class="ss">first_move</span><span class="pp">]</span> <span class="co"># &lt;- omit first arg to have it move first</span></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./ttt</span> next_move</span></code></pre></div>
<p>The shell script determines when the game is over, and automatically
replaces <code>merlyn.c</code> (copied from <a
href="westley.c">westley.c</a> with an improved version after a loss).
The <a href="ttt.sh">ttt</a> script has two other modes:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./ttt</span> quitgame <span class="co"># cancel any game in progress, revert to merlyn.c</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./ttt</span> clobber <span class="co"># remove all game files, revert to original source</span></span></code></pre></div>
<p>For example here is a potentially losing game:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./ttt</span> 1</span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./ttt</span> 4</span>
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./ttt</span> 6</span></code></pre></div>
<p>The final might look like:</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a> a<span class="op">(</span>X<span class="op">){</span><span class="co">/*/X=- a(X){/*/</span>X<span class="op">=-</span></span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a> X <span class="op">-</span><span class="dv">1</span><span class="op">;</span>F<span class="op">;</span>X<span class="op">=-</span> <span class="op">-</span><span class="dv">1</span><span class="op">;</span>F<span class="op">;</span>X<span class="op">=-</span></span>
<span id="cb9-3"><a href="#cb9-3" aria-hidden="true" tabindex="-1"></a> <span class="op">-</span><span class="dv">1</span><span class="op">;</span>F<span class="op">;}</span><span class="co">/*/ -1;F;}/*/</span></span>
<span id="cb9-4"><a href="#cb9-4" aria-hidden="true" tabindex="-1"></a><span class="dt">char</span> z<span class="op">[][</span><span class="dv">100</span><span class="op">]={</span><span class="st">&quot;char z[][100]={&quot;</span><span class="op">,</span><span class="st">&quot;a(X){/*/X=-&quot;</span><span class="op">,</span><span class="st">&quot;-1;F;X=-&quot;</span><span class="op">,</span><span class="st">&quot;-1;F;}/*/&quot;</span><span class="op">,</span><span class="st">&quot;1999999999 :-) &quot;</span><span class="op">,</span></span>
<span id="cb9-5"><a href="#cb9-5" aria-hidden="true" tabindex="-1"></a><span class="st">&quot;int q,i,j,k,X,O=0,H;S(x)int*x;{X+=X;O+=O;*x+1?*x+2||X++:O++;*x=1;}L(n){for(*&quot;</span><span class="op">,</span></span>
<span id="cb9-6"><a href="#cb9-6" aria-hidden="true" tabindex="-1"></a><span class="st">&quot;z[i=1]=n+97;i&lt;4;i++)M(256),s(i),M(128),s(i),M(64),N;X*=8;O*=8;}s(R){char*r=z&quot;</span><span class="op">,</span></span>
<span id="cb9-7"><a href="#cb9-7" aria-hidden="true" tabindex="-1"></a><span class="st">&quot;[R];for(q&amp;&amp;Q;*r;)P(*r++);q&amp;&amp;(Q,P(44));}M(m){P(9);i-2||P(X&amp;m?88:O&amp;m?48:32);P(&quot;</span><span class="op">,</span></span>
<span id="cb9-8"><a href="#cb9-8" aria-hidden="true" tabindex="-1"></a><span class="st">&quot;9);}y(A){for(j=8;j;)~A&amp;w[--j]||(q=0);}e(W,Z){for(i-=i*q;i&lt;9&amp;&amp;q;)y(W|(1&lt;&lt;i++&amp;&quot;</span><span class="op">,</span></span>
<span id="cb9-9"><a href="#cb9-9" aria-hidden="true" tabindex="-1"></a><span class="st">&quot;~Z));}R(){for(k=J[*J-48]-40;k;)e(w[k--],X|O);}main(u,v)char**v;{a(q=1);b(1);&quot;</span><span class="op">,</span></span>
<span id="cb9-10"><a href="#cb9-10" aria-hidden="true" tabindex="-1"></a><span class="st">&quot;c(1);*J=--u?O?*J:*v[1]:53;X|=u&lt;&lt;57-*v[u];y(X);K=40+q;q?e(O,X),q&amp;&amp;(K=&#39;|&#39;),e(X&quot;</span><span class="op">,</span></span>
<span id="cb9-11"><a href="#cb9-11" aria-hidden="true" tabindex="-1"></a><span class="st">&quot;,O),R(),O|=1&lt;&lt;--i:J[*J-48+(X=O=0)]--;L(q=0);for(s(i=0);q=i&lt;12;)s(i++),i&gt;4&amp;&amp;N&quot;</span><span class="op">,</span></span>
<span id="cb9-12"><a href="#cb9-12" aria-hidden="true" tabindex="-1"></a><span class="st">&quot;;s(q=12);P(48);P(&#39;}&#39;);P(59);N;q=0;L(1);for(i=5;i&lt;13;)s(i++),N;L(2);}&quot;</span><span class="op">,</span><span class="dv">0</span><span class="op">};</span></span>
<span id="cb9-13"><a href="#cb9-13" aria-hidden="true" tabindex="-1"></a> b<span class="op">(</span>X<span class="op">){</span><span class="co">/*/X=- b(X){/*/</span>X<span class="op">=-</span></span>
<span id="cb9-14"><a href="#cb9-14" aria-hidden="true" tabindex="-1"></a> X <span class="op">-</span><span class="dv">1</span><span class="op">;</span>F<span class="op">;</span>X<span class="op">=-</span> <span class="op">-</span><span class="dv">1</span><span class="op">;</span>F<span class="op">;</span>X<span class="op">=-</span> X</span>
<span id="cb9-15"><a href="#cb9-15" aria-hidden="true" tabindex="-1"></a> <span class="op">-</span><span class="dv">1</span><span class="op">;</span>F<span class="op">;}</span><span class="co">/*/ -1;F;}/*/</span></span>
<span id="cb9-16"><a href="#cb9-16" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> q<span class="op">,</span>i<span class="op">,</span>j<span class="op">,</span>k<span class="op">,</span>X<span class="op">,</span>O<span class="op">=</span><span class="dv">0</span><span class="op">,</span>H<span class="op">;</span>S<span class="op">(</span>x<span class="op">)</span><span class="dt">int</span><span class="op">*</span>x<span class="op">;{</span>X<span class="op">+=</span>X<span class="op">;</span>O<span class="op">+=</span>O<span class="op">;*</span>x<span class="op">+</span><span class="dv">1</span><span class="op">?*</span>x<span class="op">+</span><span class="dv">2</span><span class="op">||</span>X<span class="op">++:</span>O<span class="op">++;*</span>x<span class="op">=</span><span class="dv">1</span><span class="op">;}</span>L<span class="op">(</span>n<span class="op">){</span><span class="cf">for</span><span class="op">(*</span></span>
<span id="cb9-17"><a href="#cb9-17" aria-hidden="true" tabindex="-1"></a>z<span class="op">[</span>i<span class="op">=</span><span class="dv">1</span><span class="op">]=</span>n<span class="op">+</span><span class="dv">97</span><span class="op">;</span>i<span class="op">&lt;</span><span class="dv">4</span><span class="op">;</span>i<span class="op">++)</span>M<span class="op">(</span><span class="dv">256</span><span class="op">),</span>s<span class="op">(</span>i<span class="op">),</span>M<span class="op">(</span><span class="dv">128</span><span class="op">),</span>s<span class="op">(</span>i<span class="op">),</span>M<span class="op">(</span><span class="dv">64</span><span class="op">),</span>N<span class="op">;</span>X<span class="op">*=</span><span class="dv">8</span><span class="op">;</span>O<span class="op">*=</span><span class="dv">8</span><span class="op">;}</span>s<span class="op">(</span>R<span class="op">){</span><span class="dt">char</span><span class="op">*</span>r<span class="op">=</span>z</span>
<span id="cb9-18"><a href="#cb9-18" aria-hidden="true" tabindex="-1"></a><span class="op">[</span>R<span class="op">];</span><span class="cf">for</span><span class="op">(</span>q<span class="op">&amp;&amp;</span>Q<span class="op">;*</span>r<span class="op">;)</span>P<span class="op">(*</span>r<span class="op">++);</span>q<span class="op">&amp;&amp;(</span>Q<span class="op">,</span>P<span class="op">(</span><span class="dv">44</span><span class="op">));}</span>M<span class="op">(</span>m<span class="op">){</span>P<span class="op">(</span><span class="dv">9</span><span class="op">);</span>i<span class="op">-</span><span class="dv">2</span><span class="op">||</span>P<span class="op">(</span>X<span class="op">&amp;</span>m<span class="op">?</span><span class="dv">88</span><span class="op">:</span>O<span class="op">&amp;</span>m<span class="op">?</span><span class="dv">48</span><span class="op">:</span><span class="dv">32</span><span class="op">);</span>P<span class="op">(</span></span>
<span id="cb9-19"><a href="#cb9-19" aria-hidden="true" tabindex="-1"></a><span class="dv">9</span><span class="op">);}</span>y<span class="op">(</span>A<span class="op">){</span><span class="cf">for</span><span class="op">(</span>j<span class="op">=</span><span class="dv">8</span><span class="op">;</span>j<span class="op">;)~</span>A<span class="op">&amp;</span>w<span class="op">[--</span>j<span class="op">]||(</span>q<span class="op">=</span><span class="dv">0</span><span class="op">);}</span>e<span class="op">(</span>W<span class="op">,</span>Z<span class="op">){</span><span class="cf">for</span><span class="op">(</span>i<span class="op">-=</span>i<span class="op">*</span>q<span class="op">;</span>i<span class="op">&lt;</span><span class="dv">9</span><span class="op">&amp;&amp;</span>q<span class="op">;)</span>y<span class="op">(</span>W<span class="op">|(</span><span class="dv">1</span><span class="op">&lt;&lt;</span>i<span class="op">++&amp;</span></span>
<span id="cb9-20"><a href="#cb9-20" aria-hidden="true" tabindex="-1"></a><span class="op">~</span>Z<span class="op">));}</span>R<span class="op">(){</span><span class="cf">for</span><span class="op">(</span>k<span class="op">=</span>J<span class="op">[*</span>J<span class="op">-</span><span class="dv">48</span><span class="op">]-</span><span class="dv">40</span><span class="op">;</span>k<span class="op">;)</span>e<span class="op">(</span>w<span class="op">[</span>k<span class="op">--],</span>X<span class="op">|</span>O<span class="op">);}</span>main<span class="op">(</span>u<span class="op">,</span>v<span class="op">)</span><span class="dt">char</span><span class="op">**</span>v<span class="op">;{</span>a<span class="op">(</span>q<span class="op">=</span><span class="dv">1</span><span class="op">);</span>b<span class="op">(</span><span class="dv">1</span><span class="op">);</span></span>
<span id="cb9-21"><a href="#cb9-21" aria-hidden="true" tabindex="-1"></a>c<span class="op">(</span><span class="dv">1</span><span class="op">);*</span>J<span class="op">=--</span>u<span class="op">?</span>O<span class="op">?*</span>J<span class="op">:*</span>v<span class="op">[</span><span class="dv">1</span><span class="op">]:</span><span class="dv">53</span><span class="op">;</span>X<span class="op">|=</span>u<span class="op">&lt;&lt;</span><span class="dv">57</span><span class="op">-*</span>v<span class="op">[</span>u<span class="op">];</span>y<span class="op">(</span>X<span class="op">);</span>K<span class="op">=</span><span class="dv">40</span><span class="op">+</span>q<span class="op">;</span>q<span class="op">?</span>e<span class="op">(</span>O<span class="op">,</span>X<span class="op">),</span>q<span class="op">&amp;&amp;(</span>K<span class="op">=</span><span class="ch">&#39;|&#39;</span><span class="op">),</span>e<span class="op">(</span>X</span>
<span id="cb9-22"><a href="#cb9-22" aria-hidden="true" tabindex="-1"></a><span class="op">,</span>O<span class="op">),</span>R<span class="op">(),</span>O<span class="op">|=</span><span class="dv">1</span><span class="op">&lt;&lt;--</span>i<span class="op">:</span>J<span class="op">[*</span>J<span class="op">-</span><span class="dv">48</span><span class="op">+(</span>X<span class="op">=</span>O<span class="op">=</span><span class="dv">0</span><span class="op">)]--;</span>L<span class="op">(</span>q<span class="op">=</span><span class="dv">0</span><span class="op">);</span><span class="cf">for</span><span class="op">(</span>s<span class="op">(</span>i<span class="op">=</span><span class="dv">0</span><span class="op">);</span>q<span class="op">=</span>i<span class="op">&lt;</span><span class="dv">12</span><span class="op">;)</span>s<span class="op">(</span>i<span class="op">++),</span>i<span class="op">&gt;</span><span class="dv">4</span><span class="op">&amp;&amp;</span>N</span>
<span id="cb9-23"><a href="#cb9-23" aria-hidden="true" tabindex="-1"></a><span class="op">;</span>s<span class="op">(</span>q<span class="op">=</span><span class="dv">12</span><span class="op">);</span>P<span class="op">(</span><span class="dv">48</span><span class="op">);</span>P<span class="op">(</span><span class="ch">&#39;}&#39;</span><span class="op">);</span>P<span class="op">(</span><span class="dv">59</span><span class="op">);</span>N<span class="op">;</span>q<span class="op">=</span><span class="dv">0</span><span class="op">;</span>L<span class="op">(</span><span class="dv">1</span><span class="op">);</span><span class="cf">for</span><span class="op">(</span>i<span class="op">=</span><span class="dv">5</span><span class="op">;</span>i<span class="op">&lt;</span><span class="dv">13</span><span class="op">;)</span>s<span class="op">(</span>i<span class="op">++),</span>N<span class="op">;</span>L<span class="op">(</span><span class="dv">2</span><span class="op">);}</span></span>
<span id="cb9-24"><a href="#cb9-24" aria-hidden="true" tabindex="-1"></a> c<span class="op">(</span>X<span class="op">){</span><span class="co">/*/X=- c(X){/*/</span>X<span class="op">=-</span></span>
<span id="cb9-25"><a href="#cb9-25" aria-hidden="true" tabindex="-1"></a> <span class="dv">0</span> <span class="op">-</span><span class="dv">1</span><span class="op">;</span>F<span class="op">;</span>X<span class="op">=-</span> <span class="dv">0</span> <span class="op">-</span><span class="dv">1</span><span class="op">;</span>F<span class="op">;</span>X<span class="op">=-</span> <span class="dv">0</span></span>
<span id="cb9-26"><a href="#cb9-26" aria-hidden="true" tabindex="-1"></a> <span class="op">-</span><span class="dv">1</span><span class="op">;</span>F<span class="op">;}</span><span class="co">/*/ -1;F;}/*/</span></span>
<span id="cb9-27"><a href="#cb9-27" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb9-28"><a href="#cb9-28" aria-hidden="true" tabindex="-1"></a>ttt<span class="op">:</span> I win<span class="op">!</span></span></code></pre></div>
<p>Redirects stderr to <code>/dev/null</code> by default. If you need
errors or warnings use <code>-e</code>.</p>
<h2 id="alternate-code">Alternate code:</h2>
<p>This version is based on the author’s remarks. It is not supposed to
lose but it can lose if you cheat. That’s supposed to happen. Can you
win any other time?</p>
<h3 id="alternate-build">Alternate build:</h3>
<div class="sourceCode" id="cb10"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3>
<p>Rather than use <code>ttt</code> try the script <code>ttt.alt</code>
instead.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Can you figure out why the board looks different than the <a
href="westley.c">westley.c</a>?</p>
<p>What happens if you make a move already made?</p>
<p>Now go try and draw or better yet win (without cheating which is very
easy :-) )! Why is win better than draw? Because everyone knows how to
draw:</p>
<blockquote>
<p>Professor Falken: Did you ever play tic-tac-toe?<br />
Jennifer Mack: Yeah. Of course.<br />
Falken: But you don’t any more.<br />
Jennifer: No.<br />
Falken: Why?<br />
Jennifer: Because it’s a boring game. It’s always a tie.<br />
Falken: Exactly. There’s no way to win. The game itself is pointless.
But back at the <a
href="https://www.ioccc.org/https://www.ioccc.org/judges.html">International
Obfuscated C Code Contest judges’ room</a> they believe that you can win
tic-tac-toe, that there can be acceptable draws.</p>
</blockquote>
<p>This is supposed to happen. As is written in the <a
href="http://catb.org/jargon/html/F/feature.html">The Jargon
File</a>:</p>
<pre><code>That&#39;s not a bug, that&#39;s a feature.</code></pre>
<p>Try not to cheat (even though it’s very easy :-) ), the computer has
not learned how to catch you doing it.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>A tic-tac-toe self-modifying program that “learns”. This C program
plays standard tic-tac-toe on itself. The code is written as a
tic-tac-toe grid; moves are carried out within the code.</p>
<p>The human is <code>X</code>, the computer <code>0</code> [sic,
“zero”, not letter “O”].</p>
<p>The program, when run, reproduces itself with both the player’s move
and the computer’s move added. Recompile THIS program (using the same
compile line) and repeat until the game is finished.</p>
<p>If the computer wins, the “straight face” in the upper right-hand
corner, “:-|”, will change into a happy face, “:-)”. If it is a draw,
the face does not change. If the computer loses, the board is blanked
and the face changes into a sad face, “:-(”. If this happens, the blank
board should replace the original program; the computer changes its play
and will continue to do so until it no longer loses games.</p>
<p>If you want a program that never loses, simply replace the string
<code>"9999999999 :-| "</code> with
<code>"9883857753 :-| "</code>.</p>
<h3 id="how-it-works">How it works</h3>
<p>The vertical “bars” of the grid are identical functions, with the
name of the function as <code>a()</code>, <code>b()</code>, or
<code>c()</code>. After each function is called, the global variables
<code>X</code> and <code>O</code> contain bitmasks of where all the
<code>X</code>s and <code>O</code>s are placed. The statement:</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a>X<span class="op">=-</span> <span class="op">&lt;</span><span class="dt">char</span><span class="op">&gt;</span> <span class="op">-</span><span class="dv">1</span><span class="op">;</span></span></code></pre></div>
<p>evaluates to <code>1</code>, <code>-1</code>, or <code>-2</code> when
<code>X</code> is <code>1</code> and <code>&lt;char&gt;</code> is one of
<code>"X"</code>, <code>"0"</code>, or <code>" "</code>. The function
<code>S(&amp;X)</code> sets the appropriate bits in (global vars)
<code>X</code> and <code>O</code> and resets the value of
<code>&amp;X</code> to <code>1</code>. This is how the current position
is computed.</p>
<p>The player’s move is bitwise ORed into the <code>X</code> mask, and
(if it is the opening move) the strategy string’s first character is set
to the player’s first move (or <code>5</code> if the computer moves
first).</p>
<p>The evaluation function <code>y(M)</code> checks if the mask has a
winning pattern (any of the first eight bitmasks of the
<code>w[N]</code> array), and sets the variable <code>q</code> to
<code>0</code> if it does.</p>
<p>The player’s move is evaluated to see if the human has won. The
smiley is set to “:-)” or “:-(” depending on this. Also, if the human
has won, the digit in the strategy string is decremented to change the
computer’s play for the next round.</p>
<p>If the human has NOT won, the <code>e(N,M)</code> function evaluates
if ANY move not in mask <code>N</code> can produce a win in mask
<code>M</code>. The first evaluation <code>e(X,O)</code> checks if
<code>O</code> can make a legal winning move. If so, the computer has a
winning move and makes it. If not, the smiley is set to “:-|”, and a
non-winning move is generated.</p>
<p>A non-winning move first checks if <code>X</code> can win in one
move; if so, this move is selected, blocking the win. Otherwise, a move
is generated by looking down the list of “move templates”. The first
move template that generates a move that is NOT already occupied by an
<code>X</code> or <code>O</code> is returned.</p>
<p>The “move templates” are static tic-tac-toe positions that generate
possible moves by making the <code>e()</code> function return “winning”
moves, e.g. the template:</p>
<pre><code>. . .
O , O (this is the value 40; 2^3+2^5)
. . . (&quot;O&quot;s are 1 bits, &quot;.&quot; and &quot;,&quot; are 0 bits)</code></pre>
<p>…will make the <code>e()</code> function return a center move, as
this is the only move that produces three in a row. Notice that the
computer does not consider which cells contain <code>X</code>s and
<code>O</code>s when making a template move, only which cells are empty
and not-empty. This makes for unusual play.</p>
<p>The templates are carefully chosen to eventually block all traps that
<code>X</code> can try, by just blundering in the way.</p>
<p>Also note that the winning &amp; strategy templates are part of the
compile line, making it possible to change the rules of the game by
changing the compile line.</p>
<p>The templates are:</p>
<pre><code>O , O
, , ,
O , O
, . .
. O .
. . O
. . .
O , O
. . .
. . .
O O ,
. . .
. . .
O , O
. . .
. , ,
. O .
O O ,
O , O
, , .
O . .
, . O
O , O
O . ,
O . ,
O , O
, . O
O , O
, , ,
O , O</code></pre>
<p>A digit of <code>9</code> means start with the first template,
<code>8</code> starts at the second, etc. The templates are scanned
until a legal move is found. A template is scanned from bottom to top,
right to left (i.e. move <code>9</code> is tested first, then
<code>8</code>, down to move <code>1</code>).</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-1991westley"><a name="inventory"></a>Inventory for
1991/westley</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/westley/westley.c">westley.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/westley/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/westley/westley.alt.c">westley.alt.c</a>
- alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/westley/westley.orig.c">westley.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/westley/ttt.alt.sh">ttt.alt.sh</a>
- how to run the alternative code</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/westley/ttt.sh">ttt.sh</a>
- play tic-tac-toe</li>
<li><a href="1991_westley.tar.bz2">1991_westley.tar.bz2</a> - download
winning source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/westley/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/westley/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1991/westley/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F1991%2Fwestley%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->