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

+365 -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,377 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 1996/august/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>1996 august</title>
<meta name="description" content="IOCCC year: 1996 IOCCC winner: august winner index page">
<meta name="keywords" content="IOCCC,1996,august,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>1996/august</title>
<meta name="description" content="1996 IOCCC winner august">
<meta name="keywords" content="IOCCC, 1996, IOCCC 1996, IOCCC winner, august">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>1996 august</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>1996/august</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%2F1996%2Faugust%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/august/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; 1996 &uarr;</a>
<a class="Left" href="../dalbec/index.html">dalbec &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#Lennart_Augustsson">Lennart
Augustsson</a><br> Location: <a
href="/temp-test-ioccc/location.html#SE">SE</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>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code>STATUS: doesn&#39;t work with some compilers - please provide alternative code or fix for more compilers</code></pre>
<p>For more detailed information see <a href="/bugs.md#1996-august">1996
august 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="fu">cat</span> august.c test.oc <span class="kw">|</span> <span class="ex">./august</span> <span class="op">&gt;</span> test.oo</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./august</span> <span class="op">&lt;</span> test.oo</span></code></pre></div>
<p>NOTE: some compilers will compile this code into infinite loops! If
the above cat line (or one of the ones later in the try section) does
not execute in a very short amount of time, then you may need to fix
your compiler or use gcc.</p>
<p>The above should print a <code>!</code> followed by a newline.</p>
<h2 id="try">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="ex">./try.sh</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This entry can feed on itself. If you C pre-process the source, you
compile the interpreter:</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> august.oc</span></code></pre></div>
<p>We can now compile the interpreter as follows:</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">cat</span> august.c august.oc <span class="kw">|</span> <span class="ex">./august</span> <span class="op">&gt;</span> august.oo</span></code></pre></div>
<p>and use the compiled interpreter to execute some previously compiled
code:</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="fu">cat</span> august.oo test.oo <span class="kw">|</span> <span class="ex">./august</span></span></code></pre></div>
<p>And we can have the compiled interpreter interpret itself which in
turn compiles the test program:</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="fu">cat</span> august.oo august.oo fac.oo <span class="kw">|</span> <span class="ex">./august</span></span></code></pre></div>
<p>And if you have lots of spare time, you can recurse one level
deeper:</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.oo august.oo august.oo fac.oo <span class="kw">|</span> <span class="ex">./august</span></span></code></pre></div>
<p>We (the judges) recommend that you spend some time studying this
entry as it surely will make the ‘best of the IOCCC’ list. It was very
well received by those who attended the IOCCC BOF.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This program is a bytecode interpreter. This fact is not particularly
obfuscated; any experienced C programmer can see that in about a
minute.</p>
<p>The interpreter reads the bytecode from the standard input. What
remains of the standard input after this is left as standard input for
the interpreted program.</p>
<p>Having an interpreter but no code isn’t any fun. But within a comment
in the beginning of the interpreter is a sequence of bytes that is code
that the interpreter understands. It is in fact the code for a compiler
that compiles from OC (Obfuscated C, a subset of C) into the byte code
that the interpreter understands.</p>
<p>The language the compiler understands is a subset of C (the grammar
is below) with the functions <code>getchar(3)</code> and
<code>putchar(3)</code> available. The subset has the types
<code>int</code>, <code>char</code>, and pointers to those (it has
function pointers too, but not with the proper syntax). Arrays can only
be global. There is a rather limited set of operators, and control
constructs.</p>
<p>The compiler has absolutely no error checking, so things can go
wrong. But this is what seasoned C programmers are used to.</p>
<p>Assume that the interpreter has been compiled (source in <a
href="august.c">august.c</a> and binary in august) and that we have this
in a file named <code>test.oc</code>:</p>
<div class="sourceCode" id="cb10"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a>main<span class="op">()</span> <span class="op">{</span> putchar<span class="op">(</span><span class="ch">&#39;!&#39;</span><span class="op">);</span> putchar<span class="op">(</span><span class="ch">&#39;</span><span class="sc">\n</span><span class="ch">&#39;</span><span class="op">);</span> exit<span class="op">(</span><span class="dv">0</span><span class="op">);</span> <span class="op">}</span></span></code></pre></div>
<p>We can then compile by</p>
<div class="sourceCode" id="cb11"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.c test.oc <span class="kw">|</span> <span class="ex">./august</span> <span class="op">&gt;</span> test.oo</span></code></pre></div>
<p>And run the compiled program by</p>
<div class="sourceCode" id="cb12"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./august</span> <span class="op">&lt;</span> test.oo</span></code></pre></div>
<p>Or even simpler:</p>
<div class="sourceCode" id="cb13"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.c test.oc <span class="kw">|</span> <span class="ex">./august</span> <span class="kw">|</span> <span class="ex">./august</span></span></code></pre></div>
<p>A larger example is included <a href="fac.oc">fac.oc</a>.</p>
<p>The compiler for OC is naturally written in OC (where did you think
the byte code came from?). It is in the file <a
href="parse.oc">parse.oc</a>.</p>
<p>Hmm… So now we have an interpreter written in OC and a compiler for
OC, can we compile the interpreter? Yes, we can! The OC compiler does
not have a preprocessor (hey, what do you expect from a program that is
this small), so we need to use an external one. To pre-process <a
href="august.c">august.c</a> use the command from the Makefile, but add
the <code>-E</code> flag and change 60000 to 40000, i.e.:</p>
<div class="sourceCode" id="cb14"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cc</span> <span class="at">-E</span> <span class="at">-DZ</span><span class="op">=</span>40000 .... august.c <span class="op">&gt;</span> august.oc</span></code></pre></div>
<p>If <code>august.oc</code> contain some junk line starting with a
<code>#</code> (most likely it does) then remove it like:</p>
<div class="sourceCode" id="cb15"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sed</span> <span class="at">-i</span><span class="st">&#39;&#39;</span> <span class="st">&#39;/^#/d&#39;</span> august.oc</span></code></pre></div>
<p>OK, we can now compile the interpreter:</p>
<div class="sourceCode" id="cb16"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.c august.oc <span class="kw">|</span> <span class="ex">./august</span> <span class="op">&gt;</span> august.oo</span></code></pre></div>
<p>And we can run it:</p>
<div class="sourceCode" id="cb17"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.oo test.oo <span class="kw">|</span> <span class="ex">./august</span></span></code></pre></div>
<p>Here we have the interpreter interpreting another interpreter that
runs the program. Did you think that was too fast? Just throw in another
level of interpretation:</p>
<div class="sourceCode" id="cb18"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.oo august.oo test.oo <span class="kw">|</span> <span class="ex">./august</span></span></code></pre></div>
<p>And another…</p>
<div class="sourceCode" id="cb19"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.oo august.oo august.oo test.oo <span class="kw">|</span> <span class="ex">./august</span></span></code></pre></div>
<hr />
<p>Fitting the byte code for the compiler into the initial comment was a
challenge. I had to strip the compiler/interpreter of a lot of
functionality to bring down their sizes. The initial version had a full
set of binary operators as well as prefix <code>&amp;</code>. Given a
handful more bytes it would be easy to put them back.</p>
<p>Anyway, the bytecode from the compiler is first optimized in an
external optimizer (not supplied here); this brings down the size of it
by about 30%. The remaining code is then LZ-compressed (roughly) with a
sliding window of 255 bytes. The most common occurring bytes are then
encoded using <code>" \n\t;{}"</code> to avoid having them counted as
significant. About 200 bytes of the interpreter handles the unpacking of
the byte code (this is a lot, but it pays off).</p>
<p>Despite all this work I still had to put a lot of code in the
compilation command. This disturbs me. It is possible to compress the
code further with a better entropy coder (e.g. an arithmetic coder), but
decompression then takes up too much code. Maybe this would be a way to
fit it all into the 1536 bytes, but I don’t have time to try it.</p>
<hr />
<p>Execution starts at <code>main()</code>. Nothing can be used before
it is defined. <code>getchar()</code> and <code>putchar()</code> are
predefined functions.</p>
<p>Below is a description of the OC grammar.</p>
<h3 id="oc-grammar">OC grammar</h3>
<p>Terminals are in quotes, <code>()</code> is used for bracketing.</p>
<pre><code>program: decl*
decl: vardecl
fundecl
vardecl: type NAME ;
type NAME &quot;[&quot; INT &quot;]&quot; ;
fundecl: type NAME &quot;(&quot; args &quot;)&quot; &quot;{&quot; body &quot;}&quot;
args: /*empty*/
( arg &quot;,&quot; )* arg
arg: type NAME
body: vardecl* stmt*
stmt: ifstmt
whilestmt
dowhilestmt
&quot;return&quot; expr &quot;;&quot;
expr &quot;;&quot;
&quot;{&quot; stmt* &quot;}&quot;
&quot;;&quot;
ifstmt: &quot;if&quot; &quot;(&quot; expr &quot;)&quot; stmt
&quot;if&quot; &quot;(&quot; expr &quot;)&quot; stmt &quot;else&quot; stmt
whilestmt: &quot;while&quot; &quot;(&quot; expr &quot;)&quot; stmt
dowhilestmt: &quot;do&quot; stmt &quot;while&quot; &quot;(&quot; expr &quot;)&quot; &quot;;&quot;
expr: expr binop expr
unop expr
expr &quot;[&quot; expr &quot;]&quot;
&quot;(&quot; expr &quot;)&quot;
expr &quot;(&quot; exprs &quot;)&quot;
NAME
INT
CHAR
STRING
exprs: /*empty*/
(expr &quot;,&quot;)* expr
binop: &quot;+&quot; | &quot;-&quot; | &quot;*&quot; | &quot;/&quot; | &quot;%&quot; |
&quot;=&quot; |
&quot;&lt;&quot; | &quot;==&quot; | &quot;!=&quot;
unop: &quot;!&quot; | &quot;-&quot; | &quot;*&quot;
type: &quot;int&quot; stars
&quot;char&quot; stars
stars: &quot;*&quot;*
</code></pre>
<hr />
<p>Well, that is enough ranting for now.</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-1996august"><a name="inventory"></a>Inventory for
1996/august</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/1996/august/august.c">august.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/august.orig.c">august.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/fac.oc">fac.oc</a>
- oc source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/parse.oc">parse.oc</a>
- oc source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/test.oc">test.oc</a>
- oc source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/try.sh">try.sh</a>
- how to run</li>
<li><a href="1996_august.tar.bz2">1996_august.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/1996/august/.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/1996/august/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/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%2F1996%2Faugust%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 -->
+215 -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,227 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 1996/dalbec/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>1996 dalbec</title>
<meta name="description" content="IOCCC year: 1996 IOCCC winner: dalbec winner index page">
<meta name="keywords" content="IOCCC,1996,dalbec,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>1996/dalbec</title>
<meta name="description" content="1996 IOCCC winner dalbec">
<meta name="keywords" content="IOCCC, 1996, IOCCC 1996, IOCCC winner, dalbec">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>1996 dalbec</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>1996/dalbec</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%2F1996%2Fdalbec%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/dalbec/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../august/index.html">&larr; august</a>
<a class="Left" href="../index.html">&uarr; 1996 &uarr;</a>
<a class="Left" href="../eldby/index.html">eldby &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#John_Dalbec">John Dalbec</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">./dalbec</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">./dalbec</span> 3 <span class="kw">|</span> <span class="fu">head</span> <span class="at">-n</span> 29</span></code></pre></div>
<p>Why does the output end with 121?</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>The output is mis-leading … why does it also print 2047?</p>
<p>For a hint see <a
href="https://web.archive.org/web/20000510191341/https://www.utm.edu/research/primes/prove2.html">https://web.archive.org/web/20000510191341/https://www.utm.edu/research/primes/prove2.html</a>.</p>
<p>… and then try to understand the source! :-)</p>
<p>We (the judges) recommend that you take the time needed to understand
how this program works. The source is small enough to make the effort
reasonable, and complex enough to make it interesting.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This program assumes that your terminal wraps lines automatically. If
this is not the case, you may need to change the space in the “printf”
format string to a newline character.</p>
<p>An extra feature of this program is that it allows you (in most
cases) to estimate the stack space available to programs on your system.
Simply allow the program to run to completion. The stack space is
roughly proportional to the last number printed.</p>
<p>(On SunOS/cc, the proportionality constant is about 48 bytes.)</p>
<p>On completion, the program produces a core file that may be used to
refine this estimate. (Or you could try typing <code>limit</code> if
you’re running <code>csh</code>.) In rare cases the stack space may
exceed <code>24*INT_MAX</code> bytes, in which case the program will
produce an inaccurate estimate.</p>
<p>This program is obfuscated by:</p>
<ol type="1">
<li><p>The use of easily-confused variable names.</p></li>
<li><p>Using the implicit <code>!=0</code> in conditional
expressions.</p></li>
<li><p>Substituting expressions such as <code>!a</code> for
<code>0</code> where <code>a!=0</code> and <code>!a</code> for
<code>1</code> where <code>a==0</code>.</p></li>
<li><p>The fact that <code>main()</code> is a single expression and so
beautifies poorly.</p></li>
<li><p>The fact that <code>main()</code> is used:</p>
<ul>
<li>to compute powers in modular arithmetic.</li>
<li>to recursively call itself in the main loop.</li>
</ul></li>
</ol>
<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-1996dalbec"><a name="inventory"></a>Inventory for
1996/dalbec</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/1996/dalbec/dalbec.c">dalbec.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/dalbec/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/dalbec/dalbec.orig.c">dalbec.orig.c</a>
- original source</li>
<li><a href="1996_dalbec.tar.bz2">1996_dalbec.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/1996/dalbec/.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/1996/dalbec/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/dalbec/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%2F1996%2Fdalbec%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 -->
+206 -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,218 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 1996/eldby/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>1996 eldby</title>
<meta name="description" content="IOCCC year: 1996 IOCCC winner: eldby winner index page">
<meta name="keywords" content="IOCCC,1996,eldby,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>1996/eldby</title>
<meta name="description" content="1996 IOCCC winner eldby">
<meta name="keywords" content="IOCCC, 1996, IOCCC 1996, IOCCC winner, eldby">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>1996 eldby</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>1996/eldby</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%2F1996%2Feldby%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/eldby/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../dalbec/index.html">&larr; dalbec</a>
<a class="Left" href="../index.html">&uarr; 1996 &uarr;</a>
<a class="Left" href="../gandalf/index.html">gandalf &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#Thor_Eldby">Thor Eldby</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> alt</span></code></pre></div>
<p>We recommend that you use the alt version to see what the entry
looked like back in 1996. For the original version see the <a
href="#original-code">original code</a> section.</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">./eldby.alt</span></span></code></pre></div>
<p>To quit send intr (typically ctrl-c).</p>
<p>NOTE: to reset the sanity of your terminal after this program ends
try <code>reset</code>.</p>
<h2 id="try">Try:</h2>
<p>This alternate version, which we recommend that you use in order to
see what is happening with modern systems, and to not flash too quickly,
which can be problematic for some people, can be configured to different
speeds by way of the value used in <code>usleep()</code>. The default is
<code>35000</code> but you can easily change it. To do so try:</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="fu">make</span> SLEEP=20000 clobber alt</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./eldby.alt</span></span></code></pre></div>
<h2 id="original-code">Original code:</h2>
<p>This version is the original which has no sleep time in between
updates.</p>
<h3 id="original-build">Original 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> all</span></code></pre></div>
<h3 id="original-use">Original use:</h3>
<p>Use <code>./eldby</code> as you would <code>./eldby.alt</code>
above.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>We were impressed by the author’s ability to render spheres in 3D in
a very small chunk of code.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This program shows flying spheres. The program eats CPU on lesser
equipped systems. The program will run until termination. Terminal must
be VT100 or better with 80 columns and 24 rows or more.</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-1996eldby"><a name="inventory"></a>Inventory for
1996/eldby</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/1996/eldby/eldby.c">eldby.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/eldby/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/eldby/eldby.alt.c">eldby.alt.c</a>
- alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/eldby/eldby.orig.c">eldby.orig.c</a>
- original source</li>
<li><a href="1996_eldby.tar.bz2">1996_eldby.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/1996/eldby/.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/1996/eldby/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/eldby/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%2F1996%2Feldby%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 -->
+195 -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,207 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 1996/gandalf/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>1996 gandalf</title>
<meta name="description" content="IOCCC year: 1996 IOCCC winner: gandalf winner index page">
<meta name="keywords" content="IOCCC,1996,gandalf,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>1996/gandalf</title>
<meta name="description" content="1996 IOCCC winner gandalf">
<meta name="keywords" content="IOCCC, 1996, IOCCC 1996, IOCCC winner, gandalf">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>1996 gandalf</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>1996/gandalf</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%2F1996%2Fgandalf%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/gandalf/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../eldby/index.html">&larr; eldby</a>
<a class="Left" href="../index.html">&uarr; 1996 &uarr;</a>
<a class="Left" href="../huffman/index.html">huffman &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#Dean_Swift">Dean Swift</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>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code>STATUS: missing or dead link - please provide them</code></pre>
<p>For more detailed information see <a
href="/bugs.md#1996-gandalf">1996 gandalf 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">./gandalf</span></span></code></pre></div>
<h2 id="try">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="ex">./try.sh</span></span></code></pre></div>
<p>As the script asks, care to guess why these execute differently? Only
the compiler knows … ok maybe other things like the author, the judges
and perhaps you too?</p>
<p>BTW: it is perilous to ‘try’ the patience of <a
href="https://www.glyphweb.com/arda/g/gandalf.html">Gandalf</a>. Go
ahead, ‘try’ it! :-)</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>For misleading C pre-processor output, try:</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">cc</span> <span class="at">-E</span> gandalf.c</span></code></pre></div>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>The program requires an ASCII system.</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-1996gandalf"><a name="inventory"></a>Inventory for
1996/gandalf</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/1996/gandalf/gandalf.c">gandalf.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/gandalf/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/gandalf/gandalf.orig.c">gandalf.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/gandalf/try.sh">try.sh</a>
- how to run</li>
<li><a href="1996_gandalf.tar.bz2">1996_gandalf.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/1996/gandalf/.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/1996/gandalf/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/gandalf/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%2F1996%2Fgandalf%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 -->
+203 -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,215 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 1996/huffman/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>1996 huffman</title>
<meta name="description" content="IOCCC year: 1996 IOCCC winner: huffman winner index page">
<meta name="keywords" content="IOCCC,1996,huffman,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>1996/huffman</title>
<meta name="description" content="1996 IOCCC winner huffman">
<meta name="keywords" content="IOCCC, 1996, IOCCC 1996, IOCCC winner, huffman">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>1996 huffman</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>1996/huffman</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%2F1996%2Fhuffman%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/huffman/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../gandalf/index.html">&larr; gandalf</a>
<a class="Left" href="../index.html">&uarr; 1996 &uarr;</a>
<a class="Left" href="../jonth/index.html">jonth &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#Ken_Huffman">Ken Huffman</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>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code>STATUS: uses gets() - change to fgets() if possible</code></pre>
<p>For more detailed information see <a
href="/bugs.md#1996-huffman">1996 huffman 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="bu">echo</span> <span class="st">&#39;Huffman Decoding&#39;</span> <span class="kw">|</span> <span class="ex">./huffman</span></span></code></pre></div>
<h2 id="try">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="ex">./try.sh</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>If you are still confused and want to read a spoiler, check out the
source and it will be clear as mud!</p>
<p>And for a misleading hint, consider who won! :-)</p>
<p>And if you really can’t see what is going on, here is an extra
spoiler:</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">./huffman</span> <span class="op">&lt;</span> huffman.c <span class="dv">2</span><span class="op">&gt;</span>/dev/null</span></code></pre></div>
<p>This entry was very well received at the IOCCC BOF.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This filter program is really not obfuscated code. It compiles
cleanly with an ANSI C compiler and comes with user documentation that
even a blind person could read.</p>
<p>The program is a bidirectional filter with the output of the program
suitable for its input. The output of this program, when used as input,
undoes the original program filtering.</p>
<p>This program accepts any alphanumeric text that has lines less than
100 characters. The user is encouraged to use the program’s source as
input to the executable.</p>
<p>This program is best appreciated on a tactile monitor.</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-1996huffman"><a name="inventory"></a>Inventory for
1996/huffman</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/1996/huffman/huffman.c">huffman.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/huffman/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/huffman/huffman.orig.c">huffman.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/huffman/try.sh">try.sh</a>
- how to run</li>
<li><a href="1996_huffman.tar.bz2">1996_huffman.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/1996/huffman/.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/1996/huffman/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/huffman/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%2F1996%2Fhuffman%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 -->
+209 -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,221 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 1996/jonth/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>1996 jonth</title>
<meta name="description" content="IOCCC year: 1996 IOCCC winner: jonth winner index page">
<meta name="keywords" content="IOCCC,1996,jonth,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>1996/jonth</title>
<meta name="description" content="1996 IOCCC winner jonth">
<meta name="keywords" content="IOCCC, 1996, IOCCC 1996, IOCCC winner, jonth">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>1996 jonth</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>1996/jonth</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%2F1996%2Fjonth%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/jonth/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../huffman/index.html">&larr; huffman</a>
<a class="Left" href="../index.html">&uarr; 1996 &uarr;</a>
<a class="Left" href="../rcm/index.html">rcm &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#Jon_Thingvold">Jon Thingvold</a><br>
Location: <a href="/temp-test-ioccc/location.html#NO">NO</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>NOTE: this entry requires <code>X11/Xlib.h</code> header file and the
X11 library to compile. macOS users running Mountain Lion and later will
need to download and install <a
href="https://www.xquartz.org">XQuartz</a> in order to compile and run
this entry.</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
STATUS: missing or dead link - please provide them</code></pre>
<p>For more detailed information see <a href="/bugs.md#1996-jonth">1996
jonth 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">./jonth</span> :0 :0</span></code></pre></div>
<p>NOTE: the two boards will be on top of each other so you will have to
drag one off the other so that you can properly play.</p>
<p>NOTE: if there is no X service open this will crash. If this is the
case you might 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">./jonth</span></span></code></pre></div>
<p>These are 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>
<h2 id="try">Try:</h2>
<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">./jonth</span> host1:0 host2:0</span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>For extra credit, figure out how you can cheat by taking over a
square already occupied by an opponent.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This is multi-user tic-tac-toe for X Windows. You may give one or two
X displays as arguments to this game.</p>
<h3 id="known-bugs">Known bugs:</h3>
<p>Sometimes on Solaris, X gets confused and this program core dumps.
The solution: give two display arguments
(<code>./jonth host:0 host:0</code>).</p>
<p>If one (or both) windows look like a copy of the window(s) below, try
<code>xrefresh(1)</code> command.</p>
<p>Have a <code>nice(1)</code> day.</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-1996jonth"><a name="inventory"></a>Inventory for
1996/jonth</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/1996/jonth/jonth.c">jonth.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/jonth/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/jonth/jonth.orig.c">jonth.orig.c</a>
- original source</li>
<li><a href="1996_jonth.tar.bz2">1996_jonth.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/1996/jonth/.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/1996/jonth/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/jonth/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%2F1996%2Fjonth%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 -->
+218 -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,230 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 1996/rcm/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>1996 rcm</title>
<meta name="description" content="IOCCC year: 1996 IOCCC winner: rcm winner index page">
<meta name="keywords" content="IOCCC,1996,rcm,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>1996/rcm</title>
<meta name="description" content="1996 IOCCC winner rcm">
<meta name="keywords" content="IOCCC, 1996, IOCCC 1996, IOCCC winner, rcm">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>1996 rcm</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>1996/rcm</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%2F1996%2Frcm%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/rcm/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../jonth/index.html">&larr; jonth</a>
<a class="Left" href="../index.html">&uarr; 1996 &uarr;</a>
<a class="Left" href="../schweikh1/index.html">schweikh1 &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#Ron_McFarland">Ron McFarland</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">./rcm</span> <span class="op">&lt;</span> rfc1951.gz</span></code></pre></div>
<h2 id="try">Try:</h2>
<p>For more information try:</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">./rcm</span> <span class="op">&lt;</span> rfc1952.gz</span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>For a good no-op 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="fu">gzip</span> <span class="at">-c</span> <span class="op">&lt;</span> rcm.c <span class="kw">|</span> <span class="ex">./rcm</span></span></code></pre></div>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>Except for some silly requirements regarding input validation, CRC
checking, and similar unimportant fluff, this program is a fully
compliant <a href="https://www.ietf.org/rfc/rfc1951.txt">RFC1951</a>/<a
href="https://www.ietf.org/rfc/rfc1952.txt">RFC1952</a> (<a
href="https://www.gnu.org/software/gzip/">GNU Gzip</a>) file
uncompressor. Feed it a <code>gzip</code> compressed file on standard
input, and it will write the fully uncompressed original file to
standard output.</p>
<h3 id="objustifications-for-this-entry">ObJustifications for this
entry:</h3>
<h4 id="the-design-trade-off-argument">The Design Trade-off
Argument:</h4>
<p>“The 184 characters worth of defines in the build file have been
carefully offset by 184 redundant and unnecessary ‘<code>{</code>’,
‘<code>}</code>’, and ‘<code>;</code>’ characters in the source
file.”</p>
<h4 id="the-design-review-argument">The Design Review Argument:</h4>
<p>“Using only 216 characters out of a maximum of 256, the build file
meets and actually exceeds specification.”</p>
<h4 id="the-program-metrics-argument">The Program Metrics Argument:</h4>
<p>“The program source is less than 3,100 characters in length and
uncompresses the file <a
href="https://ftp.gnu.org/old-gnu/emacs/emacs-19.34b.tar.gz">emacs-19.34b.tar.gz</a>
in about 130 seconds on my HP 9000/735. The now obsolete source file
`inflate.c’ from the GNU gzip source tree is 31,613 characters in length
and uncompresses the emacs distribution file in slightly under 25
seconds. Thus:</p>
<pre><code>3100 / 130 = 23.85 -vs- 31613 / 25 = 1264.52</code></pre>
<p>which represents a better than 530% improvement in the ratio of
source file size to execution time.”</p>
<h4 id="the-whining-programmers-argument">The Whining Programmer’s
Argument:</h4>
<p>“The inflate algorithm requires that over 400 characters worth of
constants and tables be defined. Which means the program itself had to
be squeezed down to about 1,100 IOCCC countable bytes.”</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-1996rcm"><a name="inventory"></a>Inventory for
1996/rcm</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/1996/rcm/rcm.c">rcm.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/rcm/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/rcm/rcm.orig.c">rcm.orig.c</a>
- original source</li>
<li><a href="1996_rcm.tar.bz2">1996_rcm.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/1996/rcm/.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/1996/rcm/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/rcm/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="rfc1951.gz">rfc1951.gz</a> - input data</li>
<li><a href="rfc1952.gz">rfc1952.gz</a> - input data</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%2F1996%2Frcm%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 -->
+262 -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,274 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 1996/schweikh1/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>1996 schweikh1</title>
<meta name="description" content="IOCCC year: 1996 IOCCC winner: schweikh1 winner index page">
<meta name="keywords" content="IOCCC,1996,schweikh1,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>1996/schweikh1</title>
<meta name="description" content="1996 IOCCC winner schweikh1">
<meta name="keywords" content="IOCCC, 1996, IOCCC 1996, IOCCC winner, schweikh1">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>1996 schweikh1</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>1996/schweikh1</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%2F1996%2Fschweikh1%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/schweikh1/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../rcm/index.html">&larr; rcm</a>
<a class="Left" href="../index.html">&uarr; 1996 &uarr;</a>
<a class="Left" href="../schweikh2/index.html">schweikh2 &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#Jens_Schweikhardt">Jens
Schweikhardt</a><br> Location: <a
href="/temp-test-ioccc/location.html#DE">DE</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">./schweikh1</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<p>To find the day that Easter falls on in the current year:</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">./schweikh1</span> <span class="kw">|</span><span class="fu">grep</span> <span class="va">$(</span><span class="fu">date</span> +%Y<span class="va">)</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Look at the source. There is something very odd going on here. Where
does the real code come from if everything is a C pre-processor
statement?</p>
<p>Clearly this is either the Best Use or the Worst Abuse of the C
Preprocessor that the judges have seen this year!</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="what-this-program-does">What this program does</h3>
<p>This program is an implementation of an algorithm that calculates the
date of the Sunday following the first full moon after the spring
equinox. (Also known as “Easter”, defined this way by the Nicaean
Concilium in 325 Anno Domini.) The algorithm is attributed to the famous
mathematician <a
href="https://en.wikipedia.org/wiki/Carl_Friedrich_Gauss">Carl Friedrich
Gauss</a> [“Meyers Handbuch ueber das Weltall” ‘Handbook About Space’,
Meyer, 5th Edition, 1973, p149] and is suitable for anni domini within
the <a href="https://en.wikipedia.org/wiki/Gregorian_calendar">Gregorian
Calendar</a>, that is, from ad 1582 to ad 2199:</p>
<pre><code>Let J be the year.
If J is from 1582 to 1699, let M be 22, let N be 2
If J is from 1700 to 1799, let M be 23, let N be 3
If J is from 1800 to 1899, let M be 23, let N be 4
If J is from 1900 to 2099, let M be 24, let N be 5
If J is from 2100 to 2199, let M be 24, let N be 6
Let a be the modulus of J divided by 19
Let b be the modulus of J divided by 4
Let c be the modulus of J divided by 7
Let d be the modulus of (19a + M) divided by 30
Let e be the modulus of (2b + 4c + 6d + N) divided by 7
</code></pre>
<p>The interesting Sunday is either:</p>
<pre><code>March 22 + d + e or
April d + e - 9 (only one of them is a valid date)</code></pre>
<p>with the following exceptions:</p>
<pre><code>April 26 must always be changed to April 19
April 25 must be changed to April 18 if d is 28 and a is greater than 10</code></pre>
<h3 id="example">Example:</h3>
<pre><code>J = 1962, M = 24, N = 5
a = J % 19 == 5
b = J % 4 == 2
c = J % 7 == 2
d = 119 % 30 == 29
e = 191 % 7 == 2</code></pre>
<p>March 53 is invalid, so the result is April 22 1962.</p>
<h3 id="why-i-think-this-is-obfuscated">Why I think this is
obfuscated</h3>
<p>Apart from the calculation of the Easter date, the definition
<em>and</em> calculation of which are obfuscations in their own right,
obfuscation lurks in many places. Look at those macro identifiers. What
can be more obvious than a program that explicitly mentions the
grammatical constructs it is composed of? If you look at K&amp;RII A.9.3
you will find that a compound statement consists of an opening brace
followed by a declaration list followed by a semicolon followed by a
statement list followed by another semicolon and a closing brace. Nobody
can learn that by heart so I gently remind the reader by defining a
macro that expresses this clearly (line 25). This goes up to the
definition of a translation unit. Unfortunately, due to the IOCCC’s size
restrictions, I had to abbreviate some syntactic elements.
<code>ae</code> actually reads “assignment expression”. I had to stop at
some arbitrary point, so don’t waste your time trying to find out how
preprocessing tokens form type qualifier lists, cast expressions or
direct abstract declarators. Assuming the reader knows about these easy
to remember language elements is justified in my opinion.</p>
<h3 id="the-moral">The moral:</h3>
<p>Try to be as precise as can be and no one will comprehend what you
mean.</p>
<h4 id="the-formula">The formula:</h4>
<pre><code>comprehension = 1/(2**precision)</code></pre>
<h4 id="the-interpretation">The interpretation:</h4>
<p>“Say nothing and everybody will understand.”</p>
<p>The <code>-I/usr/include</code> in the build file is needed by gcc on
Solaris because <code>gcc</code>’s “fixed” header in
<code>gcc-lib/sparc-sun-solaris2.5/2.7.2/include/errno.h</code> is
broken (sort of) because it has <em>two</em> identical extern
declarations of errno. This leads to an error due to the redefinition of
main. The <code>-I</code> option makes sure the working
/usr/include/errno.h is found first, which shouldn’t cause any problems
on other systems.</p>
<h3 id="usage">Usage:</h3>
<p>The program is run without arguments. It prints all dates in
order.</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-1996schweikh1"><a name="inventory"></a>Inventory
for 1996/schweikh1</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/1996/schweikh1/schweikh1.c">schweikh1.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh1/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh1/schweikh1.orig.c">schweikh1.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh1/errno.h">errno.h</a>
- declare errno as an extern int</li>
<li><a href="1996_schweikh1.tar.bz2">1996_schweikh1.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/1996/schweikh1/.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/1996/schweikh1/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh1/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%2F1996%2Fschweikh1%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 -->
+289 -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,301 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 1996/schweikh2/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>1996 schweikh2</title>
<meta name="description" content="IOCCC year: 1996 IOCCC winner: schweikh2 winner index page">
<meta name="keywords" content="IOCCC,1996,schweikh2,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>1996/schweikh2</title>
<meta name="description" content="1996 IOCCC winner schweikh2">
<meta name="keywords" content="IOCCC, 1996, IOCCC 1996, IOCCC winner, schweikh2">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>1996 schweikh2</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>1996/schweikh2</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%2F1996%2Fschweikh2%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/schweikh2/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../schweikh1/index.html">&larr; schweikh1</a>
<a class="Left" href="../index.html">&uarr; 1996 &uarr;</a>
<a class="Left" href="../schweikh3/index.html">schweikh3 &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#Jens_Schweikhardt">Jens
Schweikhardt</a><br> Location: <a
href="/temp-test-ioccc/location.html#DE">DE</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">./schweikh2</span></span></code></pre></div>
<p>The program accepts up to 4 parameters:</p>
<ol start="0" type="1">
<li><p>The number of operators in the expression [default: 9]</p></li>
<li><p>The value of the first operand [default: 1]</p></li>
<li><p>The (possibly negative) increment to the next operand [default:
1]</p></li>
<li><p>The goal value or 0/0 [default: 42]</p></li>
</ol>
<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>What happens if you pass only three parameters like the below?</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">./schweikh2</span> 15 1 0</span></code></pre></div>
<p>The author also suggests:</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="cf">while</span> <span class="bu">:</span><span class="kw">;</span> <span class="cf">do</span> <span class="fu">grep</span> <span class="at">-v</span> <span class="st">&#39;#&#39;</span> schweikh2.c<span class="kw">;</span> <span class="cf">done</span></span></code></pre></div>
<p>(and we do too) which works with <code>sh</code>, <code>bash</code>,
<code>ksh</code> and <code>zsh</code> as well. Press ctrl-c to stop it.
Observe how the <a href="try.sh">try.sh</a> script does this a number of
times.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>The original program, with only slight obfuscations, may be found in
<a href="hunni.c">hunni.c</a>. The perl script, <a
href="hunni.pl">hunni.pl</a>, obfuscates it appropriately. Try:</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">less</span> hunni.c</span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a><span class="fu">perl</span> ./hunni.pl <span class="op">&lt;</span> hunni.c</span></code></pre></div>
<p>This entry was another crowd pleaser at the IOCCC BOF.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>Note: the source must be viewed with tabstop 8. To appreciate the
beauty have your eyes half closed.</p>
<h3 id="why-i-think-this-program-is-obfuscated">Why I think this program
is obfuscated:</h3>
<p>C is a free format language. It is therefore a question of style how
variables, operators, declarations, functions and syntactic elements
like braces and parentheses are grouped together. As a rule of thumb, I
put spaces around operators, after opening braces and before closing
braces. I have generalized this rule by putting whitespace after
<em>any</em> non-white space character (with the exception of
preprocessor directives). There are no recognizable keywords anymore.
There are no recognizable string literals any more. The
<code>main()</code> function is invisible. All operators longer than one
character are gone. They have been replaced by macro calls with quite a
number of arguments. The keys are the token pasting and stringizing
macros <code>e</code> and <code>O</code>. The “arcane rules of token
pasting” [K&amp;R2] are used up to three levels:
<code>H(O,r)R(O,r)</code> (!) which is needed to make one 8-character
token from 8 characters (<code>unsigned</code>). BTW, C has no 9 or more
character reserved words, so a fourth level is only required if you
intend to generate object names from 9 or more components. The final
round even swaps the tokens, so all keywords must be spelled backwards
(sort of, can you spot <code>printf</code> in the <code>P</code>
macro?).</p>
<p>Try to indent the source. The unbalanced parentheses confuse Solaris’
indent to the max (although the result does compile):</p>
<p>Looking at the indented source is even <em>less</em> fun, because the
nice diamond pattern has been replaced by something that looks like,
uhm, modem noise.</p>
<p>Lint the source. It’s clean. How obfuscated…</p>
<p>What’s the exit status? The program exits with <code>J - 1</code>
where <code>J</code> is the return value from several non-void functions
(needed to shut up lint). The last assignment is
<code>J = printf ("%c", 10);</code> so the exit status is 0 unless the
last <code>printf</code> failed, which is even a <em>useful</em> status.
A further obfuscation is the use of <code>10</code> instead of
<code>'\n'</code>. <code>'\n'</code> can not be constructed by token
pasting, AFAIK. That’s why <code>schweikh2</code> is likely to produce
occasional garbage on non-ASCII execution character set systems.</p>
<h3 id="what-this-program-does">What this program does</h3>
<p>The program is an expression evaluator for a limited class of
expressions. Known operators are <code>+</code> <code>-</code>
<code>*</code> <code>/</code>; operands are real numbers (integers or
fractions). The operands are restricted in that they must differ by a
constant value, for example <code>1 + 2 * 3 / 4 - 5</code>. For any
combination of operators the expression is evaluated and compared to a
goal value. If they compare equal the expression is printed. If the goal
value is specified as <code>0/0</code> all expressions and results are
printed. For any fraction, the numerator and denominator are divided by
their greatest common divisor.</p>
<p>The program accepts up to 4 parameters:</p>
<ol type="1">
<li>The number of operators in the expression [default: 9].</li>
<li>The value of the first operand [1].</li>
<li>The (possibly negative) increment to the next operand [1].</li>
<li>The goal value or 0/0 [42].</li>
</ol>
<p>On ANSI/ISO C conformant systems (where <code>long</code> is at least
32 bits) overflow will occur in the default case (first operand 1,
increment 1) only for more than 11 operators. Because a bit mask is used
that needs twice the number of operands in bits (plus a sentinel value)
on those systems the first parameter must not exceed 15.</p>
<p>If <code>long</code> is at least 64 bits overflow will occur for more
than 19 operators but you will probably wait quite some time for every
of the <code>4^19 = 274,877,906,944</code> combinations to be evaluated…
While I’m at it, on a 50 MHz SPARC, <code>4^11</code> expressions are
evaluated in about 3 cpu minutes (<code>gcc -O3</code>).</p>
<h3 id="sample-arguments">Sample arguments:</h3>
<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">./schweikh2</span> 6</span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./schweikh2</span> 7 0</span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./schweikh2</span> 7 7 0</span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a><span class="ex">./schweikh2</span> 8 9 <span class="at">-1</span> <span class="at">-67</span>/21</span>
<span id="cb7-5"><a href="#cb7-5" aria-hidden="true" tabindex="-1"></a><span class="ex">./schweikh2</span> 8 2 2/5 <span class="at">-98</span>/25</span>
<span id="cb7-6"><a href="#cb7-6" aria-hidden="true" tabindex="-1"></a><span class="ex">./schweikh2</span> 2 1/0 1 1/0</span></code></pre></div>
<h3 id="miscellaneous">Miscellaneous</h3>
<p>The diamond pattern can be continued without a break. For a nice
printout try this on your Bourne compatible shell:</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="cf">while</span> <span class="bu">:</span><span class="kw">;</span> <span class="cf">do</span> <span class="fu">grep</span> <span class="at">-v</span> <span class="st">&#39;#&#39;</span> schweikh2.c<span class="kw">;</span> <span class="cf">done</span></span></code></pre></div>
<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-1996schweikh2"><a name="inventory"></a>Inventory
for 1996/schweikh2</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/1996/schweikh2/schweikh2.c">schweikh2.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh2/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh2/schweikh2.orig.c">schweikh2.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh2/hunni.c">hunni.c</a>
- original slightly obfuscated source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh2/hunni.pl">hunni.pl</a>
- perl script to obfuscate c</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh2/try.sh">try.sh</a>
- how to run</li>
<li><a href="1996_schweikh2.tar.bz2">1996_schweikh2.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/1996/schweikh2/.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/1996/schweikh2/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh2/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%2F1996%2Fschweikh2%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 -->
+296 -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,308 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 1996/schweikh3/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>1996 schweikh3</title>
<meta name="description" content="IOCCC year: 1996 IOCCC winner: schweikh3 winner index page">
<meta name="keywords" content="IOCCC,1996,schweikh3,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>1996/schweikh3</title>
<meta name="description" content="1996 IOCCC winner schweikh3">
<meta name="keywords" content="IOCCC, 1996, IOCCC 1996, IOCCC winner, schweikh3">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>1996 schweikh3</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>1996/schweikh3</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%2F1996%2Fschweikh3%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/schweikh3/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../schweikh2/index.html">&larr; schweikh2</a>
<a class="Left" href="../index.html">&uarr; 1996 &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#Jens_Schweikhardt">Jens
Schweikhardt</a><br> Location: <a
href="/temp-test-ioccc/location.html#DE">DE</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>
<p><strong>WARNING: DO NOT RUN this program without reading this text
down to the end!</strong> It may render your system unusable for a
limited amount of time or force you to reboot using the Big Red Button!
This is <strong>NOT</strong> a joke. You have been warned.</p>
<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">./schweikh3</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>The source fails to compile on compilers that recognize the inline
keyword by default. For gcc, you may need to use <code>-ansi</code>.</p>
<p>See the file <a href="schweikh3.info">schweikh3.info</a> for example
output from various systems.</p>
<p>But still it is a useful utility. To use try:</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">./schweikh3</span></span></code></pre></div>
<p>and thanks for the virtual memories! :-)</p>
<p>NOTE: On some systems such as SunOS, one may need to compile
with:</p>
<pre class="make"><code> ${CC} ${CFLAGS} \
-I. -D_POSIX_SOURCE &#39;-Ddifftime(a,b)=(double)(b-a)&#39; \
schweikh3.c -o schweikh3</code></pre>
<h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="why-i-think-my-entry-is-obfuscated">Why I think my entry is
obfuscated</h3>
<p>There are some layout obfuscations that hinder readability, like some
(but not all) one character tokens in column 1. <code>#include</code>s,
<code>#define</code>s and declarations of data and functions appear
intermixed. <code>iso646.h</code> is even included in the middle of an
expression, how disgusting. Besides, requiring <code>iso646.h</code>
will render the program uncompilable on many systems that have not yet
incorporated Amendment One to The Standard. If you, dear reader, suffer
from this disease, just read <code>iso646.h</code>.</p>
<p>There are no
<code>if' statements. They have been replaced by</code>switch () case
1:<code>or</code>switch () case
0:<code>etc. At least one</code>switch<code>has a declaration after the opening brace, booh! Identifiers are named after random programming languages, BASIC (as</code>Basic`),
COBOL, F77, awk etc.</p>
<p>You have to select maximum ANSI C conformance of your compiler. The
source fails to compile under a C++ compiler due to the `new’ identifier
which is a C++ reserved word:</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">$</span> g++ schweikh3.c</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="ex">schweikh3.c:9:</span> parse error before <span class="kw">`</span><span class="ex">new</span><span class="st">&#39;</span></span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a><span class="st">schweikh3.c:16: parse error before `new&#39;</span></span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a><span class="ex">schweikh3.c:46:</span> parse error before <span class="kw">`</span>void<span class="st">&#39;</span></span>
<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a><span class="st">schweikh3.c:65: parse error before `Lisp&#39;</span></span>
<span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a><span class="ex">schweikh3.c:68:</span> parse error before <span class="kw">`;</span><span class="st">&#39;</span></span>
<span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a><span class="st">[...]</span></span>
<span id="cb5-8"><a href="#cb5-8" aria-hidden="true" tabindex="-1"></a><span class="st">schweikh3.c:91: confused by earlier errors, bailing out</span></span></code></pre></div>
<p>The source fails to compile on compilers that recognize the inline
keyword by default, e.g. gcc:</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">$</span> gcc schweikh3.c</span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="ex">schweikh3.c:46:</span> parse error before <span class="kw">`</span><span class="ex">void</span><span class="st">&#39;</span></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a><span class="st">schweikh3.c: In function `main&#39;</span><span class="ex">:</span></span>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a><span class="ex">schweikh3.c:91:</span> parse error before <span class="kw">`</span>inline<span class="st">&#39;</span></span>
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a><span class="st">schweikh3.c: At top level:</span></span>
<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a><span class="st">schweikh3.c:97: parse error before `void&#39;</span></span></code></pre></div>
<p>The <code>-ansi</code> option to gcc fixes this.</p>
<p>The source fails to compile on obsolete systems with obsolete memory
models due to the identifier <code>far</code> (to be honest: this is
untested :-) ).</p>
<p>Does your indent cope with backslash/newline pairs in between
keywords like in <code>re\turn</code> where the <code>re\</code> is at
the end of a line? ? Solaris’ indent inserts spaces and thereby renders
the source uncompilable…</p>
<p>The indented source will exhibit different semantics when indenting
changes the number of lines (due to using the <code>__LINE__</code>
macro in an expression).</p>
<p>And what about <code>sizeof __TIME__</code>? This one’s for the
philosophers and physicists among us programmers. What is it?
<code>sizeof (char *)</code>? – no. <code>strlen ("hh:mm:ss")</code>? –
no. It’s the same as <code>sizeof __DATE__ - sizeof "no"</code> :-)</p>
<p>The program is POSIX conformant and lints without warning under
Solaris’ Sunpro lint. Allocated memory is correctly freed on all
possible execution paths.</p>
<h3 id="what-this-program-does">What this program does</h3>
<p>This program tests your operating system’s allocation honesty. It
forks a child that will allocate as much memory as possible with byte
granularity and then write to every 1024th byte, at the same time
writing a status report on <code>stdout</code>. This way each page of
the allocated virtual memory will eventually be referenced. Without any
arguments, <code>malloc(3)</code> will be used to allocate memory. If
the first arg starts with <code>c</code>, <code>calloc(3)</code> will be
used instead.</p>
<p>I distinguish three different behaviours:</p>
<ol type="1">
<li><p>OS without memory overcommit: <code>malloc(3)</code> does not lie
– you can use all memory the OS granted to you.</p></li>
<li><p>OS with memory overcommit: <code>malloc(3)</code> lies – any
program may get killed at random when the OS can not acquire a free
page.</p></li>
<li><p>OS with pseudo memory overcommit: <code>malloc(3)</code> lies –
The OS puts processes to sleep for which it can not acquire a free page.
Because other processes are also affected this way, the system slows
down and quickly becomes totally unusable (also known as “thrashing”).
Because more and more processes wait for memory returned by other
exiting processes the system eventually enters a deadlock situation and
effectively halts.</p></li>
</ol>
<p>I had the pleasure and pain to find all three behaviours on the
platforms I use regularly.</p>
<p>The file <a href="schweikh3.info">schweikh3.info</a> has output for
Solaris, FreeBSD and Linux. The Linux case is interesting in that the
behaviour changes when <code>calloc(3)</code> is used instead of
<code>malloc(3)</code>. For FreeBSD, the last two lines are not messages
stemming from my program but issued by the syslog daemon.</p>
<h3 id="implementation-remarks">Implementation remarks</h3>
<p>How can we distinguish the three different OS types from the table
above?</p>
<p>Obviously, type (1), no overcommit, is easy.</p>
<p>For type (2), random kill, we need to fork a child that can be killed
and whose exit status the parent collects and decodes. Here’s where
POSIX enters the scene.</p>
<p>Type (3), thrashing, was the hardest part. The first attempt was to
measure the elapsed processor time it takes to write a single byte
(using <code>clock()</code>). If a certain threshold is reached I assume
the system is thrashing. When thrashing, however, the process does not
consume processor time in a noticeable amount any longer and I lose. So
I switched to measuring wall clock time using <code>time(3)</code>. On
the one system that I observe thrashing (Linux) this works (although the
value returned by <code>time(3)</code> seems to ‘hang’ sometimes when
the OS thrashes. Exceeding a threshold of 5 seconds may be detected only
after half a minute or so.</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-1996schweikh3"><a name="inventory"></a>Inventory
for 1996/schweikh3</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/1996/schweikh3/schweikh3.c">schweikh3.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh3/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh3/schweikh3.orig.c">schweikh3.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh3/schweikh3.info">schweikh3.info</a>
- example output from various systems</li>
<li><a href="1996_schweikh3.tar.bz2">1996_schweikh3.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/1996/schweikh3/.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/1996/schweikh3/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh3/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%2F1996%2Fschweikh3%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 -->
+259 -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,271 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 1996/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>1996 westley</title>
<meta name="description" content="IOCCC year: 1996 IOCCC winner: westley winner index page">
<meta name="keywords" content="IOCCC,1996,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>1996/westley</title>
<meta name="description" content="1996 IOCCC winner westley">
<meta name="keywords" content="IOCCC, 1996, IOCCC 1996, 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>1996 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>1996/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%2F1996%2Fwestley%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/1996/westley/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../schweikh3/index.html">&larr; schweikh3</a>
<a class="Left" href="../index.html">&uarr; 1996 &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 another version which is the original entry. See <a
href="#alternate-code">alternate version</a> for details as to how to
use and why it was made the alt version.</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">./clock1.sh</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./clock2.sh</span></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./clock3.sh</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>
<h2 id="alternate-code">Alternate code:</h2>
<p>The original version had a display problem in modern systems which
somewhat affected the usability of the program. This alternate code, the
original, is provided, to show the differences.</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-try">Alternate try:</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">./try.alt.sh</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Time and time again, Brian Westley seems to come up with a winner! We
are amazed at how much is being done with only one relatively short
line. We think you will as well if you take the time to understand
it.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This 1-line program allows various analog ASCII clocks to print out
the time; the ASCII clock is built from the command line arguments, so
many different types of clocks can be generated. Three different scripts
are supplied to print out a grandfather clock, a mantle clock that runs
backwards, and a linear-style clock. (they are <a
href="clock1.sh">clock1.sh</a>, <a href="clock2.sh">clock2.sh</a>, and
<a href="clock3.sh">clock3.sh</a>)</p>
<p>The program makes the following (possibly non-portable)
assumptions:</p>
<ol type="1">
<li><p>Command line strings can be written to.</p></li>
<li><p><code>argv[0]</code> can be written to as if it were a
<code>long *</code>.</p></li>
<li><p>The first three elements of the <code>struct *</code> returned by
<code>localtime(3)</code> are seconds, minutes, hours, and all are
<code>int</code>s.</p></li>
<li><p>My sample scripts assume ASCII, though this is not inherent in
the code, just my sample scripts.</p></li>
</ol>
<p>These assumptions are pretty reasonable. 2) can be eliminated but
makes the code larger.</p>
<p>The code is simple; the arguments passed are:</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">./westley</span> minute_map hour_map hand_symbol clock_image</span></code></pre></div>
<p>The program merely takes the minute (0-59) and the hour (0-23)
values, looks up the offsets in <code>minute_map</code> and
<code>hour_map</code> and writes the <code>hand_symbol</code> for each
into the <code>clock_image</code> string. This string is then
printed.</p>
<p>The <code>for()</code> loop starts by calling <code>time()</code>
with <code>argv[0]</code>, so the time value (a <code>long</code>) is
written into the program name. The <code>for()</code> control value is
<code>argc</code>, which starts at <code>5</code>, but the
<code>/=2</code> statement is executed before the test, so the
<code>for()</code> loop is executed twice, with <code>h=2</code>, then
<code>h=1</code> (for hour &amp; minute).</p>
<p>The statement of the <code>for()</code> loop takes the hour or minute
field of the struct returned by <code>localtime(3)</code> by casting it
to an <code>int *</code> and dereferencing element <code>[h]</code>. It
is slightly smaller to use the trick <code>h[(int*)localtime(*m)]</code>
instead of <code>((int*)localtime(*m))[h]</code>.</p>
<p>This value is in turn indexed into the <code>hour_map</code> or
<code>minute_map</code> parameter to determine where the ‘hand’ symbol
should be written into the <code>clock_image</code>.</p>
<p>Note that the hands move in a quantum fashion; 3:59 looks deceptively
like 2:59, since the hour hand will be at the 3 position. It won’t move
until both hands click over at 4:00.</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-1996westley"><a name="inventory"></a>Inventory for
1996/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/1996/westley/westley.c">westley.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/westley/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/westley/westley.alt.c">westley.alt.c</a>
- alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/westley/westley.orig.c">westley.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/westley/clock1.sh">clock1.sh</a>
- how to run</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/westley/clock2.sh">clock2.sh</a>
- how to run</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/westley/clock3.sh">clock3.sh</a>
- how to run</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/westley/try.alt.sh">try.alt.sh</a>
- how to run alternative code</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/westley/try.sh">try.sh</a>
- how to run</li>
<li><a href="1996_westley.tar.bz2">1996_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/1996/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/1996/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/1996/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%2F1996%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 -->