force use of pandoc version >= 3.1.12.2

The `bin/pandoc-wrapper.sh` tool will verify that the ssytem
has a recent enough version of `pandoc(1)`.

We explain why we insist on `pandoc(1)`. version >= 3.1.12.2
in comments where the $PANDOC_MIN_VERSION is set.

Added `--wrap=preserve` as a default argument to `pandoc(1)`.
While this change will impact every HTML file generated,
we believe this will improve the ability of someone to look
at the generated HTML and correlate with the original markdown.

Changed `bin/pandoc-wrapper.sh` VERSION from "1.4.2 2024-03-17"
to "1.4.3 2024-03-18".

Performed `make www` to achieve all of the above and to generate
HTML using the new  `--wrap=preserve` `pandoc(1)` mode.
This commit is contained in:
Landon Curt Noll committed 2024-03-18 01:26:39 -07:00
1 parent 9eb7a54e9f
commit b0b212acb1
402 files changed
+37061 -55132

No files matched your search

+89 -128
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Lennart_Augustsson">Lennart
Augustsson</a><br> Location: <a href="../../location.html#SE">SE</a> -
<em>Kingdom of Sweden</em> (<em>Sweden</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Lennart_Augustsson">Lennart Augustsson</a><br>
Location: <a href="../../location.html#SE">SE</a> - <em>Kingdom of Sweden</em> (<em>Sweden</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -144,122 +144,108 @@ Augustsson</a><br> Location: <a href="../../location.html#SE">SE</a> -
<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.html#1996_august">1996 august bugs</a>.</p>
<p>For more detailed information see <a href="../../bugs.html#1996_august">1996 august bugs</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>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
can compile the interpreter:</p>
<p>This entry can feed on itself. If you C pre-process the source,
you can 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>
<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>
<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>
<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>
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>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>
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>
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>
<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>
<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>
<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>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>
<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
<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>
<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>
<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>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>
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>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>
@@ -321,62 +307,37 @@ 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>
<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>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1996august"><a name="inventory"></a>Inventory for
1996/august</h1>
<h1 id="inventory-for-1996august"><a name="inventory"></a>Inventory for 1996/august</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/august.c">august.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/Makefile">Makefile</a>
- entry 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
entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/august.c">august.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/Makefile">Makefile</a> - entry 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 entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<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="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/.entry.json">.entry.json</a> - description of entry in JSON</li>
<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/README.md">README.md</a>
- markdown source for index.html</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/output-index-inventory.sh -->
+30 -53
View File
@@ -130,8 +130,8 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#John_Dalbec">John Dalbec</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of
America</em> (<em>United States</em>) <br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -148,89 +148,66 @@ America</em> (<em>United States</em>) <br><br></li>
<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>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>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>
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>
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>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>
<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>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1996dalbec"><a name="inventory"></a>Inventory for
1996/dalbec</h1>
<h1 id="inventory-for-1996dalbec"><a name="inventory"></a>Inventory for 1996/dalbec</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/dalbec/dalbec.c">dalbec.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/dalbec/Makefile">Makefile</a>
- entry 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="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/dalbec/try.sh">try.sh</a>
- how to run</li>
<li><a href="1996_dalbec.tar.bz2">1996_dalbec.tar.bz2</a> - download
entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/dalbec/dalbec.c">dalbec.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/dalbec/Makefile">Makefile</a> - entry 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="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/dalbec/try.sh">try.sh</a> - how to run</li>
<li><a href="1996_dalbec.tar.bz2">1996_dalbec.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/dalbec/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<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="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/dalbec/.entry.json">.entry.json</a> - description of entry in JSON</li>
<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/README.md">README.md</a>
- markdown source for index.html</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/output-index-inventory.sh -->
+30 -52
View File
@@ -130,8 +130,8 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Thor_Eldby">Thor Eldby</a><br>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown
location</em> <br><br></li>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -141,84 +141,62 @@ location</em> <br><br></li>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
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>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1996eldby"><a name="inventory"></a>Inventory for
1996/eldby</h1>
<h1 id="inventory-for-1996eldby"><a name="inventory"></a>Inventory for 1996/eldby</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/eldby/eldby.c">eldby.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/eldby/Makefile">Makefile</a>
- entry 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 entry
source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/eldby/eldby.c">eldby.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/eldby/Makefile">Makefile</a> - entry 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 entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/eldby/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<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="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/eldby/.entry.json">.entry.json</a> - description of entry in JSON</li>
<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/README.md">README.md</a>
- markdown source for index.html</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/output-index-inventory.sh -->
+21 -42
View File
@@ -130,8 +130,8 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Dean_Swift">Dean Swift</a><br>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown
location</em> <br><br></li>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -144,70 +144,49 @@ location</em> <br><br></li>
<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.html#1996_gandalf">1996 gandalf bugs</a>.</p>
<p>For more detailed information see <a href="../../bugs.html#1996_gandalf">1996 gandalf bugs</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>
<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>
<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>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1996gandalf"><a name="inventory"></a>Inventory for
1996/gandalf</h1>
<h1 id="inventory-for-1996gandalf"><a name="inventory"></a>Inventory for 1996/gandalf</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/gandalf/gandalf.c">gandalf.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/gandalf/Makefile">Makefile</a>
- entry 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
entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/gandalf/gandalf.c">gandalf.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/gandalf/Makefile">Makefile</a> - entry 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 entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/gandalf/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<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="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/gandalf/.entry.json">.entry.json</a> - description of entry in JSON</li>
<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/README.md">README.md</a>
- markdown source for index.html</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/output-index-inventory.sh -->
+25 -46
View File
@@ -130,8 +130,8 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Ken_Huffman">Ken Huffman</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of
America</em> (<em>United States</em>) <br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -144,78 +144,57 @@ America</em> (<em>United States</em>) <br><br></li>
<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.html#1996_huffman">1996 huffman bugs</a>.</p>
<p>For more detailed information see <a href="../../bugs.html#1996_huffman">1996 huffman bugs</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>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>
<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>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 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>
<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>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1996huffman"><a name="inventory"></a>Inventory for
1996/huffman</h1>
<h1 id="inventory-for-1996huffman"><a name="inventory"></a>Inventory for 1996/huffman</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/huffman/huffman.c">huffman.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/huffman/Makefile">Makefile</a>
- entry 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
entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/huffman/huffman.c">huffman.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/huffman/Makefile">Makefile</a> - entry 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 entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/huffman/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<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="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/huffman/.entry.json">.entry.json</a> - description of entry in JSON</li>
<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/README.md">README.md</a>
- markdown source for index.html</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/output-index-inventory.sh -->
+60 -79
View File
@@ -123,114 +123,95 @@
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h1 id="thirteenth-international-obfuscated-c-code-contest">Thirteenth
International Obfuscated C Code Contest</h1>
<h1 id="thirteenth-international-obfuscated-c-code-contest">Thirteenth International Obfuscated C Code Contest</h1>
<h2 id="standard-ioccc-stuff">Standard IOCCC stuff</h2>
<p>View the <code>index.html</code> web page for the given winning entry
for information on how on how to compile it and how to run the winning
program. Look at the winning source and try to figure how it does what
it does! You may then wish to look at the Author’s remarks for even more
details.</p>
<p>The IOCCC has an official home page: <a
href="https://www.ioccc.org">www.ioccc.org</a>, containing previous
winning entries, information about the judges, announcements and much
more.</p>
<p>Use <code>make</code> to compile entries. It is possible that on BSD
or non-Unix systems the Makefile needs to be changed. See the Makefile
for details.</p>
<p>View the <code>index.html</code> web page for the given winning entry for information on how
on how to compile it and how to run the winning program.
Look at the winning source and try to figure how it does what it does!
You may then wish to look at the Author’s remarks for even more details.</p>
<p>The IOCCC has an official home page: <a href="https://www.ioccc.org">www.ioccc.org</a>,
containing previous winning entries, information about the judges,
announcements and much more.</p>
<p>Use <code>make</code> to compile entries. It is possible that on BSD or non-Unix
systems the Makefile needs to be changed. See the Makefile for details.</p>
<p>Read over the Makefile for compile/build issues. Your system may
require certain changes (add or remove a library, add or remove a
<code>#define</code> i.e. the <code>-D</code> flag).</p>
<h2 id="where-are-larry-bassel-and-barbara-frezza">Where are Larry
Bassel and Barbara Frezza?</h2>
<h2 id="where-are-larry-bassel-and-barbara-frezza">Where are Larry Bassel and Barbara Frezza?</h2>
<p>It is not true that Larry Bassel avoided the 13th IOCCC on grounds of
superstition! Larry (as well as Landon) is fond of prime numbers. Larry
is so fond of prime numbers that he decided to become a graduate student
in number theory at UC San Diego. For this reason Larry decided to sit
out this year and plans to be back next year.</p>
<p>Barbara Frezza also went to San Diego to enter into law school at the
same time. Her cooking in the role of official chef was sorely missed.
We look forward to her return to the contest next year as well.</p>
<p>Both Larry and Barbara have taken important new steps in their lives
and we wish them the best. When it is all over, Larry will be able to
produce obfuscated mathematical proofs, and Barbara will be able
deobfuscate the many legal obfuscations. :-)</p>
<h2 id="remarks-on-some-of-the-entries">Remarks on some of the
entries</h2>
superstition! Larry (as well as Landon) is fond of prime numbers.
Larry is so fond of prime numbers that he decided to become a graduate
student in number theory at UC San Diego. For this reason Larry
decided to sit out this year and plans to be back next year.</p>
<p>Barbara Frezza also went to San Diego to enter into law school
at the same time. Her cooking in the role of official chef was
sorely missed. We look forward to her return to the contest
next year as well.</p>
<p>Both Larry and Barbara have taken important new steps in their
lives and we wish them the best. When it is all over, Larry will
be able to produce obfuscated mathematical proofs, and Barbara
will be able deobfuscate the many legal obfuscations. :-)</p>
<h2 id="remarks-on-some-of-the-entries">Remarks on some of the entries</h2>
<p>This year, <a href="../authors.html#Jens_Schweikhardt">Jens
Schweikhardt</a> won 3 times … a new IOCCC record. Meanwhile, <a
href="../authors.html#Brian_Westley">Brian Westley</a> came up with his
8th winning entry, twice the number of the next highest count. But with
people like Schweikhardt around, this lead could fall fast.</p>
<p>As we stated in the <a href="guidelines.txt">guidelines</a>, the
authors of the winning entries are as much news to us as they are to you
because we keep authorship separate from rest of the entry. Some people
have it, we guess!</p>
Schweikhardt</a> won 3 times
… a new IOCCC record. Meanwhile, <a href="../authors.html#Brian_Westley">Brian
Westley</a> came up with his 8th
winning entry, twice the number of the next highest count. But with people like
Schweikhardt around, this lead could fall fast.</p>
<p>As we stated in the <a href="guidelines.txt">guidelines</a>, the authors of the winning entries are
as much news to us as they are to you because we keep authorship separate from
rest of the entry. Some people have it, we guess!</p>
<p>There were a few very good entries that might have won if it were not
for the fact that they didn’t work. If you didn’t win, but think you had
a chance: test your program, fix it and submit it next year!</p>
<h2 id="a-few-notes-regarding-future-contests">A few notes regarding
future contests</h2>
for the fact that they didn’t work. If you didn’t win, but think you
had a chance: test your program, fix it and submit it next year!</p>
<h2 id="a-few-notes-regarding-future-contests">A few notes regarding future contests</h2>
<p>There will be no 1997 contest.</p>
<p>The next contest will not open until sometime in March 1998, and will
close sometime around the end of May 1998. The rules for the 1998
contest have not been formed at this time and are not expected to be
ready for distribution until late February 1998.</p>
<p>So what happened to 1997? Well the next USENIX Technical Conference
will be held Jun 15-19, 1998 (in New Orleans, US). The 18 month span
between conferences will cause the IOCCC to skip over 1997.</p>
<p>Be sure to wait until the 1998 rules are posted before submitting
entries. Rules differ from year to year, sometimes in significant
ways.</p>
will be held Jun 15-19, 1998 (in New Orleans, US). The 18 month
span between conferences will cause the IOCCC to skip over 1997.</p>
<p>Be sure to wait until the 1998 rules are posted before submitting entries.
Rules differ from year to year, sometimes in significant ways.</p>
<p>Please send us comments and suggestions what we have expressed above.
Also include anything else that you would like to see in future
contests. Send such email to:</p>
Also include anything else that you would like to see in future contests.
Send such email to:</p>
<pre><code>judges@toad.com</code></pre>
<p>If you use, distribute or publish these entries in some way, please
drop us a line. We enjoy seeing who, where and how the contest is
used.</p>
<p>If you use, distribute or publish these entries in some way, please drop
us a line. We enjoy seeing who, where and how the contest is used.</p>
<h2 id="final-comments">Final Comments</h2>
<p><strong>IMPORTANT NOTE</strong>: The email addresses found above are
for historical purposes only, and should not be used today. See <a
href="../contact.html">contact.html</a> for up to date contact details
as well as details on how to provide fixes to any of the entries. See
also <a href="../faq.html">the IOCCC FAQ</a> for addition information on
the IOCCC.</p>
<p><strong>IMPORTANT NOTE</strong>: The email addresses found above are for historical
purposes only, and should not be used today. See
<a href="../contact.html">contact.html</a> for up to date contact details
as well as details on how to provide fixes to any of the entries.
See also <a href="../faq.html">the IOCCC FAQ</a> for addition information on the IOCCC.</p>
<h1 id="copyright-and-license">Copyright and License</h1>
<p>Copyright (c) 1997,2023, Landon Curt Noll and Sriram Srinivasan. All
Rights Reserved. This work is licensed under a <a
href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons
CC BY-SA 4.0 DEED Attribution-ShareAlike 4.0 International</a> license.
If you do use this work in some form, the <a href="../judges.html">IOCCC
judges</a> would appreciate (but does not require) if you were to <a
href="../contact.html">send us a note about your use</a>.</p>
<p>Copyright (c) 1997,2023, Landon Curt Noll and Sriram Srinivasan. All Rights Reserved.
This work is licensed under a <a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons CC BY-SA 4.0 DEED Attribution-ShareAlike
4.0 International</a> license.
If you do use this work in some form, the <a href="../judges.html">IOCCC judges</a> would appreciate
(but does not require) if you were to <a href="../contact.html">send us a note about your use</a>.</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-year-index.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-year-index.sh -->
<h1
id="winning-entries-of-1996---the-13th-ioccc"><a name=inventory></a><a name=1996></a>Winning
Entries of 1996 - The 13th IOCCC</h1>
<p><strong>Download IOCCC</strong> <a
href="1996/ioccc.1996.tar.bz2">1996 entry source</a></p>
<h1 id="winning-entries-of-1996---the-13th-ioccc"><a name=inventory></a><a name=1996></a>Winning Entries of 1996 - The 13th IOCCC</h1>
<p><strong>Download IOCCC</strong> <a href="1996/ioccc.1996.tar.bz2">1996 entry source</a></p>
<ul>
<li><a href="august/index.html">1996/august</a> - Best of Show</li>
<li><a href="dalbec/index.html">1996/dalbec</a> - Best Numerical
Obfuscation</li>
<li><a href="dalbec/index.html">1996/dalbec</a> - Best Numerical Obfuscation</li>
<li><a href="eldby/index.html">1996/eldby</a> - Best Output</li>
<li><a href="gandalf/index.html">1996/gandalf</a> - Best Layout</li>
<li><a href="huffman/index.html">1996/huffman</a> - Best Obfuscated
Character Set Utility</li>
<li><a href="huffman/index.html">1996/huffman</a> - Best Obfuscated Character Set Utility</li>
<li><a href="jonth/index.html">1996/jonth</a> - Best X11 Entry</li>
<li><a href="rcm/index.html">1996/rcm</a> - Best RFC Obfuscation</li>
<li><a href="schweikh1/index.html">1996/schweikh1</a> - Worst Abuse of
the C Preprocessor</li>
<li><a href="schweikh2/index.html">1996/schweikh2</a> - Best
Algorithm</li>
<li><a href="schweikh3/index.html">1996/schweikh3</a> - Best
Utility</li>
<li><a href="schweikh1/index.html">1996/schweikh1</a> - Worst Abuse of the C Preprocessor</li>
<li><a href="schweikh2/index.html">1996/schweikh2</a> - Best Algorithm</li>
<li><a href="schweikh3/index.html">1996/schweikh3</a> - Best Utility</li>
<li><a href="westley/index.html">1996/westley</a> - Best One Liner</li>
</ul>
<p> <strong>Jump to:</strong> <a href="#">top</a></p>
+32 -53
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Jon_Thingvold">Jon
Thingvold</a><br> Location: <a href="../../location.html#NO">NO</a> -
<em>Kingdom of Norway</em> (<em>Norway</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Jon_Thingvold">Jon Thingvold</a><br>
Location: <a href="../../location.html#NO">NO</a> - <em>Kingdom of Norway</em> (<em>Norway</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -141,87 +141,66 @@ Thingvold</a><br> Location: <a href="../../location.html#NO">NO</a> -
<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>
<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.html#1996_jonth">1996 jonth bugs</a>.</p>
<p>For more detailed information see <a href="../../bugs.html#1996_jonth">1996 jonth bugs</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>
<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>
<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>
<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>
<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>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>
<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>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1996jonth"><a name="inventory"></a>Inventory for
1996/jonth</h1>
<h1 id="inventory-for-1996jonth"><a name="inventory"></a>Inventory for 1996/jonth</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/jonth/jonth.c">jonth.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/jonth/Makefile">Makefile</a>
- entry 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 entry
source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/jonth/jonth.c">jonth.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/jonth/Makefile">Makefile</a> - entry 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 entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/jonth/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<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="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/jonth/.entry.json">.entry.json</a> - description of entry in JSON</li>
<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/README.md">README.md</a>
- markdown source for index.html</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/output-index-inventory.sh -->
+39 -65
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Ron_McFarland">Ron
McFarland</a><br> Location: <a href="../../location.html#US">US</a> -
<em>United States of America</em> (<em>United States</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Ron_McFarland">Ron McFarland</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -150,92 +150,66 @@ McFarland</a><br> Location: <a href="../../location.html#US">US</a> -
<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>
<p>NOTE: this is done in the <a href="try.sh">try.sh</a> script as well,
along with some other commands including a way to do the above command
but with more steps.</p>
<p>NOTE: this is done in the <a href="try.sh">try.sh</a> script as well, along with some other
commands including a way to do the above command but with more steps.</p>
<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>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>
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>
<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>
<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>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1996rcm"><a name="inventory"></a>Inventory for
1996/rcm</h1>
<h1 id="inventory-for-1996rcm"><a name="inventory"></a>Inventory for 1996/rcm</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/rcm/rcm.c">rcm.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/rcm/Makefile">Makefile</a>
- entry 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="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/rcm/try.sh">try.sh</a>
- how to run</li>
<li><a href="1996_rcm.tar.bz2">1996_rcm.tar.bz2</a> - download entry
source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/rcm/rcm.c">rcm.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/rcm/Makefile">Makefile</a> - entry 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="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/rcm/try.sh">try.sh</a> - how to run</li>
<li><a href="1996_rcm.tar.bz2">1996_rcm.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/rcm/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<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="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/rcm/.entry.json">.entry.json</a> - description of entry in JSON</li>
<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/README.md">README.md</a>
- markdown source for index.html</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>
+56 -82
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Jens_Schweikhardt">Jens
Schweikhardt</a><br> Location: <a href="../../location.html#DE">DE</a> -
<em>Federal Republic of Germany</em> (<em>Germany</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Jens_Schweikhardt">Jens Schweikhardt</a><br>
Location: <a href="../../location.html#DE">DE</a> - <em>Federal Republic of Germany</em> (<em>Germany</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -144,27 +144,27 @@ Schweikhardt</a><br> Location: <a href="../../location.html#DE">DE</a> -
<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 and to show
all Easter dates from 1582 to 2199:</p>
<p>To find the day that Easter falls on in the current year and to show all Easter
dates from 1582 to 2199:</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">./try.sh</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
<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>
<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>
<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
@@ -191,93 +191,67 @@ 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
<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>
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>
<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>
<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>
<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>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1996schweikh1"><a name="inventory"></a>Inventory
for 1996/schweikh1</h1>
<h1 id="inventory-for-1996schweikh1"><a name="inventory"></a>Inventory for 1996/schweikh1</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh1/schweikh1.c">schweikh1.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh1/Makefile">Makefile</a>
- entry 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="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh1/try.sh">try.sh</a>
- how to run</li>
<li><a href="1996_schweikh1.tar.bz2">1996_schweikh1.tar.bz2</a> -
download entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh1/schweikh1.c">schweikh1.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh1/Makefile">Makefile</a> - entry 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="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh1/try.sh">try.sh</a> - how to run</li>
<li><a href="1996_schweikh1.tar.bz2">1996_schweikh1.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh1/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<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="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh1/.entry.json">.entry.json</a> - description of entry in JSON</li>
<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/README.md">README.md</a>
- markdown source for index.html</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/output-index-inventory.sh -->
+70 -102
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Jens_Schweikhardt">Jens
Schweikhardt</a><br> Location: <a href="../../location.html#DE">DE</a> -
<em>Federal Republic of Germany</em> (<em>Germany</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Jens_Schweikhardt">Jens Schweikhardt</a><br>
Location: <a href="../../location.html#DE">DE</a> - <em>Federal Republic of Germany</em> (<em>Germany</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -147,8 +147,7 @@ Schweikhardt</a><br> Location: <a href="../../location.html#DE">DE</a> -
<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 (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>
@@ -157,14 +156,13 @@ Schweikhardt</a><br> Location: <a href="../../location.html#DE">DE</a> -
<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 once to
<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 once to
make it easier to see what is happening.</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>
<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>
@@ -172,54 +170,47 @@ href="hunni.pl">hunni.pl</a>, obfuscates it appropriately. Try:</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>
<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
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>
(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>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>
<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 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>
@@ -227,16 +218,16 @@ their greatest common divisor.</p>
<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>
<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>
@@ -245,62 +236,39 @@ evaluated in about 3 cpu minutes (<code>gcc -O3</code>).</p>
<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>
<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>
<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>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1996schweikh2"><a name="inventory"></a>Inventory
for 1996/schweikh2</h1>
<h1 id="inventory-for-1996schweikh2"><a name="inventory"></a>Inventory for 1996/schweikh2</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh2/schweikh2.c">schweikh2.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh2/Makefile">Makefile</a>
- entry 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 entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh2/schweikh2.c">schweikh2.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh2/Makefile">Makefile</a> - entry 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 entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh2/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<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="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh2/.entry.json">.entry.json</a> - description of entry in JSON</li>
<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/README.md">README.md</a>
- markdown source for index.html</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/output-index-inventory.sh -->
+75 -103
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Jens_Schweikhardt">Jens
Schweikhardt</a><br> Location: <a href="../../location.html#DE">DE</a> -
<em>Federal Republic of Germany</em> (<em>Germany</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Jens_Schweikhardt">Jens Schweikhardt</a><br>
Location: <a href="../../location.html#DE">DE</a> - <em>Federal Republic of Germany</em> (<em>Germany</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,38 +142,34 @@ Schweikhardt</a><br> Location: <a href="../../location.html#DE">DE</a> -
<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>
<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>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>
<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`),
<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>
<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="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">$</span> g++ schweikh3.c</span>
<span id="cb4-2"><a href="#cb4-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="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="st">schweikh3.c:16: parse error before `new&#39;</span></span>
@@ -191,20 +187,18 @@ keyword by default, e.g. gcc:</p>
<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a><span class="st">schweikh3.c: At top level:</span></span>
<span id="cb5-6"><a href="#cb5-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
<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>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>
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>
@@ -212,97 +206,75 @@ possible execution paths.</p>
<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>
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>
<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>
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>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>
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>
(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>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1996schweikh3"><a name="inventory"></a>Inventory
for 1996/schweikh3</h1>
<h1 id="inventory-for-1996schweikh3"><a name="inventory"></a>Inventory for 1996/schweikh3</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh3/schweikh3.c">schweikh3.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh3/Makefile">Makefile</a>
- entry 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 entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh3/schweikh3.c">schweikh3.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh3/Makefile">Makefile</a> - entry 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 entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh3/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<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="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/schweikh3/.entry.json">.entry.json</a> - description of entry in JSON</li>
<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/README.md">README.md</a>
- markdown source for index.html</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/output-index-inventory.sh -->
+61 -97
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Brian_Westley">Brian
Westley</a><br> Location: <a href="../../location.html#US">US</a> -
<em>United States of America</em> (<em>United States</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Brian_Westley">Brian Westley</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -141,9 +141,9 @@ Westley</a><br> Location: <a href="../../location.html#US">US</a> -
<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>
<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>
@@ -151,127 +151,91 @@ use and why it was made the alt version.</p>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./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>
<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 winning
entry! 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>
<p>Time and time again, Brian Westley seems to come up with a winning entry!
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
<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>
<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>
<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>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>
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>
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>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1996westley"><a name="inventory"></a>Inventory for
1996/westley</h1>
<h1 id="inventory-for-1996westley"><a name="inventory"></a>Inventory for 1996/westley</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/westley/westley.c">westley.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/westley/Makefile">Makefile</a>
- entry 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
entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/westley/westley.c">westley.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/westley/Makefile">Makefile</a> - entry 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 entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/westley/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<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="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/westley/.entry.json">.entry.json</a> - description of entry in JSON</li>
<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/README.md">README.md</a>
- markdown source for index.html</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/output-index-inventory.sh -->