Renamed `ioccc.ico` to `favicon.ico`. Correctly added use of `favicon.ico` to all constructed HTML headers. Fixed the smart quote in HTML elements problem. Moved HTML "DO NOT EDIT" comments down below at the bottom of the HTML phase 1 section. According to to the Nu Html Checker, a charset attribute on a meta element found after the first 1024 bytes. Changed `bin/md2html.sh` VERSION from "1.1.3 2024-03-28" to "1.2 2024-03-30". Improved `bin/gen-status.sh` to adjust the "status_update" value only when the "contest_status" is changed. Performed a `make www` to perform and test the above under macOS.
483 lines
27 KiB
HTML
483 lines
27 KiB
HTML
<!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 -->
|
||
|
||
<!-- END: this line ends content from: inc/top.default.html -->
|
||
<!-- START: this line starts content from: inc/head.default.html -->
|
||
|
||
<head>
|
||
<link rel="stylesheet" href="../../ioccc.css">
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||
<title>2000/rince - Astronomically Obfuscated</title>
|
||
<link rel="icon" type="image/x-icon" href="../../favicon.ico">
|
||
<meta name="description" content="2000 IOCCC entry rince - Astronomically Obfuscated">
|
||
<meta name="keywords" content="IOCCC, 2000, IOCCC 2000, IOCCC entry, rince, Astronomically Obfuscated">
|
||
</head>
|
||
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
|
||
<!-- END: this line ends content from: inc/head.default.html -->
|
||
|
||
<!-- -->
|
||
<!-- This web page was formed via the tool: bin/readme2index.sh -->
|
||
<!-- The content of main section of this web page came from: 2000/rince/README.md -->
|
||
<!-- -->
|
||
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2000/rince/README.md !!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2000/rince/README.md !!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2000/rince/README.md !!! -->
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
|
||
<!-- Markdown content was converted into HTML via the tool: bin/md2html.sh -->
|
||
|
||
<!-- START: this line starts content from: inc/body.default.html -->
|
||
|
||
<body>
|
||
|
||
<!-- END: this line ends content from: inc/body.default.html -->
|
||
<!-- START: this line starts content from: inc/header.default.html -->
|
||
|
||
<div class="header">
|
||
<img src="../../png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
|
||
<h1>The International Obfuscated C Code Contest</h1>
|
||
<h2>2000/rince - Astronomically Obfuscated</h2>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/header.default.html -->
|
||
<!-- START: this line starts content from: inc/topnav.mid.html -->
|
||
|
||
<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="https://github.com/ioccc-src/temp-test-ioccc/2000/rince/rince.c">C code</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/temp-test-ioccc/2000/rince/Makefile">Makefile</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="../../index.html">IOCCC Home</a>
|
||
<a href="../../years.html">Winning Entries</a>
|
||
<a href="../../authors.html">People who have won</a>
|
||
<a href="../../location.html">Location of authors</a>
|
||
</div>
|
||
<hr>
|
||
<div class="sidenav">
|
||
<a href="../../news.html">IOCCC News</a>
|
||
<a href="../../status.html">Contest status</a>
|
||
<a href="../../faq.html#submit">How to enter the IOCCC</a>
|
||
<a href="../../faq.html">FAQ</a>
|
||
</div>
|
||
<hr>
|
||
<div class="sidenav">
|
||
<a href="../../bugs.html">Bugs & (mis)features</a>
|
||
<a href="../../faq.html#fix_an_entry">Fixing IOCCC entries</a>
|
||
<a href="../../faq.html#fix_web_site">Fixing the web site</a>
|
||
<a href="../../faq.html#fix_author">Fixing author info</a>
|
||
<a href="../../thanks-for-help.html">Thanks for the help</a>
|
||
</div>
|
||
<hr>
|
||
<div class="sidenav">
|
||
<a href="../../judges.html">The IOCCC Judges</a>
|
||
<a href="../../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 for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
|
||
|
||
<!-- START: this line starts content generated by: bin/output-index-author.sh -->
|
||
|
||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||
<ul>
|
||
<li>Name: <a href="../../authors.html#James_Bonfield">James Bonfield</a><br>
|
||
Location: <a href="../../location.html#GB">GB</a> - <em>United Kingdom of Great Britain and Northern Ireland</em> (<em>United Kingdom</em>)
|
||
<br><br></li>
|
||
</ul>
|
||
|
||
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
|
||
|
||
<!-- END: this line ends content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
|
||
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.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.html#2000_rince">2000 rince bugs</a>.</p>
|
||
<h2 id="to-use">To use:</h2>
|
||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./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>
|
||
<h2 id="try">Try:</h2>
|
||
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
|
||
<p>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="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./rince</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="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> 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="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 2441193.6</span>
|
||
<span id="cb7-2"><a href="#cb7-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="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">./rince</span> 0 <span class="va">$(</span><span class="ex">./dmy2jd</span> 7.8 1 1610<span class="va">)</span></span>
|
||
<span id="cb11-2"><a href="#cb11-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="cb11-3"><a href="#cb11-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="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> 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>
|
||
<!--
|
||
|
||
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
|
||
|
||
You are free to share and adapt this file under the terms of this license:
|
||
|
||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||
|
||
For more information, see:
|
||
|
||
https://creativecommons.org/licenses/by-sa/4.0/
|
||
|
||
-->
|
||
<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>
|
||
|
||
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
|
||
|
||
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
|
||
|
||
<h1 id="inventory-for-2000rince"><a name="inventory"></a>Inventory for 2000/rince</h1>
|
||
<p><a href="#top">Jump to top</a></p>
|
||
<h2 id="primary-files">Primary files</h2>
|
||
<ul>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/rince/rince.c">rince.c</a> - entry source</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/rince/Makefile">Makefile</a> - entry 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 entry</li>
|
||
</ul>
|
||
<h2 id="secondary-files">Secondary files</h2>
|
||
<ul>
|
||
<li><a href="index.html">index.html</a> - entry home page</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/rince/README.md">README.md</a> - markdown source for index.html</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/rince/.entry.json">.entry.json</a> - description of entry in JSON</li>
|
||
<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>
|
||
</ul>
|
||
|
||
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
|
||
|
||
<!-- END: this line ends content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.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 -->
|
||
|
||
<!--
|
||
|
||
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
|
||
|
||
You are free to share and adapt this file under the terms of this license:
|
||
|
||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||
|
||
For more information, see:
|
||
|
||
https://creativecommons.org/licenses/by-sa/4.0/
|
||
|
||
-->
|
||
|
||
<div class="footer">
|
||
<h2>Copyright and CC BY-SA 4.0 License</h2>
|
||
<p>This file and web page is:</p>
|
||
<blockquote><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></p></blockquote>
|
||
<p>You are free to share and adapt this file under the terms of this license:</p>
|
||
<blockquote><b>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</b></blockquote>
|
||
<p>For more information, see:</p>
|
||
<blockquote><a
|
||
href="https://creativecommons.org/licenses/by-sa/4.0/">https://creativecommons.org/licenses/by-sa/4.0/</a></blockquote>
|
||
<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 -->
|