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:
1 parent
893cd915b6
commit
c1466f5165
350 files changed
+95242
-4217
No files matched your search
+467
-13
@@ -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">← primenum</a>
|
||||
<a class="Left" href="../index.html">↑ 2000 ↑</a>
|
||||
<a class="Left" href="../robison/index.html">robison →</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 & (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's not a bug, that'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 <---+---> 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't believe how
|
||||
many more he could now see! The number seemed infinite. He was
|
||||
beginning to realize the fixed stars weren'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'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'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 -->
|
||||
Reference in new issue
Block a user