build index.html for all winners

Updated manifest as per recent file changes.

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

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

These tools had slight improvements in the help usage message:

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

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

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

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

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

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

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

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

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

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

* `2000/rince/README.md`

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

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

* 2012/vik/README.md

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

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

* 2018/burton1/README.md

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

NOTE: Every reference needs to have a unique number.

* 2020/carlini/README.md

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

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

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

* author/Anonymous_2001.json

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

* author/Jari_Arkko.json

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

No files matched your search

+239 -13
View File
@@ -1,4 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- START: two lines up starts content from: inc/top.default.html -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,251 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 2000/anderson/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2000 anderson</title>
<meta name="description" content="IOCCC year: 2000 IOCCC winner: anderson winner index page">
<meta name="keywords" content="IOCCC,2000,anderson,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2000/anderson</title>
<meta name="description" content="2000 IOCCC winner anderson">
<meta name="keywords" content="IOCCC, 2000, IOCCC 2000, IOCCC winner, anderson">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>2000 anderson</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>2000/anderson</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.first.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fanderson%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/anderson/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left Disabled" href="#">first entry</a>
<a class="Left" href="../index.html">&uarr; 2000 &uarr;</a>
<a class="Left" href="../bellard/index.html">bellard &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.first.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#Glyn_Anderson">Glyn Anderson</a><br>
Location: <a href="/temp-test-ioccc/location.html#null">unknown</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="bu">echo</span> something <span class="kw">|</span> <span class="ex">./anderson</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This small program might be a nice addition to a digital personal
organizer; just in case you are stranded on a desert island and need to
signal your distress to passing ships.</p>
<p>The obfuscation in this program is truly masterful. The program is
very cleverly obscured without the use of a single <code>#define</code>!
Reformatting this program by hand :-) is the easiest way to understand
what is going on.</p>
<h3 id="note-about-defines-not-being-used">Note about
<code>#define</code>s not being used:</h3>
<p>In 2023 due to annoying warnings triggered at different times,
sometimes interspersed with the output of the program (this happens in
macOS), many entries were changed to use <code>fgets(3)</code> instead.
However to make the entries more like the original we redefined
<code>gets</code> to use <code>fgets</code>. Unfortunately it’s not
possible to do it through <code>-Dfoo</code> compiler options so there
is a <code>#define</code> in the code now.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This program is a simple filter that translates ASCII text into
semaphore code. It reads from standard input and converts all
alphanumeric characters to their corresponding semaphore codes.
Consecutive whitespace is translated as a single ‘break’ code. Newlines
also cause the next code to be output on a new line. All other
characters are ignored. The codes themselves are written to standard
output as a depiction of a person holding two flags, using only ASCII
characters (semaphore smileys, if you will). For example, given the
input “Hello, world!”, the output will be:</p>
<pre><code> &lt;&gt; &lt;&gt; &lt;&gt; &lt;&gt; &lt;&gt; &lt;&gt;
_() ()/ ()/ ()/ _\) () (/_ _\)
[] /^ |^^ /^^ /^^ [] ^^ |^^| ^^ [] [] ^^
&lt;&gt;[ [][ &lt;&gt;][ &lt;&gt;][ ][ [][] ][ ][
&lt;&gt; []
_()_ ()/ |() ()
[] ^^ [] /^^ ^^| |^^|
][ &lt;&gt;][ ][] [][]
</code></pre>
<p>The program is obfuscated without the use of the preprocessor or any
special compilation parameters. In fact, the program doesn’t even bother
using any keywords, save the single <code>char</code> at the beginning.
This program was crafted using only operator precedence rules,
short-circuit evaluation and recursion. Each function contains a single,
non-empty statement. (I did have to add a couple of empty statements to
format the code properly.) There is a single string constant which
encodes the flag positions and other data needed for drawing the
semaphore codes.</p>
<p>The preprocessor will provide no help in de-obfuscating this code,
and a C beautifier won’t get you very far either. You just have to
crunch through it.</p>
<p>An ANSI C compiler will generate several warnings when it compiles
this program, as none of the functions declare their return type, nor do
they return anything. This was necessary to keep the program free of
keywords. It’s valid in K&amp;R C, and compiles in ANSI C. There are
also warnings about conversion from <code>int</code> to
<code>char</code> and the resulting loss of data. Again, if it’s OK with
K&amp;R, it’s OK with me.</p>
<p>This program is a great teaching tool for learning the semaphore
code; and if you don’t have any flags handy you can just use two copies
of the source file.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-2000anderson"><a name="inventory"></a>Inventory
for 2000/anderson</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/anderson/anderson.c">anderson.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/anderson/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/anderson/anderson.orig.c">anderson.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/anderson/try.sh">try.sh</a>
- how to run</li>
<li><a href="2000_anderson.tar.bz2">2000_anderson.tar.bz2</a> - download
winning source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/anderson/.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/2000/anderson/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/anderson/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fanderson%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+191 -13
View File
@@ -1,4 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- START: two lines up starts content from: inc/top.default.html -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,203 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 2000/bellard/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2000 bellard</title>
<meta name="description" content="IOCCC year: 2000 IOCCC winner: bellard winner index page">
<meta name="keywords" content="IOCCC,2000,bellard,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2000/bellard</title>
<meta name="description" content="2000 IOCCC winner bellard">
<meta name="keywords" content="IOCCC, 2000, IOCCC 2000, IOCCC winner, bellard">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>2000 bellard</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>2000/bellard</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fbellard%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/bellard/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../anderson/index.html">&larr; anderson</a>
<a class="Left" href="../index.html">&uarr; 2000 &uarr;</a>
<a class="Left" href="../bmeyer/index.html">bmeyer &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#Fabrice_Bellard">Fabrice
Bellard</a><br> Location: <a
href="/temp-test-ioccc/location.html#FR">FR</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./bellard</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This code is a nice compact example of a Modular Fast Fourier
Transform. While its output is very specific, the internal FFT has a
wide variety of uses.</p>
<p>Can you modify this code to produce primes such as
<code>23523*2^70000-1</code>, <code>48594^65536+1</code> or
<code>6917!-1</code>?</p>
<p>NOTE: as bigger primes are found as time goes by this program no
longer prints the biggest prime once noted by the author below.</p>
<h2 id="authors-comments">Author’s comments:</h2>
<p>This program prints the biggest known prime number
(<code>2^6972593-1</code>) in base 10. It requires a few minutes. It
uses a Modular Fast Fourier Transform to compute this number in a
reasonable amount of time (the usual method would take ages !).</p>
<p>The program uses &gt;= 64 bit <code>long long</code> type. It should
run on any system with a gcc compiler.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-2000bellard"><a name="inventory"></a>Inventory for
2000/bellard</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/bellard/bellard.c">bellard.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/bellard/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/bellard/bellard.orig.c">bellard.orig.c</a>
- original source</li>
<li><a href="2000_bellard.tar.bz2">2000_bellard.tar.bz2</a> - download
winning source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/bellard/.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/2000/bellard/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/bellard/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fbellard%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+452 -13
View File
@@ -1,4 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- START: two lines up starts content from: inc/top.default.html -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,464 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 2000/bmeyer/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2000 bmeyer</title>
<meta name="description" content="IOCCC year: 2000 IOCCC winner: bmeyer winner index page">
<meta name="keywords" content="IOCCC,2000,bmeyer,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2000/bmeyer</title>
<meta name="description" content="2000 IOCCC winner bmeyer">
<meta name="keywords" content="IOCCC, 2000, IOCCC 2000, IOCCC winner, bmeyer">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>2000 bmeyer</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>2000/bmeyer</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fbmeyer%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/bmeyer/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../bellard/index.html">&larr; bellard</a>
<a class="Left" href="../index.html">&uarr; 2000 &uarr;</a>
<a class="Left" href="../briddlebane/index.html">briddlebane &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#Bernd_Meyer">Bernd Meyer</a><br>
Location: <a href="/temp-test-ioccc/location.html#AU">AU</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./bmeyer</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<p>In a video window (white text on black background):</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>
<p>The script will suggest you compare the output of the program with
images, prompting you to press any key to continue so that you may do
so.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Don’t even think of supplying different compression factors (the
dashed argument) for compression and decompression! You’ve been
warned.</p>
<p>The author recommended on linux/x86, glibc 2.0, libc4/5:</p>
<pre class="make"><code>bmeyer: bmeyer.c
CC -DY=&quot;__setfpucw(0x127f)&quot; -O6 $? -o $@ -lm</code></pre>
<p>However many compilers use <code>-O3</code> as the maximum level for
<code>-O</code> optimization.</p>
<p>And on linux/x86, glibc 2.1:</p>
<pre class="make"><code>bmeyer: bmeyer.c
gcc -DY=&#39;int x=0x127f; __asm__ (&quot;fldcw %0&quot; : : &quot;m&quot; (*&amp;x))&#39; $? -o $@ -lm</code></pre>
<p>Compile with the maximum possible optimization on your system. If
your system has 80-bit internal representation of floating point values
(x86, some Motorola processors) and you want the compressed format to be
portable across platforms, you need to set your FPU to use 64 bit mode.
Read the author’s remarks below for more details.</p>
<p>If you cannot work out how to get into 64 bit mode, you can try using
<code>-ffloat-store</code> if you compile with GCC (this may have a
performance penalty). The resulting binary will have a good chance to
produce portable files, but due to the resulting double-rounding (first
internally set to 80 bit, then to 64 bit on writing the value to
memory), there is a small but very real chance any given file produced
might not be portable.</p>
<p>The <a href="Makefile">Makefile</a> defaults to <code>-O3</code> and
no <code>asm()</code> call.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This program is called <code>GLICBAWLS</code></p>
<h4 id="function">Function</h4>
<p><code>GLICBAWLS</code> stands for “Grey Level Image Compression By
Adaptive Weighted Least Squares”.</p>
<p>And that’s exactly what this program does — feed it a .PGM file
(either raw [i.e. P5] or ASCII [i.e. P2]) on stdin, and it will output a
compressed version to stdout. Feed it a compressed file on stdin, and it
will decompress it to stdout — as either raw or ASCII .PGM, depending on
what format it was compressed from. For example:</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">./glicbawls</span> <span class="op">&lt;</span> michael.pgm <span class="op">&gt;</span> michael.glic</span></code></pre></div>
<p>and then</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./glicbawls</span> <span class="op">&lt;</span> michael.glic <span class="op">&gt;</span> michael.decoded.pgm</span></code></pre></div>
<p>As it turns out, <code>glicbawls</code> compresses greyscale images
(or, more precisely, “natural” greyscale images) better than any other
program I am aware of (with the exception of the not-yet-published
program developed for my PhD thesis). Of course, this might take some
time, so a progress indicator is provided. To make things more
interesting, instead of a boring bar or percentage display, an ASCII
rendition of the image being compressed/decompressed is output to
<code>stderr</code> (assuming white text on black background). If you
have trouble recognizing the image, try squinting at it ;-).</p>
<p>If you still have trouble, simply use a terminal or xterm with more
than 80 columns, and tell <code>glicbawls</code> about it by giving the
number of columns as an argument. For example</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./glicbawls</span> 260 <span class="op">&lt;</span>lavabus.pgm <span class="op">&gt;</span>lavabus.glic</span></code></pre></div>
<p>will allow <code>glicbawls</code> to use up to 260 columns, which
makes things much more recognizable.</p>
<p>Still running out of space? Need to compress those images just a tad
more? And maybe you can handle some loss due to the compression? If so,
you can use <code>glicbawls</code>’ “near lossless” compression mode. In
that mode, the decoded pixel values are allowed to differ from the
originals, but there is an upper limit on the magnitude of the
difference. For example, if a maximum error of 2 is allowed, an original
pixel value of 37 could be decoded as 35, 36, 37, 38 or 39. In order to
use this mode, simply give the maximum allowed error as an argument,
with a dash (<code>-</code>) before it. For example:</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="ex">./glicbawls</span> <span class="at">-2</span> <span class="op">&lt;</span> graph.pgm <span class="op">&gt;</span> graph.2.glic</span></code></pre></div>
<p>will compress in a way that allows decompression with a maximum error
of two. You can combine both types of arguments, i.e.:</p>
<div class="sourceCode" id="cb10"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./glicbawls</span> <span class="at">-3</span> 180 <span class="op">&lt;</span> graph.pgm <span class="op">&gt;</span>graph.3.glic</span></code></pre></div>
<p>will compress with a maximum error of 3, using a 180 column terminal
for the progress display, and:</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="ex">./glicbawls</span> <span class="at">-3</span> 180 <span class="op">&lt;</span> graph.3.glic <span class="op">&gt;</span> graph.3maxerr.pgm</span></code></pre></div>
<p>will decompress the result on such a terminal.</p>
<p>But wait, there is more — you can also feed <code>glicbawls</code>
.PPM files (i.e. colour images), raw or ASCII, your choice.
<code>glicbawls</code> will compress and decompress them just fine.
However, it only does “reasonably well” on them; It beats PNG easily,
but there are certainly programs out there that can compress colour
images considerably better. And don’t even <em>think</em> about using it
for so-called “artistic” images (i.e. anything that wasn’t scanned from
a photo or camera)….</p>
<h3 id="warning">WARNING</h3>
<p><code>glicball</code> is rather CPU and FPU intensive. Don’t run it
on anything slow. Things start to be usable around 300+MHz, with 600+
being highly desirable.</p>
<h3 id="compile-instructions">Compile Instructions</h3>
<p>Unlike most compression program, <code>glicbawls</code> makes heavy
use of floating point maths — and not all FPUs are created equal. Most
importantly, the x86 and 68k FPUs use 80 bit floating point formats
internally, while most other processors use IEEE 64 bit formats by
default. If not taken care of, this means that a <code>glicbawls</code>
file compressed on one CPU cannot generally be decompressed on
another.</p>
<p>Fortunately, just about all current FPUs can be put into IEEE 64 bit
mode (or at least something close enough for <code>glicbawls</code>).
Unfortunately, there is no standard way of doing so. For this reason,
the build file contains <em>three</em> compile lines; one for machines
that already use 64 bit mode by default (most RISC processors), one for
linux/x86 machines using libc4, libc5 or glibc2.0, and one for linux/x86
machines using glibc2.1 (glibc2.1 no longer exports the
<code>__setfpucw()</code> function, necessitating the use of gcc inline
assembly. *Grumble*).</p>
<p>So, if you are building on a machine that does not, by default, use
IEEE 64 bit floating point doubles, you’ll have to define <code>Y</code>
to be a command that switches it into that mode. If you fail to do so,
your <code>glicbawls</code> executable will still be able to decompress
its own compressed files, but you may be unable to exchange files with
<code>glicbawls</code> on other machines.</p>
<h3 id="obfuscation">Obfuscation</h3>
<p>Most of the obfuscation of this program was driven by the desperate
struggle to fit all of <code>glicbawls</code>’ features into code that
fits the IOCCC’s size limits. All identifiers’ names are
single-character, which was only possible by ruthless exploitation of
scope. There is a function <code>M()</code> that handles nearly all
input from <code>stdin</code>, handles all output to
<code>stdout</code>, and also recursively calculates one of the
mathematical expressions needed for error modelling. There is a function
that calculates <code>(A^(-1)*b)*x</code> with <code>A</code> being a
matrix and <code>b</code> and <code>x</code> being vectors, and does so
in a very efficient way — but one would be hard pressed to find it.
There is an arithmetic coder that is even less recognizable. A lot of
loop variables don’t get initialized, but instead the code is arranged
in such a way that they just happen to have the right value when control
flow reaches the loops. Lots of functions use the same two global
scratch variables. Variables change their meaning all the time, and the
differences between compressing and decompressing are handled in rather
subtle ways all over the program. The string that holds the ASCII values
for displaying the progress image doubles as a description on how to
find a pixel’s causal neighbours. And then there are a few
<code>#define</code>s that really are just in there to save a few
characters, but as an added “benefit” make the source ever more
unreadable.</p>
<p>In short — running it through the preprocessor and the pretty-printer
will give you something that looks slightly less like line noise and
slightly more like a C program, but unless you are a true wizard, it is
unlikely to gain you any insights into what is actually going on….<a
href="#fn1" class="footnote-ref" id="fnref1"
role="doc-noteref"><sup>1</sup></a></p>
<h3 id="bugs-assumptions-and-todo">Bugs, Assumptions and TODO</h3>
<p><code>glicbawls</code> assumes that characters are 8 bit wide, and
that the character set used is ASCII. If one of these isn’t true, all
hell will break loose.</p>
<p>The .PGM headers are not checked very thoroughly —
<code>glicbawls</code> will happily try to encode lots of files that it
shouldn’t touch. The old adage of “garbage in, garbage out” holds in
that case. Furthermore, even if <code>glicbawls</code> detects an
incorrect input, it fails to provide a meaningful error message, and
instead simply aborts.</p>
<p>When decompressing a near-lossless encoded image, the maximum allowed
error is required as a command line parameter. This should really be
saved in the compressed file!</p>
<p><code>glicbawls</code> relies on the decimal representation of all
integers having less than 255 digits. While ANSI C does not guarantee
this, it seems rather unlikely that anyone in the foreseeable future
would use images with <code>10^255</code> rows, columns or different
levels of grey. Also, it is assumed that any integer used can be cast to
a <code>double</code> and back without loss of precision. This limits
the number of rows, columns and grey levels to 9 quintillion, which
should also be sufficient for the next few years.</p>
<p>There is a theoretical chance that you might get a division by zero
error. You have a MUCH better chance of getting hit by lightning the
very second you realize that you just won a few million in a lottery.
But if it happens to you, don’t say I didn’t warn you! Instead, go out
and buy a lightning rod and a lottery ticket ;-)</p>
<p>At one point, a pointer to <code>int</code> is used as the target of
a <code>"%1[#]"</code> conversion in a <code>scanf(3)</code>, which
makes gcc rather unhappy, but shouldn’t really cause anyone any trouble.
The same goes for a couple of assignments which are used as truth
values.</p>
<h3 id="algorithm">Algorithm</h3>
<p>An exhaustive explanation of the algorithm used would go beyond the
scope of an info file, and would also be quite difficult in pure ASCII,
so the following is just a rough outline, and contains some
compression-speak…</p>
<p>The image is handled in <a
href="https://en.wikipedia.org/wiki/Scan_line">scanline</a> ordering.
For each pixel, an expected value is calculated by creating a least
squares predictor of order 12 based on all of the previously
encoded/decoded pixels. However, the contribution of each pixel is
weighted according to its <a
href="https://en.wikipedia.org/wiki/Taxicab_geometry">Manhattan-distance</a>
from the current pixel, <code>D</code>. That weight used is
<code>pow(0.8,D)</code>. <a href="#fn2" class="footnote-ref" id="fnref2"
role="doc-noteref"><sup>2</sup></a> <a href="#fn3" class="footnote-ref"
id="fnref3" role="doc-noteref"><sup>3</sup></a> <a href="#fn4"
class="footnote-ref" id="fnref4" role="doc-noteref"><sup>4</sup></a></p>
<p>In a similar way, the prediction <em>errors</em> for all previous
pixels are combined — a weighted average (with weight
<code>pow(0.7,D)</code>) of the squares of all previous prediction
errors is taken, and the square root of the (appropriately scaled)
result is called sigma.</p>
<p>The predicted value and sigma are then used as the parameters of a <a
href="https://en.wikipedia.org/wiki/Student%27s_t-distribution">Student
or t-distribution</a> (which is similar to a <a
href="https://en.wikipedia.org/wiki/Normal_distribution">normal
distribution</a>, but has more weight in the tails), providing a <a
href="https://en.wikipedia.org/wiki/Probability_distribution">probability
distribution</a> for the current pixel.</p>
<p>Next, the possible interval of values for the current pixel is
halved, and through integration of the probability distribution, a
probability is calculated for the pixel value being in the lower half.
During encoding, the actual value is examined, and the result encoded
using an arithmetic coder. During decoding, the arithmetic decoder
provides the information which half the actual value is in. In both
cases, the interval borders are adjusted accordingly, the arithmetic
coder/decoder updated, and the interval halving repeated until the
precise value has been en/decoded<a href="#fn5" class="footnote-ref"
id="fnref5" role="doc-noteref"><sup>5</sup></a>.</p>
<h3 id="photo-credit">Photo Credit:</h3>
<p><a href="lavabus.pgm">Lavabus</a> was taken by the judge, Landon Curt
Noll. <a href="michael.pgm">Michael</a> was provided by the author. <a
href="lenna.glic">Lenna</a> is a 1972 Playboy centerfold (doesn’t show
very much).</p>
<ul>
<li><p><a href="michael.pgm">michael.pgm</a></p>
<p>The author’s Godchild and nephew.</p></li>
<li><p><a href="lavabus.pgm">lavabus.pgm</a></p>
<p>A bus that was trapped by lava from <a
href="https://en.wikipedia.org/wiki/Kīlauea">Kilauea volcano</a> in
Hawaii, US. Nobody was in the bus at the time, BTW. Photo date:
1981.</p></li>
<li><p><a href="lenna.glic">lenna.glic</a></p>
<p>A November 1972 Playboy centerfold was scanned in long ago and has
been used for image compression research since then. Playboy originally
threatened to prosecute unauthorized use, but eventually granted that,
having been in use for image compression testing for so long, it was now
a useful benchmark. (Note: This picture doesn’t show very
much.)</p></li>
</ul>
<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>
<section id="footnotes" class="footnotes footnotes-end-of-document"
role="doc-endnotes">
<hr />
<ol>
<li id="fn1"><p>Yes, this could be seen as a challenge….<a
href="#fnref1" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<li id="fn2"><p>Actually, the weight is <code>pow(0.8,D)/s</code>, where
<code>s</code> is the sigma used for encoding/decoding the particular
previous pixel. Dividing by <code>s</code> is a rather arbitrary action
justified only by the improvement in results. Mathematically, I can only
justify dividing by <code>s^2</code>, or not dividing at all….<a
href="#fnref2" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<li id="fn3"><p>Obviously, these least squares predictors are not
calculated from scratch for each pixel. Some clever reuse of earlier
results allows <code>O(1)</code> calculation, rather than the
<code>O(previous_rows*columns)</code> this description would suggest.<a
href="#fnref3" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<li id="fn4"><p>As anyone who has ever tried local least squares knows
from bitter experience, there is a lot of numerical instability
associated with them. So <code>glicbawls</code> adds a bias towards an
averaging predictor to the equation system the least squares predictor
is calculated from. The weight that is given to this bias is constantly
adjusted throughout coding/decoding, thus justifying the ‘a’ in
<code>glicbawls</code>.<a href="#fnref4" class="footnote-back"
role="doc-backlink">↩︎</a></p></li>
<li id="fn5"><p>In the case of near-lossless coding, the interval is not
necessarily <em>halved</em>, but rather split at a convenient point (the
split points are chosen in such a way as to minimise the expected number
of bits needed for coding). Also, the iteration ends as soon as the
interval is small enough to guarantee decoding within the requested
maximum error.<a href="#fnref5" class="footnote-back"
role="doc-backlink">↩︎</a></p></li>
</ol>
</section>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-2000bmeyer"><a name="inventory"></a>Inventory for
2000/bmeyer</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/bmeyer/bmeyer.c">bmeyer.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/bmeyer/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/bmeyer/bmeyer.orig.c">bmeyer.orig.c</a>
- original source</li>
<li><a href="lavabus.pgm">lavabus.pgm</a> - Kilauea volcano bus trapped
in lava</li>
<li><a href="michael.pgm">michael.pgm</a> - author’s Godchild and
Nephew</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/bmeyer/try.sh">try.sh</a>
- how to run</li>
<li><a href="lenna.glic">lenna.glic</a> - P10 scan of 1972 Playboy
centerfold</li>
<li><a href="2000_bmeyer.tar.bz2">2000_bmeyer.tar.bz2</a> - download
winning source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/bmeyer/.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/2000/bmeyer/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/bmeyer/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fbmeyer%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+205 -13
View File
@@ -1,4 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- START: two lines up starts content from: inc/top.default.html -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,217 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 2000/briddlebane/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2000 briddlebane</title>
<meta name="description" content="IOCCC year: 2000 IOCCC winner: briddlebane winner index page">
<meta name="keywords" content="IOCCC,2000,briddlebane,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2000/briddlebane</title>
<meta name="description" content="2000 IOCCC winner briddlebane">
<meta name="keywords" content="IOCCC, 2000, IOCCC 2000, IOCCC winner, briddlebane">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>2000 briddlebane</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>2000/briddlebane</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fbriddlebane%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/briddlebane/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../bmeyer/index.html">&larr; bmeyer</a>
<a class="Left" href="../index.html">&uarr; 2000 &uarr;</a>
<a class="Left" href="../dhyang/index.html">dhyang &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Authors:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#Lord_Zarbon">Lord Zarbon</a><br>
Location: <a href="/temp-test-ioccc/location.html#null">unknown</a>
<br><br>Name: <a
href="/temp-test-ioccc/winners.html#Moxen_N_Briddlebane">Moxen N.
Briddlebane</a><br> Location: <a
href="/temp-test-ioccc/location.html#null">unknown</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./briddlebane</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<p>For some fun every time you log in try running this from your
<code>.bashrc</code> or equivalent file!</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>One could argue that this program was a “diseased dumpster of tripe”
but I suspect that would only result in the judges being heckled as a
“scum-encrusted congress of obscurity” (but only if it was in the early
evening of Dec 22, 2000).</p>
<p>Can you find out how it stores the insult strings? Can you then take
an insult and figure out when it will be uttered?</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This program was broadcast from deep within the Zarbonic Cluster and
received at 9:03pm on March 21st, 2000 by Moxen N. Briddlebane. The
original author, as designated by other components of the transmission,
refers to himself simply as “Lord Zarbon”, though offers no information
in relation to the significance of that post. The sole purpose of this
program appears to be to degrade and humiliate the people of this planet
by calling them names. It takes no input, it only produces a single line
of slanderous output.</p>
<p>The program appears to be rather confused, internally. It is unclear
whether or not “Lord Zarbon” truly understands the mechanics of
programming. What is particularly disturbing is the curious method of
insult-encoding employed by this program. Furthermore, it is ambiguous
how said data is arranged and why it is necessary to resort to
trigonometric functions to handle it. One of the real mysteries involves
the numbers <code>114</code> and <code>2</code>, which are, according to
Lord Zarbon, very deliberate.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-2000briddlebane"><a name="inventory"></a>Inventory
for 2000/briddlebane</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/briddlebane/briddlebane.c">briddlebane.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/briddlebane/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/briddlebane/briddlebane.orig.c">briddlebane.orig.c</a>
- original source</li>
<li><a href="2000_briddlebane.tar.bz2">2000_briddlebane.tar.bz2</a> -
download winning source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/briddlebane/.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/2000/briddlebane/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/briddlebane/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fbriddlebane%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+209 -13
View File
@@ -1,4 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- START: two lines up starts content from: inc/top.default.html -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,221 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 2000/dhyang/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2000 dhyang</title>
<meta name="description" content="IOCCC year: 2000 IOCCC winner: dhyang winner index page">
<meta name="keywords" content="IOCCC,2000,dhyang,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2000/dhyang</title>
<meta name="description" content="2000 IOCCC winner dhyang">
<meta name="keywords" content="IOCCC, 2000, IOCCC 2000, IOCCC winner, dhyang">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>2000 dhyang</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>2000/dhyang</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fdhyang%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/dhyang/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../briddlebane/index.html">&larr; briddlebane</a>
<a class="Left" href="../index.html">&uarr; 2000 &uarr;</a>
<a class="Left" href="../dlowe/index.html">dlowe &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#Don_Yang">Don Yang</a><br> Location:
<a href="/temp-test-ioccc/location.html#US">US</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./dhyang</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>A beautiful combination of solving several different problems, but
mostly, the single most impressive layout we’ve ever seen. Many programs
have <em>one</em> interesting layout; this one has four.</p>
<p>It may be informative to run the code through a “beautifier”, to
study it, but the layout itself is where most of the interest lies.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This one is dedicated to Saitou Hajime fans <code>^_^x</code></p>
<p>Instead of making one self reproducing program, what I made was a
program that generates a set of mutually reproducing programs, all of
them with cool layout!</p>
<p>For your enjoyment:</p>
<ol type="1">
<li>Compile <a href="dhyang.c">dhyang.c</a>.</li>
<li>Run <code>./dhyang</code> and redirect output to another
<code>.c</code> file.</li>
<li>Compile that file.</li>
<li>Repeat steps 2 and 3 until eventually the output cycles.</li>
</ol>
<p>To interpret the output: the <a href="dhyang.c.c">dhyang.c</a> is an
image of Saitou Hajime, which eventually generates three sources files
that are images of “aku soku zan” (sin swift slay), Saitou’s motto
;)</p>
<p>For best viewing, set tab spaces to 8 characters, and set your
terminal fonts to as close to square as possible. I hate to do this but
you know, size…</p>
<p><a href="dhyang.c">dhyang.c</a> and all its output compiles with gcc
if your OS uses ASCII character set. No file is included and all
functions assume default <code>int</code> return type (a source of
compile warnings).</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-2000dhyang"><a name="inventory"></a>Inventory for
2000/dhyang</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/dhyang/dhyang.c">dhyang.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/dhyang/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/dhyang/dhyang.orig.c">dhyang.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/dhyang/try.sh">try.sh</a>
- how to run</li>
<li><a href="2000_dhyang.tar.bz2">2000_dhyang.tar.bz2</a> - download
winning source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/dhyang/.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/2000/dhyang/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/dhyang/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fdhyang%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+389 -13
View File
@@ -1,4 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- START: two lines up starts content from: inc/top.default.html -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,401 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 2000/dlowe/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2000 dlowe</title>
<meta name="description" content="IOCCC year: 2000 IOCCC winner: dlowe winner index page">
<meta name="keywords" content="IOCCC,2000,dlowe,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2000/dlowe</title>
<meta name="description" content="2000 IOCCC winner dlowe">
<meta name="keywords" content="IOCCC, 2000, IOCCC 2000, IOCCC winner, dlowe">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>2000 dlowe</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>2000/dlowe</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fdlowe%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/dlowe/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../dhyang/index.html">&larr; dhyang</a>
<a class="Left" href="../index.html">&uarr; 2000 &uarr;</a>
<a class="Left" href="../jarijyrki/index.html">jarijyrki &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#J_David_Lowe">J. David Lowe</a><br>
Location: <a href="/temp-test-ioccc/location.html#US">US</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<p>The following bit of perl may help determine the values you need:</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="fu">perl</span> <span class="at">-MConfig</span> <span class="at">-e</span> <span class="st">&#39;print &quot;$Config{archlibexp}/CORE\n&quot;&#39;</span></span></code></pre></div>
<p>… just in case the Makefile does not figure this out for you.</p>
<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 platforms - please help us fix
STATUS: known bug - please help us fix</code></pre>
<p>For more detailed information see <a href="/bugs.md#2000-dlowe">2000
dlowe in bugs.md</a>.</p>
<h2 id="to-use">To use:</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">./dlowe</span> [file ...]</span></code></pre></div>
<h2 id="try">Try:</h2>
<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="bu">echo</span> <span class="st">&quot;13 14 15 16 17 + - * / p&quot;</span> <span class="kw">|</span> <span class="ex">./dlowe</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>When this entry was submitted the rules of the IOCCC did not prohibit
the use of embedded language interpreters. The judges considered
disqualifying this entry because of the use of perl, but on the other
hand it qualifies as the Worst Abuse of the Rules. As a previous winner*
David Lowe continues to inflict the highest quality “poot” on the
Judges.</p>
<p>The program also contains an undocumented command for Chad and Chongo
(Landon). The judges’ remarks contain a clue to the hidden command
:-).</p>
<ul>
<li>The IOCCC uses an anonymous judging process which keeps the identity
of the submitters hidden until all the prize winners have been
selected.</li>
</ul>
<h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="usage">Usage</h3>
<pre><code>./dlowe [file ...]</code></pre>
<h3 id="synopsis">Synopsis</h3>
<p>This is a <a
href="https://en.wikipedia.org/wiki/Reverse_Polish_notation">Reverse
Polish calculator</a>, loosely based on the <code>dc(1)</code> unix
calculator.</p>
<h1 id="syntax">Syntax</h1>
<p>This program understands the following <code>dc(1)</code>
commands:</p>
<pre><code>p prints the top stack value without altering the stack.
P prints the top stack value, removing it from the stack, and
doesn&#39;t print a trailing newline.
f prints the contents of the stack, one number per line,
without modifying it.
c clears the stack.
d pushes a copy of the top stack value onto the stack.
r reverses the order of the top two stack values.</code></pre>
<p>And the following arithmetic operators are supported:</p>
<pre><code> + Pops 2 values and pushes their sum.
- Pops 2 values and pushes the result of subtracting the first
from the second.
* Pops 2 values and pushes their product.
/ Pops 2 values and pushes the result of dividing the second
by the first.
^ Pops 2 values and pushes the result of raising the second
to the power of the first.
% Pops 2 values and pushes the remainder of the division that
/ would do.</code></pre>
<p>The precision and range are double, like it or not, except that the
modulus operator actually returns <code>(p1 - (p2 * (p1 / p2)))</code>,
but with the innermost division calculated at integer precision. This is
usually what you expect
(e.g. <code>echo "12 8 % p" | ./dlowe == 4</code>)</p>
<p>Commands are read from <code>stdin</code> or from a list of files
named on the command line. Unlike <code>dc(1)</code>, multiple commands
on the same line must be space separated. Commands are only executed
when a newline or EOF is encountered.</p>
<h3 id="diagnostics">Diagnostics:</h3>
<pre><code>&quot;stack empty&quot; Not enough on the stack for the requested command
&quot;divide by zero&quot; Attempt to divide by zero
&quot;unimplemented&quot; Invalid input
Floating point exception (core dumped) (or something to that effect)
Bug in Perl_sv_upgrade causes this in some cases when
the results of an operation are really huge (&gt; 10^308)
This bug appears to be fixed in perl5.6.0
</code></pre>
<h3 id="examples">Examples:</h3>
<div class="sourceCode" id="cb10"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> echo <span class="st">&#39;12 13 14 15 16 + + + + f&#39;</span> <span class="kw">|</span> <span class="ex">./dlowe</span></span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a><span class="ex">70</span></span>
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> echo <span class="st">&#39;12 13 14 15 16 17 + - * / p&#39;</span> <span class="kw">|</span> <span class="ex">./dlowe</span></span>
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a><span class="ex">-0.0515873015873016</span></span>
<span id="cb10-5"><a href="#cb10-5" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> echo <span class="st">&#39;+&#39;</span> <span class="kw">|</span> <span class="ex">./dlowe</span></span>
<span id="cb10-6"><a href="#cb10-6" aria-hidden="true" tabindex="-1"></a><span class="ex">stack</span> empty</span>
<span id="cb10-7"><a href="#cb10-7" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> echo <span class="st">&#39;999999999999999 1 + p&#39;</span> <span class="kw">|</span> <span class="ex">./dlowe</span></span>
<span id="cb10-8"><a href="#cb10-8" aria-hidden="true" tabindex="-1"></a><span class="ex">1e+15</span></span>
<span id="cb10-9"><a href="#cb10-9" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> echo <span class="st">&#39;99999999999999 1 + p&#39;</span> <span class="kw">|</span> <span class="ex">./dlowe</span></span>
<span id="cb10-10"><a href="#cb10-10" aria-hidden="true" tabindex="-1"></a><span class="ex">100000000000000</span></span>
<span id="cb10-11"><a href="#cb10-11" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> echo <span class="st">&#39;12.5 9 % 10 * 15 + f&#39;</span> <span class="kw">|</span> <span class="ex">./dlowe</span></span>
<span id="cb10-12"><a href="#cb10-12" aria-hidden="true" tabindex="-1"></a><span class="ex">50</span></span>
<span id="cb10-13"><a href="#cb10-13" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> echo <span class="st">&#39;7 P 6 d P P 8 p&#39;</span> <span class="kw">|</span> <span class="ex">./dlowe</span> <span class="kw">|</span> <span class="fu">tr</span> 876 tpo</span>
<span id="cb10-14"><a href="#cb10-14" aria-hidden="true" tabindex="-1"></a><span class="ex">poot</span></span></code></pre></div>
<h3 id="code-concept">Code Concept:</h3>
<p>We all know that Perl and other VHLLs (very high level languages) are
particularly well-suited for (among other things) string handling, I/O,
and powerful built-in data types, and (relatively) poorly suited for
number crunching and other processor-intensive tasks - areas where C is
strongest. This program takes this knowledge to its extreme conclusion,
using each language for its strengths. Thus, it uses Perl to read and
parse input, for output, and for the easy-to-use list primitive, and
uses C for mathematical operations. Since the rules of this contest
state that the program must be generated by an ANSI C compiler, of
course, the outer Perl layer is wrapped with a thin layer of C.</p>
<p>In case that wasn’t clear, in a nutshell: this program is C, calling
embedded Perl (contained in a C string), which in turn calls back to C,
which performs math on Perl data types and calls Perl functions for
error reporting.</p>
<h3 id="requirements">Requirements:</h3>
<p>Unfortunately, Perl is an evolving beast - that includes the
embedding API and the XS API. The code was developed under
<code>Perl 5.005_03</code>, successfully tested against
<code>Perl 5.6.0</code>, <code>Perl 5.005_02</code> and
<code>Perl 5.004_04</code>, and according to the version delta
documentation, should work as-is with <code>Perl 5.002</code> and later
(which has been around since February 1996). To clarify - it’s not the
Perl code itself that may be non-portable, it’s the C code for embedding
Perl and for calling C from Perl.</p>
<p>It is also important that Perl be installed cleanly and correctly.
You may have problems linking if, for example, you have multiple
overlapping versions of Perl installed (which might not be a problem for
scripts, but causes problems with embedding the interpreter). More
commonly, you may get non-fatal warnings from the linker, caused by
slight mis-configurations of Perl on your system.</p>
<p>Some compilers also complain that “third argument of
<code>main()</code> is deprecated” or something to that effect. But in
Perl prior to <code>5.6.0</code>, the header file “proto.h” actually had
a prototype for <code>main()</code>, so applications which embed Perl
must use the three argument form of <code>main()</code>.</p>
<h3 id="aside-history">Aside: history…</h3>
<p>Larry Wall wrote the original Perl in 1986-87, the same two
successive years he won the IOCCC. I hope this program helps you to
realize that this was no fluke - that Perl and Obfuscation are as
inseparable as, say, camels and humps.</p>
<h3 id="obfuscated">Obfuscated?</h3>
<ul>
<li><p>Reverse Polish notation is pretty strange, in and of
itself.</p></li>
<li><p>The layout of the program is three roughly symmetrical “stacks”
of code. This layout is quite sensitive in places - my C indenter
actually breaks the code by inserting spaces in certain places.</p></li>
<li><p>Anyone who has ever programmed in Perl can attest to the fact
that it is particularly well-suited to obfuscation; thus, the Perl is
obfuscated. (Here’s my favorite legal Perl from this program:
<code>_:$_=&lt;&gt;;</code> - but <code>$SS[$#SS]-=$SS[$#SS-1]</code>
isn’t bad, either).</p></li>
<li><p>I’ve eschewed traditional branch and loop structures such as
<code>if</code> and <code>for</code>, in favor of their oft-neglected
cousins, <code>goto</code> and <code>?:</code>, in both the Perl and C
code.</p></li>
<li><p>I’ve used some highly magical Perl incantations, such as symbolic
references, the <code>goto &amp;NAME</code> syntax,
<code>AUTOLOAD</code> for exception handling, and abuse of the default
scalar (<code>$_</code>).</p></li>
<li><p>I’ve also deliberately used Perl syntax that is very much unlike
C syntax: the <code>&amp;NAME</code> rather than <code>NAME()</code>
function calling syntax, leaving off parentheses wherever possible,
using <code>print()</code> instead of <code>printf()</code>, and using
the English style logic operators <code>and</code> and <code>or</code>
rather than <code>&amp;&amp;</code> and <code>||</code>, for
example.</p></li>
<li><p>The fact that all the Perl code is in double-quotes doesn’t lend
any readability to the regular expressions and quoted strings
therein.</p></li>
<li><p>The points and ways in which C and Perl connect are
<em>really</em> obscure. They’re also incredibly poorly documented, as
they’re primarily used in machine-generated code. However, there’s a
wealth of example code on <a href="https://www.cpan.org">CPAN
(www.cpan.org)</a>.</p></li>
<li><p>The Perl API functions are almost all macros, so you will
probably find that preprocessor expansion will only make things worse.
They also have helpful, verbose names like <code>SvNV</code>,
<code>SvIV</code>, and <code>newSVpv</code>. I couldn’t have done better
myself!</p></li>
<li><p>Figuring out how the mathematical C functions get called is a bit
tricky. Note the lack of explicit switching based on command
input.</p></li>
<li><p>Because of the “interesting” way that commands are interpreted,
all of the commands have synonyms. For example, if you find it easier to
remember, <code>=</code> is synonymous with <code>d</code>. This also
makes it possible to write (even more) obfuscated reverse Polish
commands (I figure this explanation moves the synonyms from ‘bug’ to
‘feature’!)</p></li>
</ul>
<p>. The first IOCCC entry with an “easter egg”?…</p>
<h3 id="aside-on-unobfuscated-perl">Aside: on unobfuscated Perl</h3>
<p>My original intent was to write obfuscated C and crystal-clear Perl,
to highlight my bending of the rules. Unfortunately, Perl really doesn’t
lend itself to crystal-clear code…</p>
<h3 id="bending-the-rules">Bending the rules?</h3>
<p>Well, the rules never state that you can’t embed another programming
language, but on the other hand, knowing Perl probably isn’t high on the
list of qualifications for judges… Oh dear, I guess your C beautifier
won’t help too much, either ;)</p>
<p>If you don’t change the rules, it’ll be embedded Ada next year!</p>
<h3 id="auto-defend">Auto defend</h3>
<p>A. Isn’t this the obfuscated C contest? What’s this Perl
<code>$#_&amp;&amp;$_</code>?</p>
<p>D. Hey, this program <em>is</em> 100% C, and does not exec an
external Perl interpreter. It simply links against the Perl language
library. The “Perl code” is just a C string constant.</p>
<p>A. Perl isn’t portable enough, or ubiquitous enough.</p>
<p>D. I’d argue that it is more portable than X. According to the Perl
folks, it runs on the following platforms: Acorn, AIX, Amiga, AS/400,
BeOS, Concurrent, Debian, DEC OSF/1, Digital UNIX, EPOC, FreeBSD,
Guardian, HP-UX, IRIX, LinuxPPC, LynxOS, MacOS, MachTen, Minix, MPE/iX,
MS-DOS, MVS, NetBSD, Netware, NextStep, OpenBSD, OpenLinux, ODT,
OpenVMS, OS/2, OS390, OSR, PowerMAX, Psion, QNX, Redhat, Reliant UNIX,
RISCOS, SCO, SGI, SINIX, Slackware, Solaris, Sun, SuSE, Tandem, Tru64,
UNIX, U/WIN, Unixware, VMS, Win31, Win32, Windows 3.1, and Windows
95/98/NT/2K. Granted, embeddable Perl isn’t quite so portable, but
still…</p>
<p>Also, Perl 5 is bundled with the following OS distributions: AIX
4.3.3+, FreeBSD 3.0+, IRIX 6.4+, every Linux distribution, NetBSD,
OpenBSD, and DEC Tru64 5.0+, again according to the Perl people.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-2000dlowe"><a name="inventory"></a>Inventory for
2000/dlowe</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/dlowe/dlowe.c">dlowe.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/dlowe/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/dlowe/dlowe.orig.c">dlowe.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/dlowe/try.sh">try.sh</a>
- how to run</li>
<li><a href="2000_dlowe.tar.bz2">2000_dlowe.tar.bz2</a> - download
winning source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/dlowe/.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/2000/dlowe/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/dlowe/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fdlowe%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+459 -13
View File
@@ -1,4 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- START: two lines up starts content from: inc/top.default.html -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,471 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 2000/jarijyrki/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2000 jarijyrki</title>
<meta name="description" content="IOCCC year: 2000 IOCCC winner: jarijyrki winner index page">
<meta name="keywords" content="IOCCC,2000,jarijyrki,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2000/jarijyrki</title>
<meta name="description" content="2000 IOCCC winner jarijyrki">
<meta name="keywords" content="IOCCC, 2000, IOCCC 2000, IOCCC winner, jarijyrki">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>2000 jarijyrki</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>2000/jarijyrki</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fjarijyrki%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/jarijyrki/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../dlowe/index.html">&larr; dlowe</a>
<a class="Left" href="../index.html">&uarr; 2000 &uarr;</a>
<a class="Left" href="../natori/index.html">natori &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Authors:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#Jari_Arkko">Jari Arkko</a><br>
Location: <a href="/temp-test-ioccc/location.html#SE">SE</a>
<br><br>Name: <a
href="/temp-test-ioccc/winners.html#Jyrki_Holopainen">Jyrki
Holopainen</a><br> Location: <a
href="/temp-test-ioccc/location.html#FI">FI</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<p>You will need X11 header files and libraries installed to build this
program.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./jarijyrki</span> <span class="op">&lt;</span> infile.info <span class="op">&gt;</span> outfile.info</span></code></pre></div>
<p>You will need a system capable of displaying the results of X Window
programs.</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">./jarijyrki</span> <span class="op">&lt;</span> finance.sheet <span class="op">&gt;</span> myedits.info</span></code></pre></div>
<p>Then click on cell <code>C3</code> and type in the following:</p>
<pre><code>C5 C6 C7 @</code></pre>
<p>Click on cell <code>D4</code> and type in the following:</p>
<pre><code>C5 C6 C7 !</code></pre>
<p>Hit <code>ESC</code>.</p>
<p>Now try running:</p>
<pre><code>./jarijyrki &lt; myedits.info</code></pre>
<p>And observe that it matches what you had in the previous run!</p>
<p>NOTE: changing the dimension parameters (see the authors’ remarks)
renders existing spreadsheet files unusable.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This entry is one of those that makes you wonder why some commercial
software needs tens to hundreds of <strike>megabytes</strike>gigabytes
to install! This entry does not simply do the basics, it includes
graphing features. All this program needs now is a <a
href="1998/banks/README.md">flight simulator</a>!</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="overview">1. OVERVIEW</h3>
<p>This program is an X-Windows based spreadsheet program. The main
functions it supports are:</p>
<ul>
<li>Text cells</li>
<li>Numeric cells</li>
<li>Arithmetic operations: <code>+</code> <code>-</code> <code>*</code>
<code>/</code></li>
<li>Pie charts</li>
<li>Histograms</li>
<li>Cell editing</li>
<li>Formula line</li>
<li>Dynamic recalculation</li>
<li>Error detection</li>
<li>Recursion detection</li>
<li>Movement within the spreadsheet with arrow keys</li>
<li>Movement within the spreadsheet with mouse</li>
<li>Scrolling</li>
<li>Loading and saving spreadsheets</li>
<li>Visual style configuration</li>
</ul>
<h3 id="usage-instructions">2. USAGE INSTRUCTIONS</h3>
<h4 id="quick-guide">2.1. Quick Guide</h4>
<h5 id="starting">Starting</h5>
<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">./jarijyrki</span> <span class="op">&lt;</span> finance.sheet <span class="op">&gt;</span> myedits.info</span></code></pre></div>
<h5 id="stopping">Stopping</h5>
<p>Use the ESC key.</p>
<h5 id="movement">Movement</h5>
<p>Click the mouse or use the arrow keys.</p>
<h5 id="editing">Editing</h5>
<p>The currently selected cell is always in the edit state. Press any
key to add a character at the end of the formula; press backspace to
delete the last one.</p>
<h5 id="formulas">Formulas</h5>
<pre><code>123.45
A1 A2 +
B1 B2 -
C1 C2 *
D1 D2 /</code></pre>
<h5 id="pie-charts">Pie charts</h5>
<pre><code>A1 A2 A3 ...</code></pre>
<p>Finish the formula with <code>@</code> to create the pie chart.</p>
<h5 id="histograms">Histograms</h5>
<pre><code>A1 A2 A3 ...</code></pre>
<p>Finish the formula with <code>!</code> to create the histogram.</p>
<h4 id="starting-and-loading-spreadsheets">2.2. Starting and Loading
Spreadsheets</h4>
<p>To start the spreadsheet program with an existing spreadsheet, for
instance <a href="finance.sheet">finance.sheet</a>, use the following
command line:</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="ex">./jarijyrki</span> <span class="op">&lt;</span> finance.sheet</span></code></pre></div>
<p>The file <a href="finance.sheet">finance.sheet</a> has been provided
as an example. This file contains a set of financial numbers and two
graphical entities - a pie chart and a histogram - based on them. We
recommend starting the use of the program from this file, as a way to
study and learn the formula language supported by the program.</p>
<p>To start the program with an empty sheet, use</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">./jarijyrki</span> <span class="op">&lt;</span> /dev/null</span></code></pre></div>
<p>Alternatively, <code>/dev/zero</code> could be used but that may not
exist on all systems.</p>
<h4 id="exiting-and-saving-spreadsheets">2.3. Exiting and Saving
Spreadsheets</h4>
<p>Normally the user obviously wants to edit the spreadsheet. After the
spreadsheet program finishes, it outputs the edited spreadsheet to the
standard output. Hence, when the spreadsheet window has come up, you’ve
made your changes, and you press the ESC key the program finishes. To
save the results in a file, the following typical command line would be
used:</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="ex">./jarijyrki</span> <span class="op">&lt;</span> finance.sheet <span class="op">&gt;</span> myedits.info</span></code></pre></div>
<h4 id="visual-overview">2.4. Visual Overview</h4>
<p>On top of the window the Formula Area shows the formula (or text) of
the currently selected cell. The program starts with <code>A1</code> as
being the current cell. Below the Formula Area is the Column Letters
Area: <code>A</code>, <code>B</code>, and so on. Correspondingly, on the
left side of the window is the Row Numbers Area: <code>1</code>,
<code>2</code>, and so on. The rest of the window is dedicated to the
actual spreadsheet cells.</p>
<p>The example spreadsheet, <a href="finance.sheet">finance.sheet</a>,
provided with this program contains two sets of numbers in the visible
area of the spreadsheet. The top set of numbers forms the
product-by-product turnover breakdown of an imaginary company. Below it
is the yearly development of the company profits. On the top right
corner is a pie chart showing the turnover breakdown in graphical form,
and on the bottom right corner is a histogram showing the yearly
development. If you scroll the window you can see additional data from
the spreadsheet.</p>
<h4 id="movement-and-scrolling">2.5. Movement and Scrolling</h4>
<p>Use arrow keys to move left, right, up, and down among the cells. You
may also click the mouse on a cell to cause it to be activated as the
current one.</p>
<p>Note that it is not possible to move around the formula; the formula
can only be edited from its end by adding or removing characters.</p>
<p>Going beyond the borders of the window results in scrolling the
current view. It is not possible to go up from the first row or left
from the first column; but it is possible to wrap back to start from the
last row and last column.</p>
<h4 id="formulas-1">2.6. Formulas</h4>
<p>The spreadsheet formulas operate on a stack. Operands of an operation
(e.g. plus) are first pushed to the stack and then the operation is
performed. If a formula on a cell produces <em>exactly</em> one result
then that is shown in the cell. Otherwise, the formula is interpreted as
a string and shown as it is.</p>
<p>An example of a simple formula, simply specifying a number is</p>
<pre><code>123.50</code></pre>
<p>Another simple formula refers to a cell:</p>
<pre><code>A1</code></pre>
<p>This particular example formula referred to the first cell of the
first row in the spreadsheet. Arithmetic operations require both
arguments:</p>
<pre><code>A1 A2 +
B1 B2 *
C1 C2 -
D1 D2 /</code></pre>
<p>More complex formulae can be constructed by combining these simple
ones:</p>
<pre><code>A1 A2 + 2 *</code></pre>
<p>This example calculates the sum of the cells <code>A1</code> and
<code>A2</code>, and then multiplies the result by two.</p>
<p>The currently selected cell is always in a state where it can be
edited. Press any key to add a character at the end of the formula;
press backspace to delete the last character. Any resulting
recalculations are immediately visible. (Note how much nicer this
feature is as you get used to it, compared to the behaviour of certain
commercial spreadsheet programs.)</p>
<h4 id="graphical-formulas">2.7. Graphical Formulas</h4>
<p>The program supports two types of graphical representations of the
data in the cells: pie charts and histograms. The pie chart can consist
of any number of slices, and is constructed by putting the pie amounts
in stack and using the <code>@</code> operator. The program
automatically computes the relative size of the slices.</p>
<pre><code>A1 A2 A3 A4 @</code></pre>
<p>This example would draw a pie chart of four cells, <code>A1</code> to
<code>A4</code>. The pie formula is shown above the pie for
reference.</p>
<p>The histograms are drawn in a similar manner, by using the
<code>!</code> operator:</p>
<pre><code>A1 A2 A3 A3 !</code></pre>
<h4 id="errors-in-formulas">2.8. Errors in Formulas</h4>
<p>The program detects recursive reference attempts, references cells
not containing a numerical value, attempts to define formulas with zero,
two, or more results remaining on the stack, and syntax errors of
formulas. Note that typically as the user types in a formula, it toggles
between valid and invalid forms dynamically as all single character
changes are immediately taken in account. This is not dangerous, just
complete the formula and view the results.</p>
<p>Errors are signalled by showing the formula on a cell instead of the
numerical value supposedly returned by it.</p>
<p>Division by zero results in an IEEE Inf number.</p>
<h4 id="compilation-parameters-and-configuration">2.9. Compilation
Parameters and Configuration</h4>
<p>This section explains the meaning and rationale for the compile time
parameters:</p>
<hr />
<pre><code>-DC=XK_Up
-DL=XK_Down
-DO=XK_Left
-DV=XK_Right
-DR=XK_Escape
-D_=XK_BackSpace</code></pre>
<p>These definitions can be used to change the user interface of the
program with respect to special keys. The first four define the movement
operations and the latter two define the program termination and
character deletion keys. Typical modifications to these parameters
include changing character deletion to the key the user is most familiar
with, which could also be <code>XK_Delete</code>. <code>XK_Escape</code>
might be better in some cases as one of the function keys. Likewise for
the arrow keys.</p>
<pre><code>-DU=40</code></pre>
<p>This parameter defines the maximum dimensions of the stored and
handled spreadsheet (but see section 4.4 for a warning about changing
this without thinking about the consequences!).</p>
<pre><code>-DT=98</code></pre>
<p>This parameter defines the maximum length of a formula in one cell.
Note the warning in section 4.4.</p>
<pre><code>-Dz=&quot;(T+1)*U*U&quot;</code></pre>
<p>Defines the number of bytes in a spreadsheet file. The number is
automatically adjusted when the spreadsheet size parameters are changed.
Note the warning in section 4.4.</p>
<pre><code>-DQ=80
-DS=20</code></pre>
<p>These two parameters define the visual dimensions of a cell. Changing
these may be necessary on your system if the default font sizes differ
from those in the systems we’ve tested the program with. <code>S</code>
also defines the size of the left (<code>x1</code>) and top margins
(<code>x2</code>).</p>
<pre><code>-DN=10</code></pre>
<p>This is the x-indentation of text inside a cell. Changing this may be
necessary to suit other font sizes and different X environments.</p>
<pre><code>-DB=5</code></pre>
<p>This is the y-indentation of text inside a cell. Changing this may be
necessary to suit other font sizes and different X environments.</p>
<pre><code>-DG=23</code></pre>
<p>This parameter is the number of cell rows visible at one time.</p>
<pre><code>-Dp=7</code></pre>
<p>This parameter is one smaller than the number of cells columns
visible at one time.</p>
<pre><code>-DM=&quot;((p+1)*Q)+S&quot;
-DH=&quot;(G*S)+S+S&quot;</code></pre>
<p>These parameters are the window x and y sizes of the spreadsheet
program window. With these definitions, they are automatically
reflecting the at-one-time-visible cell row/column amounts. Hence, we
recommend changing the <code>G</code> and <code>p</code> parameters if
you want to change the window size in normal cases. Experimentation with
<code>M</code> and <code>H</code> can be used to get other types of
effect such as adding a margin also at the bottom of the window.</p>
<h3 id="implementation">3. IMPLEMENTATION</h3>
<p>It’s better to just read the code. But note the use of stack in the
implementation of <code>@</code> and <code>!</code> operators, and note
the use of <code>*#i</code> in one of the macros (can you see why?).
Extreme compression has been the key in writing this program. With
compression comes the use of ASCII code numbers instead of character
constants and so on. (This particular obfuscation is not really a
desirable one as it is not completely portable. But it certainly was a
necessary one.)</p>
<p>What does <code>i(=)</code> do or does it do anything? Why?</p>
<h3 id="warnings-and-caveats">4. WARNINGS AND CAVEATS</h3>
<h4 id="x11-paths-in-compilation">4.1. X11 Paths in Compilation</h4>
<p>The given Makefile may have to be edited to insert correct library
and include file path names.</p>
<h4 id="font-sizes">4.2. Font Sizes</h4>
<p>We’ve tested the program with a limited amount of X servers. It is
possible that other systems use default font sizes or other parameters
that cause the visual looks to be different or perhaps even unusable; if
this happens, changing compile-time parameters explained in section 2.8
might help.</p>
<h4 id="screen-sizes">4.3. Screen Sizes</h4>
<p>The size of the window as it comes up - a parameter as defined in
compile-time - has been set suitable for a small laptop screen. Larger
screens may benefit from setting these parameters higher. Smaller
screens require changing the parameters so that all of the window
becomes visible.</p>
<h4 id="spreadsheet-dimension-changes">4.4. Spreadsheet Dimension
Changes</h4>
<p>The size of the read, manipulated, and stored spreadsheets is defined
by a compile time parameter. However, changing this parameter is not
entirely trivial. The following constraints apply:</p>
<ul>
<li><p>Horizontal (alphabet) dimension handling will always be A to Z
regardless of the actual allocated memory area.</p></li>
<li><p>Any change in the dimension parameter renders existing
spreadsheet files unusable.</p></li>
</ul>
<h4 id="ascii-reliance">4.5. ASCII Reliance</h4>
<p>The software relies on running on ASCII-based code system. Why?
Because <code>32</code> is shorter than <code>' '</code>.</p>
<h4 id="command-line-single-character-defines">4.6. Command Line Single
Character Defines</h4>
<p>The use of single character (e.g. <code>G</code> or <code>p</code>)
for a <code>-D</code> option might break certain systems, if those
characters are used in the included X header files in certain kinds of
places. If this happens, you may move the offending character to a new
name by exchanging it on the command line and in the program with
another character. Note that there are <em>no</em> free characters in
the program currently.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-2000jarijyrki"><a name="inventory"></a>Inventory
for 2000/jarijyrki</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/jarijyrki/jarijyrki.c">jarijyrki.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/jarijyrki/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/jarijyrki/jarijyrki.orig.c">jarijyrki.orig.c</a>
- original source</li>
<li><a href="2000_jarijyrki.tar.bz2">2000_jarijyrki.tar.bz2</a> -
download winning source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/jarijyrki/.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/2000/jarijyrki/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/jarijyrki/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="finance.sheet">finance.sheet</a> - spreadsheet</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fjarijyrki%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+216 -13
View File
@@ -1,4 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- START: two lines up starts content from: inc/top.default.html -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,228 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 2000/natori/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2000 natori</title>
<meta name="description" content="IOCCC year: 2000 IOCCC winner: natori winner index page">
<meta name="keywords" content="IOCCC,2000,natori,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2000/natori</title>
<meta name="description" content="2000 IOCCC winner natori">
<meta name="keywords" content="IOCCC, 2000, IOCCC 2000, IOCCC winner, natori">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>2000 natori</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>2000/natori</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fnatori%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/natori/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../jarijyrki/index.html">&larr; jarijyrki</a>
<a class="Left" href="../index.html">&uarr; 2000 &uarr;</a>
<a class="Left" href="../primenum/index.html">primenum &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#NATORI_Shin">NATORI Shin</a><br>
Location: <a href="/temp-test-ioccc/location.html#JP">JP</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<p>An alt version exists for those in the southern hemisphere (or those
who want to see what it would be in the southern hemisphere). See <a
href="#alternate-code">alternate version</a> below.</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">./natori</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<p>Also try modifying the code so that it will show another Moon phase
based on input or else just by the code itself. Bonus points if you can
make it show all~</p>
<h2 id="alternate-code">Alternate code:</h2>
<p>The author noted that those in the southern hemisphere might want to
change <code>acos(l/2)</code> into <code>acos(-l/2)</code> which we have
done in the alternate version.</p>
<h3 id="alternate-build">Alternate build:</h3>
<p>To run the alternate code that supports the southern hemisphere:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./natori.alt</span></span></code></pre></div>
<p>What happens if you run it in the northern hemisphere? Are there any
differences?</p>
<p>Can you identify any Moon phases that result in the same output of
both versions? Or are there any?</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Here is a nice compact program that changes with the phase of the
Moon. Can you figure out how it does it?</p>
<p>The ANSI-C committee, among their multiple misdeeds, broke perfectly
fun C programs by making it intractable for them to declare their own
non-traditional prototype for <code>main()</code>. We have had to uglify
this program in order to prevent C compilers from failing to compile it
due to (the now changed) unusual arg types of the <code>main()</code>
function.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This program outputs a rough image of the moon in its current phase.
The main obfuscation of this entry is its complicated double recursion
(without any loop or conditional statement).</p>
<p>People living in the southern hemisphere may want to change
<code>acos(l/2)</code> into <code>acos(-l/2)</code>.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-2000natori"><a name="inventory"></a>Inventory for
2000/natori</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/natori/natori.c">natori.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/natori/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/natori/natori.alt.c">natori.alt.c</a>
- alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/natori/natori.orig.c">natori.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/natori/try.sh">try.sh</a>
- how to run</li>
<li><a href="2000_natori.tar.bz2">2000_natori.tar.bz2</a> - download
winning source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/natori/.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/2000/natori/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/natori/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fnatori%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+244 -13
View File
@@ -1,4 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- START: two lines up starts content from: inc/top.default.html -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,256 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 2000/primenum/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2000 primenum</title>
<meta name="description" content="IOCCC year: 2000 IOCCC winner: primenum winner index page">
<meta name="keywords" content="IOCCC,2000,primenum,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2000/primenum</title>
<meta name="description" content="2000 IOCCC winner primenum">
<meta name="keywords" content="IOCCC, 2000, IOCCC 2000, IOCCC winner, primenum">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>2000 primenum</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>2000/primenum</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fprimenum%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/primenum/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../natori/index.html">&larr; natori</a>
<a class="Left" href="../index.html">&uarr; 2000 &uarr;</a>
<a class="Left" href="../rince/index.html">rince &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#Raymond_Cheong">Raymond
Cheong</a><br> Location: <a
href="/temp-test-ioccc/location.html#US">US</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code>STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a
href="/bugs.md#2000-primenum">2000 primenum in bugs.md</a>.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="bu">echo</span> n <span class="kw">|</span> <span class="ex">./primenum</span> n</span></code></pre></div>
<p>NOTE: <code>n</code> is an integer.</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>Don’t read the author remarks until you’re ready for the spoiler.
Just stop and read the program; it won’t take long. Once you’ve figured
out what it does, run it. It may surprise you.</p>
<p>This entry won, not because the obfuscation is impenetrable, but
because it successfully fooled half of the judges, including me.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="description">Description</h3>
<p>For 15 years, IOCCC winners have obfuscated programs using esoteric,
difficult-to-interpret, confusing algorithms. This entry finally bucks
that trend and obfuscates in the most “obvious” way possible: by
painstakingly describing the algorithm in clear pseudocode. Even novice
programmers will recognize that the program should find and print prime
numbers up to a given number (as specified on the command line).</p>
<p>But novice programmers especially know that mistakes are often made
in translating pseudocode to real code, often resulting in programs with
unexpected and confusing output. Clearly, the program contains several
syntax “mistakes” (e.g. <code>LessThanOrEqualTo</code>) and blatant
“errors” (e.g. <code>Zero</code>). This program clearly requires
“debugging.”</p>
<p>As a result of these “bugs”, the program does not calculate primes at
all. Instead, the program reads input from <code>stdin</code> and
returns garbled text on <code>stdout</code>. Fortunately, you can
recover the original message simply by running the program a second
time. 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="ex">./primenum</span> n <span class="op">&lt;</span> textfile <span class="kw">|</span> <span class="ex">./primenum</span> n <span class="op">&gt;</span> textfile2</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="fu">diff</span> textfile textfile2</span></code></pre></div>
<p>where n is the same number (modulo 64). So, the prime number
generator is actually a simple text encoder/decoder! Of course, don’t
forget that argument, otherwise the “bugs” in the program will cause it
to crash!</p>
<h3 id="features">Features</h3>
<ul>
<li><p>The program attempts to mislead the reader into thinking that it
generates prime numbers. It does this by:</p>
<ul>
<li>describing a correct algorithm in pseudocode;</li>
<li>using partially correct conversion of pseudocode to real code;</li>
<li>using suggestive variable names; and</li>
<li>using a suggestive program name.</li>
</ul></li>
<li><p>The program demonstrates a novel method of abusing the C
preprocessor.</p></li>
<li><p>Determining how the filter algorithm works is left as an exercise
to the reader.</p></li>
<li><p>OK, so running it through the preprocessor strips away the prime
number front. But ye be warned: “not a11 variab1es1es are identica1”
:-)</p></li>
<li><p>Other features include</p>
<ul>
<li>useless variables</li>
<li>useless if</li>
<li>a for loop that’s used as an if statement</li>
<li>dependence on the high bit being 0</li>
</ul></li>
<li><p>Try also
<code>echo THIS MESSAGE IS IN ALL CAPS | ./primenum 32</code></p></li>
</ul>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-2000primenum"><a name="inventory"></a>Inventory
for 2000/primenum</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/primenum/primenum.c">primenum.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/primenum/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/primenum/primenum.orig.c">primenum.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/primenum/try.sh">try.sh</a>
- how to run</li>
<li><a href="2000_primenum.tar.bz2">2000_primenum.tar.bz2</a> - download
winning source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/primenum/.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/2000/primenum/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/primenum/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fprimenum%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+1 -2
View File
@@ -86,7 +86,7 @@ Julian day number (given as a fractional component). E.g.:
```
A Julian day is defined to be the number of days since January 1st in the year
`-4712 (4713BC)`, starting at 12 noon GMT.[^1] To aid conversion from our time
`-4712 (4713BC)`, starting at 12 noon GMT.[^1][^2] To aid conversion from our time
(GMT) to Julian day there is a supplementary program named:
[dmy2jd.c](dmy2jd.c). Run it with `day_float month year` as arguments. See below
for an example.
@@ -368,7 +368,6 @@ Jean Meeus. Published by Willmann-Bell Inc.
[^2]: Astronomical algorithms (1st ed): pages 285-299.
Jean Meeus. Published by Willmann-Bell Inc.
## Copyright and CC BY-SA 4.0 License:
This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
+467 -13
View File
@@ -1,4 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- START: two lines up starts content from: inc/top.default.html -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,479 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 2000/rince/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2000 rince</title>
<meta name="description" content="IOCCC year: 2000 IOCCC winner: rince winner index page">
<meta name="keywords" content="IOCCC,2000,rince,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2000/rince</title>
<meta name="description" content="2000 IOCCC winner rince">
<meta name="keywords" content="IOCCC, 2000, IOCCC 2000, IOCCC winner, rince">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>2000 rince</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>2000/rince</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Frince%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/rince/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../primenum/index.html">&larr; primenum</a>
<a class="Left" href="../index.html">&uarr; 2000 &uarr;</a>
<a class="Left" href="../robison/index.html">robison &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#James_Bonfield">James
Bonfield</a><br> Location: <a
href="/temp-test-ioccc/location.html#GB">GB</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> all</span></code></pre></div>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code>STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="/bugs.md#2000-rince">2000
rince in bugs.md</a>.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./rince</span> number number2</span></code></pre></div>
<p>If <code>DISPLAY</code> is not set the program will very likely crash
or do something different.</p>
<p>This is supposed to happen. As is written in the <a
href="http://catb.org/jargon/html/F/feature.html">The Jargon
File</a>:</p>
<pre><code>That&#39;s not a bug, that&#39;s a feature.</code></pre>
<h2 id="try">Try:</h2>
<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.sh</span></span></code></pre></div>
<p>This will run the program several times with different parameters to
show different types of things. See the author’s remarks for more
details.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This program may have you going around in circles :-) Try running it
first before reading the author’s remarks below.</p>
<p>The judges verified the correctness of output for recent dates
through visual observation.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="how-to-use-it">How to use it</h3>
<p>The simplest way to run it is with no arguments. Just type:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./rince</span></span></code></pre></div>
<p>You will need to have access to X windows, although it doesn’t
require desperately high resolution and there are no known limitations
on colour depth.</p>
<p>The display will change slowly over time, although it may take 10
minutes or more to be visible. For those that cannot wait that long the
program has a built in time machine. Indeed the program knows the speed
of light, which is used to ensure that we see the “live” pictures.
Simply specify the fraction of a day to skip forward for each screen
refresh. I suggest:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./rince</span> 0.01</span></code></pre></div>
<p>To display the output (still guessing?) for a given date, specify two
arguments. The first argument is as before and the second argument is a
Julian day number (given as a fractional component). E.g.:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./rince</span> 0 2441193.6</span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./rince</span> 0.01 2441193.6</span></code></pre></div>
<p>A Julian day is defined to be the number of days since January 1st in
the year <code>-4712 (4713BC)</code>, starting at 12 noon GMT.<a
href="#fn1" class="footnote-ref" id="fnref1"
role="doc-noteref"><sup>1</sup></a><a href="#fn2" class="footnote-ref"
id="fnref2" role="doc-noteref"><sup>2</sup></a> To aid conversion from
our time (GMT) to Julian day there is a supplementary program named: <a
href="dmy2jd.c">dmy2jd.c</a>. Run it with
<code>day_float month year</code> as arguments. See below for an
example.</p>
<h3 id="what-it-does">What it does</h3>
<p>This program plots the positions of the four <a
href="https://en.wikipedia.org/wiki/Galilean_moons">Galilean moons</a>
of <a href="https://en.wikipedia.org/wiki/Jupiter">Jupiter</a>, as seen
from <a href="https://en.wikipedia.org/wiki/Earth">Earth</a>. It doesn’t
correct for your location on Earth, but I assure you that the <a
href="https://en.wikipedia.org/wiki/Parallax#Astronomy">parallax</a> is
minimal!</p>
<p>The moons are labelled with Roman numerals from <code>I</code> to
<code>IV</code>, <code>I</code> being the closest to the planet and
<code>IV</code> being the furthest. They are:</p>
<pre><code>I Io
II Europa
III Ganymede
IV Callisto</code></pre>
<p>Amazingly, all it takes is a pair of binoculars to see the Galilean
moons, so the results can be experimentally checked. (Note that at
present, the best views of Jupiter are over the autumn/winter.)</p>
<p>The positions of the moons should be correct for binoculars, but
possibly not if you have a telescope or if you are in the southern
hemisphere. In that case I suggest that to get the correct image you
look at the screen from inside the monitor whilst standing on your head.
In case of confusion, please consult the following chart (*):</p>
<pre><code> N
^
|
E &lt;---+---&gt; W
|
v
S</code></pre>
<p>(*) Not to scale.</p>
<h3 id="history">History</h3>
<p>Galileo discovered the moons in January 1610. <a
href="https://web.archive.org/web/20001204212000/http://www-isds.jpl.nasa.gov/cwo/cwo_54ga/html/cd/galileo.htm"
class="uri">https://web.archive.org/web/20001204212000/http://www-isds.jpl.nasa.gov/cwo/cwo_54ga/html/cd/galileo.htm</a>
states the following:</p>
<pre><code>By early 1610, Galileo had further improved his telescope by
double its power, so it now enlarged objects a thousand
times. He began looking at the stars and couldn&#39;t believe how
many more he could now see! The number seemed infinite. He was
beginning to realize the fixed stars weren&#39;t a flat distant
wall on a globe, but a three-dimensional expanse bigger than
anyone had ever thought!
Then, on January 7, about an hour after sunset, Jupiter rose
in the east, and Galileo happened to turn his powerful scope
on its bright disk. It wasn&#39;t the first time he had looked at
Jupiter, but before it was with one of his lesser-powered
telescopes. This time, though, he noticed three small but
bright stars near the planet, two to one side and one to the
other. He wondered at how bright the small stars were and how
they were arranged in what seemed like a straight line. The
next night he decided to look at Jupiter again, and to his
surprise, the stars had moved. But not in such a way as he
would expect. If Jupiter was moving as it normally should, the
stars would be east of Jupiter. But all three were to the
west! The next night was cloudy, but on January 10, Galileo
was able to observe the planet again. One of the stars was
gone, and the other two were now on the east side. As the
stars moved around Jupiter on each succeeding night, and were
finally joined by a fourth star, it dawned on Galileo that
what he had found were moons orbiting Jupiter! Almost at once
he realized that this was proof that not all objects orbited
the Earth. Here were four bodies that were orbiting
Jupiter. One argument against the sun-centered theory was, if
the Earth orbited the sun, wouldn&#39;t the moon get left behind?
Here he could see for himself that somehow, a planet could
orbit the sun, and not leave a moon behind!</code></pre>
<p>Thus we can plot Galileo’s discoveries using the following three
plots:</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">./rince</span> 0 <span class="va">$(</span><span class="ex">./dmy2jd</span> 7.8 1 1610<span class="va">)</span></span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./rince</span> 0 <span class="va">$(</span><span class="ex">./dmy2jd</span> 8.8 1 1610<span class="va">)</span></span>
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./rince</span> 0 <span class="va">$(</span><span class="ex">./dmy2jd</span> 10.8 1 1610<span class="va">)</span></span></code></pre></div>
<p>However we can go one better by seeing what Galileo would have seen
if it wasn’t cloudy on the 9th. Try:</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="ex">./rince</span> 0 <span class="va">$(</span><span class="ex">./dmy2jd</span> 9.85 1 1610<span class="va">)</span></span></code></pre></div>
<p>to see what he was missing out on. I wonder what he’d have made of
that!</p>
<p>Galileo discovered the fourth moon a few days later.</p>
<p>I’ve tried typing these dates into two Java based Jovian moon
plotters, but both I tried had problems dealing with dates earlier than
1900. More professional software, such as the <a
href="http://www.bmsoftware.com/skymappro9.htm">SkyMap</a> gets these
values correct and this compares well with the above description and
with this IOCCC entry.</p>
<p>The year 4713BC was chosen by <a
href="https://en.wikipedia.org/wiki/Joseph_Justus_Scaliger">Joseph
Justus Scaliger</a> in the 16th Century, so clearly this program has a
long history :-) A more complete description of the origins of Julian
Days can be found at <a
href="https://web.archive.org/web/20001206152200/http://aa.usno.navy.mil/AA/faq/docs/millennium.html"
class="uri">https://web.archive.org/web/20001206152200/http://aa.usno.navy.mil/AA/faq/docs/millennium.html</a>.</p>
<h3 id="assumptions">Assumptions</h3>
<p>This program assumes:</p>
<ol type="1">
<li><p>The ASCII character set is used.</p></li>
<li><p>That an enormous comet hasn’t changed the course of Jupiter (or
Earth!).</p></li>
<li><p>That the date has not been specified as the gap between the <a
href="https://en.wikipedia.org/wiki/Julian_calendar">Julian</a> and <a
href="https://en.wikipedia.org/wiki/Gregorian_calendar">Gregorian</a>
calendar.</p></li>
<li><p>That the <code>DISPLAY</code> environment variable is set and the
X display can opened. If this is not the case the program will
crash.</p></li>
<li><p>There is a year 2000BC problem :-)</p>
<p>More specifically, the plots for dates that far back are too
inaccurate to be of realistic use. Comparisons against <a
href="http://www.bmsoftware.com/skymappro9.htm">SkyMap Pro</a> show that
there is a good similarity (but not much more) up to about
500BC.</p></li>
<li><p>The code definitely is not portable - it will produce incorrect
results if run from the surface of <a
href="https://science.nasa.gov/mars/">Mars</a>.</p></li>
</ol>
<h3 id="obfuscations">Obfuscations</h3>
<p>In addition to the normal obfuscations, I feel that the code contains
some less common tricks. Taken through the standard rounds listed in the
<a href="/2000/guidelines.txt">guidelines</a>, the code attempts to pass
these as follows:</p>
<ol type="1">
<li><p>Look at the original source</p>
<p>With luck, pure casual inspection should not reveal much except that
the program contains the X Windows logo (a big clue) and contains a
date. This date may give a clue to a few people that this is an
astronomical program.</p>
<p>Unfortunately I was stretched for space which meant that the large
string constant could not be split up using a “partA” “partB” method
which clearly limits the code layout. However the space saved by using a
single long string constant is more than outweighed by the ability to
further obfuscate.</p></li>
<li><p>convert ANSI trigraphs to ASCII</p>
<p>These are not used.</p></li>
<li><p>C pre-process the source ignoring <code>#include</code>
lines</p></li>
<li><p>C pre-process the source ignoring <code>#define</code> and
<code>#include</code> lines</p>
<p>This does a good job of expanding out the code, but it does not
clarify things greatly. The use of <code>#define</code>s has been
restricted primarily to a space-saving mechanism.</p>
<p>Additionally, the use of <code>typedef</code>s means that the types
used are still obscured unless further replacement edits are
made.</p></li>
<li><p>Run it through a C beautifier.</p>
<p>GNU <code>indent(1)</code> seems to do a reasonable job, provided
that the <code>#define</code>s are expanded first. This doesn’t lay the
algorithm particularly bare though as most of the obfuscations are not
simple code layouts.</p></li>
<li><p>Examine the algorithm.</p>
<p>The algorithm operates on two levels. The main visible level is by
taking a large string and breaking this down into a series of opcodes
(which I have termed J-code). These are then executed.</p>
<p>To get to the real method of how it works, you need to decode the
opcode string (which deliberately contains as many <code>;</code>,
<code>{</code> and <code>}</code> symbols as possible), which will give
you a <a
href="https://en.wikipedia.org/wiki/Reverse_Polish_notation">Reverse
Polish notation</a> chunk of mathematics.</p>
<p>Sensible people amongst you will simply refer to the referenced book
:-)</p></li>
<li><p>Lint it.</p>
<p>I no longer have lint, although I do have access to Purify. I’m happy
to say that purify does not detect any memory errors or memory
leaks.</p>
<p>See below for compilation warnings.</p></li>
<li><p>Compile it.</p>
<p>I’m sorry to say that there are several warnings issued by the
compiler.</p>
<p>Firstly, the return type for <code>X()</code> is not specified, so it
defaults to <code>int</code>. Horror of all horrors - this function does
not return an integer type (it doesn’t contain any specific
<code>return</code>s). The return value from <code>X()</code> is not
accessed. The same problem occurs in <code>main()</code> - it does not
return. However <code>main()</code> never exits unless there is a
serious error.</p>
<p>The 6th argument of <code>XDrawText</code> (which should be
<code>XTextItem</code>) is passed as a compatible structure, but without
casting. This is to reduce code space. A more elegant solution is to
remove the <code>struct {...} Z</code> completely and use
<code>XTextItem f={i-127+r/3*2,r%3+r/3+1,0,E}</code> at the start of
<code>XDrawText</code> block. Although this is accepted by several
compilers, it is not strict ANSI due to the non-constant initialisers. A
pity.</p>
<p>Note that I make use of <code>usleep()</code>. This is a POSIX call
(it is BSD), but it’s supported on many systems. It may be implemented
using <code>select()</code> or <code>poll()</code> if required, or as a
final solution you can change the <code>usleep(10000)</code> to
<code>sleep(1)</code>. To compile on systems which do not have
<code>usleep()</code>, but do have <code>select()</code>, the following
may suffice as an additional compiler argument:</p>
<pre><code>-Dusleep={time_t v[2]={0,10000};select(0,0,0,0,v);}</code></pre>
<p><code>gcc</code> complains about “unreachable code at beginning of
switch statement”, although removing some of this code will prevent the
algorithm from working.</p>
<p><code>gcc</code> also suggests that I should be using extra
parenthesis, but I’m taking this as good comment :-)</p></li>
</ol>
<p>In addition to the above, the program has the following useful(?)
obfuscations:</p>
<ol type="1">
<li><p>The algorithm requires many floating point numbers (about 50).
These are encoded as ASCII.</p></li>
<li><p>The J-code algorithm has opcodes designed to be space saving.
They are all one byte, but many are also considered as whitespace by the
rules. This algorithm forms part of the same string that the floating
point constants are embedded within. What does the <code>;</code>
command do in J-code?</p></li>
<li><p>The J-code language is both stack based and variable based. This
“uncleanliness” is not ideal from a computer science angle, but when has
cleanliness been considered as good in IOCCC? :-)</p></li>
<li><p>Association of unconnected data by implied function usage. E.g.
use of <code>strlen()</code> and <code>sizeof()</code> simply to return
useful numerical values, using irrelevant arguments.</p></li>
<li><p>As we already have a dependency on ASCII this has been abused
further. Specifically some integer constants are specified as ASCII and
some ASCII constants are integers. This hides the true meaning for the
values.</p></li>
<li><p>Red herrings: there are a couple of pieces of code whose
appearance is just there to mislead the infirm of mind. I’ve only tried
to include such examples in places where at first glance the code
appears to be executed.</p></li>
</ol>
<h3 id="references">References</h3>
<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>
<section id="footnotes" class="footnotes footnotes-end-of-document"
role="doc-endnotes">
<hr />
<ol>
<li id="fn1"><p>Astronomical algorithms (1st ed): page 59 Jean Meeus.
Published by Willmann-Bell Inc.<a href="#fnref1" class="footnote-back"
role="doc-backlink">↩︎</a></p></li>
<li id="fn2"><p>Astronomical algorithms (1st ed): pages 285-299. Jean
Meeus. Published by Willmann-Bell Inc.<a href="#fnref2"
class="footnote-back" role="doc-backlink">↩︎</a></p></li>
</ol>
</section>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-2000rince"><a name="inventory"></a>Inventory for
2000/rince</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/rince/rince.c">rince.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/rince/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/rince/rince.orig.c">rince.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/rince/try.sh">try.sh</a>
- how to run</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/rince/dmy2jd.c">dmy2jd.c</a>
- supplementary program source</li>
<li><a href="2000_rince.tar.bz2">2000_rince.tar.bz2</a> - download
winning source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/rince/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/rince/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/rince/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Frince%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+305 -13
View File
@@ -1,4 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- START: two lines up starts content from: inc/top.default.html -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,317 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 2000/robison/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2000 robison</title>
<meta name="description" content="IOCCC year: 2000 IOCCC winner: robison winner index page">
<meta name="keywords" content="IOCCC,2000,robison,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2000/robison</title>
<meta name="description" content="2000 IOCCC winner robison">
<meta name="keywords" content="IOCCC, 2000, IOCCC 2000, IOCCC winner, robison">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>2000 robison</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>2000/robison</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Frobison%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/robison/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../rince/index.html">&larr; rince</a>
<a class="Left" href="../index.html">&uarr; 2000 &uarr;</a>
<a class="Left" href="../schneiderwent/index.html">schneiderwent &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#Arch_D_Robison">Arch D.
Robison</a><br> Location: <a
href="/temp-test-ioccc/location.html#US">US</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./robison</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>The program plays almost always reasonably, but does not always
detect illegal moves. Try “9 1” as your first move, then “13 2”. Also it
tends to think for quite a while in the beginning of a game. It is also
smart enough to give up by making a losing move at the end of a game
when its position is hopeless.</p>
<p>Unfortunately, due to the contest rules, we’re unable to grant the
author a patent he applied for. :-)</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="title-of-invention">TITLE OF INVENTION</h3>
<p>Highly Compressed Program for Playing Hygienic Checkers</p>
<h3 id="field-of-invention">FIELD OF INVENTION</h3>
<p>The present invention generally relates to <a
href="https://en.wikipedia.org/wiki/Checkers">checkers</a>.</p>
<h3 id="background-of-the-invention">BACKGROUND OF THE INVENTION</h3>
<p>Within the field of <a
href="https://en.wikipedia.org/wiki/Checkers">Checkers</a>, the problem
of finding a hygienic opponent is difficult, as good opponents are
peculiar to the tavern habitat of cracker-barrels, pot-belly stoves,
tobacco, and spittoons.</p>
<h3 id="brief-summary-of-the-invention">BRIEF SUMMARY OF THE
INVENTION</h3>
<p>The present invention plays <a
href="https://en.wikipedia.org/wiki/Checkers">Checkers</a> without
spitting.</p>
<h3 id="brief-description-of-several-views-of-the-invention">BRIEF
DESCRIPTION OF SEVERAL VIEWS OF THE INVENTION</h3>
<p>FIG. 1 shows a numbering of positions.</p>
<p>FIG. 2 shows a numbering of directions.</p>
<p>FIG. 3 shows a sample board.</p>
<p>FIG. 4 shows a method in accordance with the present invention.</p>
<h3 id="detailed-description-of-the-invention">DETAILED DESCRIPTION OF
THE INVENTION</h3>
<p>Operator plays Black (<code>x</code>); the program plays White
(<code>o</code>). Said Black goes first. On operator’s turn, said
program requests a position and direction. FIG. 1 shows the numbering of
the squares. FIG. 2 shows the numbering of directions. As per standard
rules, if one or more jumps are possible, one of the jumps must be taken
in preference to other moves. Said operator enters the numbers for the
position and direction. If after jumping over a piece, another jump is
possible, and said piece did not become a king after said jump, standard
rules require that another jump be taken. In said case, said program
requests a direction only in which to continue jumping from the present
position. Kings are denoted by upper case. FIG. 3 shows a sample board.
There is a black king (<code>X</code>) on square 30 and a red king
(<code>O</code>) on square 2. The numbers on the right are the numbers
of the rightmost square in each row.</p>
<p>A player loses if they cannot make a legal move. Said loss is
trivially true if player loses all of his/her pieces. The present
invention announces said loser.</p>
<p>FIG. 4 shows a C program in accordance with the present invention.
Control flow is straightforward: control enters routine
<code>main()</code>, executes a plurality of statements, and exits via a
<code>return</code> statement. FIG. 4 presumes that type
<code>int</code> is <code>32 bits</code> and <code>short</code> is
<code>16 bits</code>, which are essential to the preferred embodiment of
the invention. FIG. 4 also presumes that the host computer uses ASCII
encoding for characters. It should be obvious that practitioners skilled
in the art of C programming can remove said limitations.</p>
<p>The disclosure here describes a particular embodiment of the present
invention, and other embodiments within the spirit of this disclosure
are possible, as well as consumption of spirits while playing.</p>
<h3 id="claims">CLAIMS</h3>
<p>I claim, by letters patently absurd:</p>
<ol type="1">
<li><p>A method for playing checkers on a computer-based system, where
said method’s source code fits into 1536 countable bytes of source code,
where a byte is countable if</p>
<ul>
<li>it is not whitespace and</li>
<li>it is not a ‘<code>{</code>’, ‘<code>}</code>’, or ‘<code>;</code>’
immediately followed by whitespace.</li>
</ul></li>
<li><p>The method of claim 1, further comprising a method of alpha-beta
pruning that exploits the zero-sum nature of the game to unify alpha and
beta cuts.</p></li>
<li><p>The method of claim 1, further comprising the step of formatting
the source code with short lines, in order to impress the manager with
high productivity, when measured in lines of code.</p></li>
<li><p>The method of claim 3, further comprising the step for telling
the skeptical manager that this is the well-known technique of “linear
programming”.</p></li>
<li><p>The method of claim 1, where <code>~-</code> and <code>-~</code>
replace the obvious arithmetic operations.</p></li>
<li><p>The method of claim 1, further comprising a method where</p>
<ul>
<li>strings are encrypted in a manner suitable as C strings, and</li>
<li>7-bit ASCII characters with uniform distribution are maximally
packed subject to the restriction that each byte is not countable</li>
</ul></li>
<li><p>A method for a computer-based system that uses a single shared
code sequence to either sum a plurality of bits in an N-bit word or
reverses them, in lg(N) time, depending upon a parameter.</p></li>
</ol>
<h3 id="drawings">DRAWINGS</h3>
<h4 id="fig-1.">FIG 1.</h4>
<pre><code> +--+--+--+--+--+--+--+--+
|32| |31| |30| |29| |
+--+--+--+--+--+--+--+--+
| |28| |27| |26| |25|
+--+--+--+--+--+--+--+--+
|24| |23| |22| |21| |
+--+--+--+--+--+--+--+--+
| |20| |19| |18| |17|
+--+--+--+--+--+--+--+--+
|16| |15| |14| |13| |
+--+--+--+--+--+--+--+--+
| |12| |11| |10| | 9|
+--+--+--+--+--+--+--+--+
| 8| | 7| | 6| | 5| |
+--+--+--+--+--+--+--+--+
| | 4| | 3| | 2| | 1|
+--+--+--+--+--+--+--+--+</code></pre>
<h4 id="fig.-2.">FIG. 2.</h4>
<pre><code> 1 0
\ /
.
/ \
3 2</code></pre>
<h4 id="fig.-3.">FIG. 3.</h4>
<pre><code> o o X . 29
o . . . 25
o . . o 21
. o . o 17
x . . . 13
. . x . 9
x x . . 5
x x O x 1</code></pre>
<h4 id="fig.-4">FIG. 4</h4>
<p>[See attached listing.]</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-2000robison"><a name="inventory"></a>Inventory for
2000/robison</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/robison/robison.c">robison.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/robison/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/robison/robison.orig.c">robison.orig.c</a>
- original source</li>
<li><a href="2000_robison.tar.bz2">2000_robison.tar.bz2</a> - download
winning source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/robison/.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/2000/robison/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/robison/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Frobison%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+231 -13
View File
@@ -1,4 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- START: two lines up starts content from: inc/top.default.html -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,243 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 2000/schneiderwent/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2000 schneiderwent</title>
<meta name="description" content="IOCCC year: 2000 IOCCC winner: schneiderwent winner index page">
<meta name="keywords" content="IOCCC,2000,schneiderwent,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2000/schneiderwent</title>
<meta name="description" content="2000 IOCCC winner schneiderwent">
<meta name="keywords" content="IOCCC, 2000, IOCCC 2000, IOCCC winner, schneiderwent">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>2000 schneiderwent</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>2000/schneiderwent</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fschneiderwent%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/schneiderwent/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../robison/index.html">&larr; robison</a>
<a class="Left" href="../index.html">&uarr; 2000 &uarr;</a>
<a class="Left" href="../thadgavin/index.html">thadgavin &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#Craig_Schneiderwent">Craig
Schneiderwent</a><br> Location: <a
href="/temp-test-ioccc/location.html#US">US</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./schneiderwent</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./schneiderwent</span> schneiderwent.data</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./schneiderwent</span></span></code></pre></div>
<p>What’s the difference?</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Very nice play by the rules and portable text obfuscation. This far
surpasses old tricks like adding or subtracting 1 from every character
in a C string.</p>
<p>Translating the messages into your language of preference while
keeping the program portable between different encodings (Chinese,
Japanese, Russian - anyone?) may be an entertaining task.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This entry displays the current time to the console, for example:</p>
<blockquote>
<p>it’s just after ten ’til 6 in the evening</p>
</blockquote>
<p>FWIW, none of the compilers with which this entry was tested issued
any warnings or errors in compiling the source for this entry. No doubt
lint will complain about the goto statements.</p>
<p>The <a href="schneiderwent.data">schneiderwent.data</a> file consists
of the values used by multiple table lookups. This is simply good
program design, separating these values from the source code allows
changing the behavior of the application without recompiling.</p>
<p>Having learned COBOL at an early age, the <code>pthread</code>s of my
thought processes tend to be translated into code in a verbose manner.
Some of the <code>#define</code>s in this entry’s code are to mitigate
this personal deficiency.</p>
<h3 id="obfuscation">Obfuscation</h3>
<p>Obfuscation in this entry consists of:</p>
<ul>
<li><code>printf(3)</code>ing console messages stored as <a
href="https://en.wikipedia.org/wiki/EBCDIC">EBCDIC</a> character values
- this is not an attempt at encryption, but rather at cross platform
compatibility.</li>
<li><a href="https://en.wikipedia.org/wiki/ASCII">ASCII</a> character
values are calculated from the EBCDIC in a particularly ugly abuse of
the <code>?:</code> operator.</li>
<li>Detection of whether to print the ASCII or EBCDIC values is done by
taking the remainder of dividing the character <code>'J'</code> by
<code>2</code> - the ASCII value of the character is even, the EBCDIC
value is odd.</li>
<li>The messages to be <code>printf(3)</code>ed are determined via
multiple table lookups and bit-masked values.</li>
<li>For minutes, the bit position turned on is multiplied by two to
determine the message to be <code>printf(3)</code>ed.</li>
<li>For hours, the straight bit position is used.</li>
<li>This entry mostly eschews function calls for the often overlooked
<code>setjmp(3)</code>/<code>longjmp(3)</code> combination.</li>
<li>The trigraphs are not there as obfuscation nor are they there to
annoy the judges - it’s just the easiest way to get around the absence
of square brackets in a normal 3270 environment.</li>
</ul>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1
id="inventory-for-2000schneiderwent"><a name="inventory"></a>Inventory
for 2000/schneiderwent</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/schneiderwent/schneiderwent.c">schneiderwent.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/schneiderwent/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/schneiderwent/schneiderwent.orig.c">schneiderwent.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/schneiderwent/schneiderwent.data">schneiderwent.data</a>
- table lookups values</li>
<li><a href="2000_schneiderwent.tar.bz2">2000_schneiderwent.tar.bz2</a>
- download winning source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/schneiderwent/.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/2000/schneiderwent/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/schneiderwent/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fschneiderwent%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+262 -13
View File
@@ -1,4 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- START: two lines up starts content from: inc/top.default.html -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,274 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 2000/thadgavin/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2000 thadgavin</title>
<meta name="description" content="IOCCC year: 2000 IOCCC winner: thadgavin winner index page">
<meta name="keywords" content="IOCCC,2000,thadgavin,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2000/thadgavin</title>
<meta name="description" content="2000 IOCCC winner thadgavin">
<meta name="keywords" content="IOCCC, 2000, IOCCC 2000, IOCCC winner, thadgavin">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>2000 thadgavin</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>2000/thadgavin</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fthadgavin%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/thadgavin/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../schneiderwent/index.html">&larr; schneiderwent</a>
<a class="Left" href="../index.html">&uarr; 2000 &uarr;</a>
<a class="Left" href="../tomx/index.html">tomx &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Authors:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#Gavin_Buttimore">Gavin
Buttimore</a><br> Location: <a
href="/temp-test-ioccc/location.html#null">unknown</a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#Thaddaeus_Frogley">Thaddaeus
Frogley</a><br> Location: <a
href="/temp-test-ioccc/location.html#GB">GB</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<p>NOTE: if you don’t have curses or SDL1 installed both modes will fail
to compile. In that case see the <a href="/faq.md#SDL">FAQ 3.8 - How do
I compile an IOCCC winner that requires SDL1 or SDL2?</a> and <a
href="/faq.md#faq3_9">FAQ 3.9 - How do I compile an IOCCC winner that
requires (n)curses?</a> for more information.</p>
<p>We recommend that you use the alternate code so you can see what this
entry looked like back in 2000 (with a configurable speed). See the <a
href="#original-code">original code</a> section for the original
entry.</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">./thadgavin.alt</span></span></code></pre></div>
<p>You can press ‘q’ at any time to exit.</p>
<h2 id="try">Try:</h2>
<p>If you have SDL1 installed:</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">./thadgavin_sdl</span></span></code></pre></div>
<p>Whereas the curses version has an early exit the SDL version does
not. You will have to kill it yourself.</p>
<p>You might also wish to reconfigure the speed at which the programs
run. The code calls <code>usleep(3)</code> with two default values, one
for SDL and one for curses. The curses and SDL macros are defined in the
Makefile in a way that makes it easy to redefine the values:
<code>SLEEP</code> is how long the program sleeps (in microseconds)
between output with curses and <code>SDL_SLEEP</code> is how long it
sleeps (also in microseconds) for the SDL version.</p>
<p>To change the SDL one to something like <code>15000</code> you can
do:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> SDL_SLEEP=15000 clobber alt</span></code></pre></div>
<p>and to change the curses one to <code>40</code>:</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> SLEEP=40 clobber alt</span></code></pre></div>
<p>Then use the program(s) in the same way.</p>
<p>The different macros is because the curses version is already much
slower and so it’s better to not tie the two values together. You may of
course redefine both in the same command.</p>
<h2 id="original-code">Original code:</h2>
<p>WARNING: if you are sensitive to rapid movement or if you want to see
better what is going on then please use the alternate code as described
above. If you wish to see the original entry see below.</p>
<p>NOTE: in curses mode you might want to type <code>reset</code> after
execution of this program if your terminal is messed up after exiting
the program (send intr, typically ctrl-c) as the program does not call
<code>endwin()</code>. Using <code>reset</code> will clear the screen.
The alt code, as noted above, allows one to quit early so this is not a
problem there.</p>
<h3 id="original-build">Original build:</h3>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> all</span></code></pre></div>
<h3 id="original-use">Original use:</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">./thadgavin</span></span></code></pre></div>
<h3 id="original-try">Original try:</h3>
<p>If you have SDL1 installed:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./thadgavin_sdl</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This entry is a nice play by the rules. It can use curses, if the SDL
graphic library is not present, and is quite good at that, but the
colors used in graphic mode (16 bit depth) are unfortunately less than
dazzling. We could not test this entry in DOS mode.</p>
<h2 id="authors-remarks">Authors’ remarks:</h2>
<h3 id="to-use-under-dos">To use under DOS:</h3>
<p>Compile using DJGPP as follows:</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">gcc</span> thadgavin.c <span class="at">-o</span> thadgavin.exe <span class="at">-Wall</span> <span class="at">-lm</span> <span class="at">-O6</span> <span class="at">-mpentium</span> <span class="at">-fomit-frame-pointer</span> <span class="at">-ffast-math</span></span></code></pre></div>
<h3
id="to-use-under-windows-x-windows-or-macos-using-the-simple-directmedia-layer">To
use under Windows, X-Windows or macOS using the Simple DirectMedia
Layer:</h3>
<div class="sourceCode" id="cb10"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="fu">gcc</span> <span class="at">-O6</span> <span class="at">-lpthread</span> <span class="at">-g</span> <span class="at">-o</span> thadgavin thadgavin.c <span class="at">-lSDL</span> <span class="at">-DSDL</span> <span class="at">-lm</span></span></code></pre></div>
<h3 id="to-use-curses">To use curses:</h3>
<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">gcc</span> <span class="at">-O6</span> <span class="at">-lpthread</span> <span class="at">-g</span> <span class="at">-o</span> thadgavin thadgavin.c <span class="at">-lncurses</span> <span class="at">-lm</span></span></code></pre></div>
<h3 id="warnings">Warnings</h3>
<p>In gcc you might get the following warning:</p>
<pre><code>thadgavin.c.c:46: warning: passing arg 2 of `SDL_SetColors&#39; from incompatible pointer type</code></pre>
<p>In Microsoft Visual Studio you may get warnings as follows:</p>
<pre><code>thadgavin.c(46) : warning C4133: &#39;function&#39; : incompatible types - from &#39;unsigned
char *&#39; to &#39;struct SDL_Color *&#39;
thadgavin.c(63) : warning C4026: function declared with formal parameter list
thadgavin.c(77) : warning C4244: &#39;=&#39; : conversion from &#39;double &#39; to &#39;unsigned
char &#39;, possible loss of data
</code></pre>
<p>But don’t worry, this is completely normal.</p>
<h3 id="recommended-dosage">Recommended dosage:</h3>
<p>At least 3 minutes taken 3 times a day when tired.</p>
<p>Do not exceed 3 times recommended dose. May cause sickness,
dizziness, nausea.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-2000thadgavin"><a name="inventory"></a>Inventory
for 2000/thadgavin</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/thadgavin/thadgavin.c">thadgavin.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/thadgavin/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/thadgavin/thadgavin.alt.c">thadgavin.alt.c</a>
- alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/thadgavin/thadgavin.orig.c">thadgavin.orig.c</a>
- original source</li>
<li><a href="2000_thadgavin.tar.bz2">2000_thadgavin.tar.bz2</a> -
download winning source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/thadgavin/.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/2000/thadgavin/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/thadgavin/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Fthadgavin%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->
+269 -13
View File
@@ -1,4 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- START: two lines up starts content from: inc/top.default.html -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,281 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 2000/tomx/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2000 tomx</title>
<meta name="description" content="IOCCC year: 2000 IOCCC winner: tomx winner index page">
<meta name="keywords" content="IOCCC,2000,tomx,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2000/tomx</title>
<meta name="description" content="2000 IOCCC winner tomx">
<meta name="keywords" content="IOCCC, 2000, IOCCC 2000, IOCCC winner, tomx">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>2000 tomx</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>2000/tomx</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.last.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Ftomx%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2000/tomx/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../thadgavin/index.html">&larr; thadgavin</a>
<a class="Left" href="../index.html">&uarr; 2000 &uarr;</a>
<a class="Left Disabled" href="#">last entry</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.last.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#Thomas_P_John">Thomas P John</a><br>
Location: <a href="/temp-test-ioccc/location.html#NL">NL</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<p>There is an alternate version that compiles <a
href="mkentry.c">mkentry.c</a>. See <a href="#alternate-code">alternate
code</a>.</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">./tomx</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>This alternate code is based on the author’s remarks with a slight
fix so that it will do what it once did, compile and run <a
href="mkentry.c">mkentry.c</a>. You can use it in a similar way as <a
href="tomx.c">tomx.c</a>, both executing the source file and using it as
a Makefile and running the code ends up running
<code>mkentry</code>.</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>Polyglots have come and gone, but this was the first one we’d seen
where one language <em>used</em> another to perform its tasks. An
interesting approach. Admittedly, it’s not all that obfuscated - but
there’s more to it than you might think, since you have to make sure
that your changes don’t change the shell code or the Makefile.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="summary">Summary</h3>
<p>This program works as a C source file, a Makefile and also as a shell
(<code>/bin/sh</code>) script. But unlike some other multi-language
programs, this one is NOT meant to print <code>Hello, world</code> in
all 3 cases (At least in the true sense ;-)). The C, Makefile and shell
code build upon each other to create a C program (?) which when executed
as a shell script will compile itself through the C compiler using a
Makefile! - Pretty useful, Eh?</p>
<p>Probably, this is the first entry ever to fully satisfy Rule #1
(“Your entry must be a complete program”) in the strictest sense;-)</p>
<h3 id="top-5-reasons-imho-why-this-code-is-an-entry-for-ioccc">Top 5
reasons (IMHO) why this code is an entry for IOCCC</h3>
<ol type="1">
<li><p>A glance at the source itself will tell you that most of the
Obfuscation is NOT in the C code per se, but in the comments to the C
code. (But sadly, I could not find an “International Obfuscated C
COMMENT contest”. So I HAD to send this entry here to the IOCCC
itself).</p></li>
<li><p>Of the 3 languages in the source, the least obfuscated is C (But
again, there was NO obfuscated make/shscript contest) (Does this hint
for a rule in IOCCC-2001 that the major obfuscation should be in C and
not elsewhere???. Mmmmm…).</p></li>
<li><p>Extending Argument #2… Obfuscation done in the C code (comments?)
creates obfuscated code for the other 2 languages. This opens new
possibilities to be explored in depth in future
<code>IOCCC</code>s.</p></li>
<li><p>LOOKS like a Makefile, WORKS like a shell script and COMPILES
like a C program.</p></li>
<li><p>Does something useful (See Notes #1 and #2 below).</p></li>
</ol>
<h3 id="notes">Notes</h3>
<ol type="1">
<li>The program could have been something other than the simple “Hello,
world” program that it is. It is possible to do
<code>#include "prog2.c"</code> in the place of the <code>main()</code>,
leaving the complexities of the C file elsewhere and making this source
still acceptable to <code>make</code> and <code>sh</code>. The following
modification to the last few lines will compile the IOCCC’s famous <a
href="mkentry.c">mkentry.c</a>.</li>
</ol>
<pre><code>.PHONY: /* true clean */
#undef true
#include &quot;mkentry.c&quot;</code></pre>
<p>Ain’t that useful?</p>
<ol start="2" type="1">
<li><p>By extending this program’s idea, It is possible to do some very
interesting things like generating C code on execution by adding
additional code in make/sh (open up a loop????). This opens the
possibilities of generating &amp; compiling some (obfuscated?) C code.
(Maybe should try this if this program fails at IOCCC 2000)</p></li>
<li><p>Changing the <code>%:%.c</code> dependency to a
<code>$(PROG):$(PROG).c</code> form can compile this program with some
other <code>make</code>s (I got it to work in Windows using nmake and
Gnuwin32’s sh ;-) )</p></li>
<li><p>Interesting things to do: try <code>./tomx.c clean</code>. This
will do the same as <code>make clean</code> :-)). Also:
<code>./tomx.c all</code></p></li>
<li><p>Be careful about the tabs in the source code. Removing them or
converting tabs to spaces can be disastrous.</p></li>
</ol>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-2000tomx"><a name="inventory"></a>Inventory for
2000/tomx</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/tomx/tomx.c">tomx.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/tomx/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/tomx/tomx.alt.c">tomx.alt.c</a>
- alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/tomx/tomx.orig.c">tomx.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/tomx/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/2000/tomx/try.sh">try.sh</a>
- how to run</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/tomx/mkentry.c">mkentry.c</a>
- IOCCC mkentry source from 1998</li>
<li><a href="2000_tomx.tar.bz2">2000_tomx.tar.bz2</a> - download winning
source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/tomx/.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/2000/tomx/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/tomx/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2000%2Ftomx%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->