add rules, guidelines, fix HTML code, move compressed tarball in inventory

By changing the _inventory_order_ of the compressed tarball from
**100000** to **1415926535**, the compressed tarball will land at
the top of the secondary file list and remain still easy to find.

Updated the `manifest.numbers` spreadsheet and rebuilt
the `.entry.json` files.

Added `next/` directory to hold the next IOCCC rules and guidelines.
Added `next/README.md` that `bin/gen-top-html.sh` uses to form
the `next/index.html` file.

Added _Rules and Guidelines_ link to the sidenav bar to link to the
`next/index.html` file.

Added _IOCCC Rules_ as `next/rules.md` that `bin/gen-top-html.sh`
uses to form the `next/rules.html` file.

Added _IOCCC Guidelines_ as `next/guidelines.md` that `bin/gen-top-html.sh`
uses to form the `next/guidelines.html` file.

Changed `bin/gen-top-html.sh` VERSION from "1.2.4 2024-04-13"
to "1.3 2024-04-14".

Prevent `pandoc(1)` from interpreting the commented out language
of a markdown code block as a code class.  So a markdown such as:

````
``` <!---sh-->
...
```
````

that produced HTML of the form:

```html
<pre class="&lt;!---sh--&gt;"><code>...</code></pre>
```

will now produce HTML of the form:

```html
<pre><code>...</code></pre>
```

NOTE: Before when the language of a markdown code block
was not commented, the HTML produced by `pandoc(1)` was
oddly indented with extra whitespace on the first line
of the code block.  While commenting out the language
of the code block removed some of the odd intending,
it left a weird class in the HTML pre block that
surrounded the HTML code block.  This hack prevents
`pandoc(1)` from assigning a class to the HTML pre block.

Changed `in/md2html.sh` VERSION from "1.2.1 2024-04-13"
to "1.3 2024-04-14".

Added `make gen_sitemap` to end of both `make www` and `make
quick_www` in top level Makefile.

Ram `make www` to test under macOS and to perform the above.

**IMPORTANT NOTE**: The current `next/rules.md` and `next/guidelines.md`
are simply the 2020 IOCCC Rules and Guidelines converted into
markdown form.  There are **NOT** the Rules and Guidelines that
will be used the IOCCC MOCK, nor the next IOCCC.

TODO: Improve the `bin/gen-status.sh` tool to modify the top of the
      `next/rules.md` and `next/guidelines.md` files to keep them
      in sync with the _contest_status_ as found in `status.json`.

TODO: Improve the look and feel of the `next/rules.md` and
      `next/guidelines.md` markdown files.
This commit is contained in:
Landon Curt Noll committed 2024-04-14 16:54:24 -07:00
1 parent a672335d2d
commit 518a6336d0
734 files changed
+7919 -4119

No files matched your search

+1 -1
View File
@@ -51,7 +51,7 @@
},
{
"file_path" : "2018_algmyr.tar.bz2",
"inventory_order" : 100000,
"inventory_order" : 1415926535,
"OK_to_edit" : false,
"display_as" : "tbz2",
"display_via_github" : false,
+8 -7
View File
@@ -88,6 +88,7 @@
<div class="sidenav">
<a href="../../news.html">IOCCC News</a>
<a href="../../status.html">Contest status</a>
<a href="../../next/index.html">Rules and Guidelines</a>
<a href="../../faq.html#submit">How to enter the IOCCC</a>
<a href="../../faq.html">FAQ</a>
</div>
@@ -141,7 +142,7 @@ Location: <a href="../../location.html#SE">SE</a> - <em>Kingdom of Sweden</em> (
<!-- 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>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<pre><code> make</code></pre>
<p>To use this entry requires, in some invocations, a sound processing program.
This can be ALSA or SoX but we recommend the latter. See <a href="../../faq.html#sox">FAQ 3.10 - How do I
compile and use an IOCCC entry that requires sound?</a>.</p>
@@ -150,11 +151,11 @@ compile and use an IOCCC entry that requires sound?</a>.</p>
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2018_algmyr">2018 algmyr bugs</a>.</p>
<h2 id="to-use">To use:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./prog &lt; prog.c # Print garbage: might mess up your terminal
<pre><code> ./prog &lt; prog.c # Print garbage: might mess up your terminal
./prog &lt;file1&gt; &lt;file2&gt; &gt; out.raw
./prog -d 2 0 out.raw # Decode the first (0th) channel out of two</code></pre>
<h2 id="try">Try:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<pre><code> ./try.sh</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Be warned, this is not your garden variety text-to-speech program! Earplugs are advised,
or at least a handy and well-tested volume knob.</p>
@@ -242,14 +243,14 @@ additional logic? Answer: <code>ungetc(3)</code> into <code>stdin</code>, one <c
standards compliant). This is used to print the usage instructions.</p>
<h3 id="compilation-warnings">Compilation warnings</h3>
<p>Compiling using</p>
<pre class="&lt;!---sh--&gt;"><code> gcc -Wall -Wextra -pedantic</code></pre>
<pre><code> gcc -Wall -Wextra -pedantic</code></pre>
<p>gives only <code>-Wmisleading-indentation</code> which is sensible considering the source code. While</p>
<pre class="&lt;!---sh--&gt;"><code> clang -Wall -Wextra -pedantic</code></pre>
<pre><code> clang -Wall -Wextra -pedantic</code></pre>
<p>is a bit more pessimistic and gives <code>-Wempty-body</code> (I like loops without
bodies), <code>-Wstring-plus-int</code> (since apparently some people think string+<code>int</code> is a
concatenation) and one of the weirder warnings I have seen from me splitting a
negative constant with whitespace. Compiling using</p>
<pre class="&lt;!---sh--&gt;"><code> clang -Wall -Wextra -pedantic -Weverything</code></pre>
<pre><code> clang -Wall -Wextra -pedantic -Weverything</code></pre>
<p>produces a few page faults of warnings and makes me feel generally bad about
myself. :(</p>
<h3 id="misc">Misc</h3>
@@ -283,10 +284,10 @@ myself. :(</p>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/algmyr/prog.orig.c">prog.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/algmyr/try.sh">try.sh</a> - how to run</li>
<li><a href="spoiler.png">spoiler.png</a> - SPOILER WARNING</li>
<li><a href="2018_algmyr.tar.bz2">2018_algmyr.tar.bz2</a> - download entry tarball</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="2018_algmyr.tar.bz2">2018_algmyr.tar.bz2</a> - download entry tarball</li>
<li><a href="index.html">index.html</a> - this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/algmyr/README.md">README.md</a> - markdown source for this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/algmyr/.entry.json">.entry.json</a> - description of entry in JSON</li>
+1 -1
View File
@@ -59,7 +59,7 @@
},
{
"file_path" : "2018_anderson.tar.bz2",
"inventory_order" : 100000,
"inventory_order" : 1415926535,
"OK_to_edit" : false,
"display_as" : "tbz2",
"display_via_github" : false,
+8 -7
View File
@@ -88,6 +88,7 @@
<div class="sidenav">
<a href="../../news.html">IOCCC News</a>
<a href="../../status.html">Contest status</a>
<a href="../../next/index.html">Rules and Guidelines</a>
<a href="../../faq.html#submit">How to enter the IOCCC</a>
<a href="../../faq.html">FAQ</a>
</div>
@@ -141,29 +142,29 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- 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>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<pre><code> make</code></pre>
<p>There is an alternate version of this entry. See <a href="#alternate-code">Alternate
code</a> below for more details.</p>
<h2 id="to-use">To use:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./prog &lt; textfile</code></pre>
<pre><code> ./prog &lt; textfile</code></pre>
<h2 id="try">Try:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<pre><code> ./try.sh</code></pre>
<h2 id="alternate-code">Alternate code:</h2>
<p>Compare <a href="prog.c">prog.c</a> and <a href="prog.alt.c">prog.alt.c</a> and find out why we had to
modify the entry, and what confused the author (see the author’s remarks). No,
it was not the shape of the Roman V that we, or the compiler, didn’t like.</p>
<h3 id="alternate-build">Alternate build:</h3>
<pre class="&lt;!---sh--&gt;"><code> make alt</code></pre>
<pre><code> make alt</code></pre>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>prog.alt</code> as you would <code>prog</code> above.</p>
<h3 id="alternate-try">Alternate try:</h3>
<pre class="&lt;!---sh--&gt;"><code> ./try.alt.sh</code></pre>
<pre><code> ./try.alt.sh</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>With this entry, you won’t need to turn your monitor <a href="http://en.wikipedia.org/wiki/River_%28typography%29">upside
down</a>!</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="compiling-the-program">Compiling the program:</h3>
<pre class="&lt;!---sh--&gt;"><code> cc -Wall -Wextra -Wpedantic -O3 -std=c11 prog.c -o prog</code></pre>
<pre><code> cc -Wall -Wextra -Wpedantic -O3 -std=c11 prog.c -o prog</code></pre>
<p>Also works with a standard of C99, but C90/C89 will not compile due to
<code>for</code> loop initial declarations, along with additional warnings about
variable length arrays and lack of a <code>return</code> statement.</p>
@@ -222,10 +223,10 @@ secondarily to obfuscate.</p>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/anderson/prog.orig.c">prog.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/anderson/try.alt.sh">try.alt.sh</a> - how to run alternate code</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/anderson/try.sh">try.sh</a> - how to run</li>
<li><a href="2018_anderson.tar.bz2">2018_anderson.tar.bz2</a> - download entry tarball</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="2018_anderson.tar.bz2">2018_anderson.tar.bz2</a> - download entry tarball</li>
<li><a href="index.html">index.html</a> - this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/anderson/README.md">README.md</a> - markdown source for this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/anderson/.entry.json">.entry.json</a> - description of entry in JSON</li>
+1 -1
View File
@@ -59,7 +59,7 @@
},
{
"file_path" : "2018_bellard.tar.bz2",
"inventory_order" : 100000,
"inventory_order" : 1415926535,
"OK_to_edit" : false,
"display_as" : "tbz2",
"display_via_github" : false,
+7 -6
View File
@@ -88,6 +88,7 @@
<div class="sidenav">
<a href="../../news.html">IOCCC News</a>
<a href="../../status.html">Contest status</a>
<a href="../../next/index.html">Rules and Guidelines</a>
<a href="../../faq.html#submit">How to enter the IOCCC</a>
<a href="../../faq.html">FAQ</a>
</div>
@@ -141,16 +142,16 @@ Location: <a href="../../location.html#FR">FR</a> - <em>French Republic</em> (<e
<!-- 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>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<pre><code> make</code></pre>
<p>There is an alternate version that should work with Windows. See <a href="#alternate-code">Alternate
code</a> below.</p>
<h2 id="to-use">To use:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./prog &gt; lena.ppm</code></pre>
<pre><code> ./prog &gt; lena.ppm</code></pre>
<h2 id="try">Try:</h2>
<p>First open <a href="Lenna.png">Lenna.png</a> in your graphics viewer of choice. Next, after
running the above command (<code>./prog &gt; lena.ppm</code>), open <code>lena.ppm</code> in your
graphics viewer of choice. After that try:</p>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<pre><code> ./try.sh</code></pre>
<p>NOTE: the script uses the tools <code>pngtopam(1)</code> (or <code>pngtopnm(1)</code> for older
versions) and <code>pnmscale</code> come from the netpbm project and <code>cjpeg(1)</code> comes from
<code>libjpeg-turbo</code>. If you don’t have these tools already see <a href="../../faq.html#netpbm">FAQ 3.15 - How do I
@@ -163,7 +164,7 @@ it?</a>.</p>
<p>The <a href="prog.alt.c">prog.alt.c</a> is based on the author’s remarks and it should work
for Windows.</p>
<h3 id="alternate-build">Alternate build:</h3>
<pre class="&lt;!---sh--&gt;"><code> make alt</code></pre>
<pre><code> make alt</code></pre>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>prog.alt</code> as you would <code>prog</code>.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
@@ -200,7 +201,7 @@ as the algorithms already have a significant complexity.</p>
<p>Although the program was optimized to decompress its built-in image,
it accepts to decompress image files from its standard
input. Examples:</p>
<pre class="&lt;!---sh--&gt;"><code> ./prog d &lt; lena512.bin &gt; lena512.ppm
<pre><code> ./prog d &lt; lena512.bin &gt; lena512.ppm
./prog d &lt; fruits.bin &gt; fruits.ppm
./prog d &lt; vintage_cars.bin &gt; vintage_cars.ppm</code></pre>
<p>The original images for <a href="https://commons.wikimedia.org/wiki/File%3AFruits_oranges%2C_jardin_japonais_2.JPG">fruits</a> and <a href="https://commons.wikimedia.org/wiki/File%3ARed_Bull_Jungfrau_Stafette%2C_10th_stage_-_vintage_cars_%282%29.jpg">vintage cars</a> come from
@@ -238,10 +239,10 @@ the output.</p>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/bellard/prog.orig.c">prog.orig.c</a> - original source</li>
<li><a href="Lenna.png">Lenna.png</a> - sample image data</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/bellard/try.sh">try.sh</a> - how to run</li>
<li><a href="2018_bellard.tar.bz2">2018_bellard.tar.bz2</a> - download entry tarball</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="2018_bellard.tar.bz2">2018_bellard.tar.bz2</a> - download entry tarball</li>
<li><a href="index.html">index.html</a> - this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/bellard/README.md">README.md</a> - markdown source for this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/bellard/.entry.json">.entry.json</a> - description of entry in JSON</li>
+1 -1
View File
@@ -59,7 +59,7 @@
},
{
"file_path" : "2018_burton1.tar.bz2",
"inventory_order" : 100000,
"inventory_order" : 1415926535,
"OK_to_edit" : false,
"display_as" : "tbz2",
"display_via_github" : false,
+13 -12
View File
@@ -88,6 +88,7 @@
<div class="sidenav">
<a href="../../news.html">IOCCC News</a>
<a href="../../status.html">Contest status</a>
<a href="../../next/index.html">Rules and Guidelines</a>
<a href="../../faq.html#submit">How to enter the IOCCC</a>
<a href="../../faq.html">FAQ</a>
</div>
@@ -141,20 +142,20 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- 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>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<pre><code> make</code></pre>
<p>There is an alternate version of this entry. See <a href="#alternate-code">Alternate
code</a> below.</p>
<h2 id="to-use">To use:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./prog &lt; any-file</code></pre>
<pre><code> ./prog &lt; any-file</code></pre>
<h2 id="try">Try:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<pre><code> ./try.sh</code></pre>
<h2 id="alternate-code">Alternate code:</h2>
<p>An alternate version of this entry, <a href="prog.alt.c">prog.alt.c</a>, is provided
This alternate code was supposed to compile without warnings, however
with modern compilers this is no longer the case so it will only cleanly compile
with <code>-Wno-</code> options.</p>
<h3 id="alternate-build">Alternate build:</h3>
<pre class="&lt;!---sh--&gt;"><code> make alt</code></pre>
<pre><code> make alt</code></pre>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>prog.alt</code> as you would <code>prog</code>.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
@@ -187,14 +188,14 @@ and without bypassing the solution using <code>execve(2)</code>, or functions bu
(<code>system(3)</code>, <code>popen(3)</code>, etc).</li>
</ul>
<p>E.g:</p>
<pre class="&lt;!---c--&gt;"><code> main(){system(&quot;hd&quot;);} // it&#39;s turtles all the way down!</code></pre>
<pre><code> main(){system(&quot;hd&quot;);} // it&#39;s turtles all the way down!</code></pre>
<p>is not acceptable.</p>
<p>And, “output correctly” is the output format of this entry. QED.</p>
<p>Early attempts ended up at a reasonably short 157 characters.
This was too long for a one-liner, so it had to be formatted as something more interesting.
This solution is pleasing, but a true one-liner was the hoped-for goal.
Here is the 157 character version in it’s entirety:</p>
<pre class="&lt;!---c--&gt;"><code> char O,o[ 20];L(O){
<pre><code> char O,o[ 20];L(O){
putchar ( O+ 48+39 *(9&lt;
O));} I(O) {L(~ 15);
O|| puts(o);} main (l){
@@ -209,7 +210,7 @@ This dramatic reduction started to feel close to minimal, and the hunt resumed.
The progression to the present size is interesting,
and it is interesting that the same algorithm can be expressed so differently
by slight rearrangement of its parts.</p>
<pre class="&lt;!---c--&gt;"><code> // 119
<pre><code> // 119
char O,o[20];main(l){for(;~(l=getchar());O||puts(o))o[O++]=isprint(l)?l:46,O&amp;=15,printf(&quot;%02x &quot;,l);O[o]=0;O&amp;&amp;puts(o);}
// 116
char O,o[20];main(l){for(;O++[o]=~(l=getchar())?4&lt;(4^l&gt;&gt;5)?l:46:0;(O&amp;=15)||puts(o))printf(&quot;%02x &quot;,l);O&gt;1&amp;&amp;puts(o);}
@@ -229,7 +230,7 @@ by slight rearrangement of its parts.</p>
These do not compete in the same category, since their output is materially different.
They are derived from the solutions above, but are still fascinating as concise utilities,
so here is their progression, for the curious:</p>
<pre class="&lt;!---c--&gt;"><code> // 102
<pre><code> // 102
I;O(O){putchar(O+48+39*(9&lt;O));}main(l){for(;~(l=getchar());O(++I&amp;15?~15:~37))O(l&gt;&gt;4),O(l&amp;15);O(-38);}
// 80
O;main(l){while(~(l=getchar()))printf(&quot;%02x%c&quot;,l,++O&amp;15?32:10);O&amp;15&amp;&amp;puts(&quot;&quot;);}
@@ -242,7 +243,7 @@ so here is their progression, for the curious:</p>
<p>It is possible to reduce the size of each of these by one by eliding the trailing newline.
This was not reported above since the newline kept getting appended by processing software,
and it is more interesting to remove characters by changing code than by filtering:</p>
<pre class="&lt;!---sh--&gt;"><code> $ tr -d &#39;\012&#39; &lt; 109.c | wc -c
<pre><code> $ tr -d &#39;\012&#39; &lt; 109.c | wc -c
108
$ tr -d &#39;\012&#39; &lt; 76.c | wc -c
75
@@ -321,9 +322,9 @@ perhaps – the smallest, clean-compiling version using <code>clang</code> or <c
attempt, it will <em>not</em> work with the original Ritchie PDP-11 C compiler, since
the expression within the ternary remains too complex.</p>
<p>Try:</p>
<pre class="&lt;!---sh--&gt;"><code> cat prog.c prog.alt.c</code></pre>
<pre><code> cat prog.c prog.alt.c</code></pre>
<p>or</p>
<pre class="&lt;!---sh--&gt;"><code> cmp -b prog.c prog.alt.c</code></pre>
<pre><code> cmp -b prog.c prog.alt.c</code></pre>
<p>to compare the differences (<code>diff</code> is not helpful on a one-liner).</p>
<!--
@@ -354,10 +355,10 @@ the expression within the ternary remains too complex.</p>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/burton1/prog.orig.c">prog.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/burton1/scripthd.sh">scripthd.sh</a> - driver program - adds several nice-to-have features</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/burton1/try.sh">try.sh</a> - how to run</li>
<li><a href="2018_burton1.tar.bz2">2018_burton1.tar.bz2</a> - download entry tarball</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="2018_burton1.tar.bz2">2018_burton1.tar.bz2</a> - download entry tarball</li>
<li><a href="index.html">index.html</a> - this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/burton1/README.md">README.md</a> - markdown source for this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/burton1/.entry.json">.entry.json</a> - description of entry in JSON</li>
+1 -1
View File
@@ -443,7 +443,7 @@
},
{
"file_path" : "2018_burton2.tar.bz2",
"inventory_order" : 100000,
"inventory_order" : 1415926535,
"OK_to_edit" : false,
"display_as" : "tbz2",
"display_via_github" : false,
+1
View File
@@ -83,6 +83,7 @@
<div class="sidenav">
<a href="../../news.html">IOCCC News</a>
<a href="../../status.html">Contest status</a>
<a href="../../next/index.html">Rules and Guidelines</a>
<a href="../../faq.html#submit">How to enter the IOCCC</a>
<a href="../../faq.html">FAQ</a>
</div>
+15 -14
View File
@@ -88,6 +88,7 @@
<div class="sidenav">
<a href="../../news.html">IOCCC News</a>
<a href="../../status.html">Contest status</a>
<a href="../../next/index.html">Rules and Guidelines</a>
<a href="../../faq.html#submit">How to enter the IOCCC</a>
<a href="../../faq.html">FAQ</a>
</div>
@@ -141,13 +142,13 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- 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>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<pre><code> make</code></pre>
<h2 id="to-use">To use:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./prog [-tcksri] &lt; file.c</code></pre>
<pre><code> ./prog [-tcksri] &lt; file.c</code></pre>
<h2 id="try">Try:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<pre><code> ./try.sh</code></pre>
<p>If you get really stuck, try:</p>
<pre class="&lt;!---sh--&gt;"><code> man ./tac.1</code></pre>
<pre><code> man ./tac.1</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>They say size isn’t everything, and in the case of IOCCC
<a href="../../2018/iocccsize.c">iocccsize.c</a> that is saying something!
@@ -228,16 +229,16 @@ quote consumes everything until the next quote</li>
<li>Comments between preprocessor hash and keyword are not replaced with whitespace;
the following counts #include as two tokens, <code>#</code> and <code>include</code> (not as a reserved word):</li>
</ul>
<pre class="&lt;!---c--&gt;"><code> #/*this will not be counted*/include/*correctly*/&lt;stdio.h&gt;</code></pre>
<pre><code> #/*this will not be counted*/include/*correctly*/&lt;stdio.h&gt;</code></pre>
<p>Fixing this properly hampers backwards compatibility in counting. This requires
eliding comments during the translation phases (ISO 5.1.1.2, phase 3), and yet still
counting words correctly absent <code>-k</code>.</p>
<h3 id="backwards-compatibility">Backwards Compatibility:</h3>
<p><code>tac</code> was run over all 366 previous IOCCC winning entries:</p>
<pre class="&lt;!---sh--&gt;"><code> find ~/src/obc -type f -name \*.c | wc</code></pre>
<pre><code> find ~/src/obc -type f -name \*.c | wc</code></pre>
<p>The discrepancies found are documented and explained in the file
<a href="discrepancies.html">discrepancies.html</a>.</p>
<pre class="&lt;!---sh--&gt;"><code> find ~/src/obc -type f -a -name &quot;*.c&quot; | xargs ./spotcheck.sh ./prog | ./spotdiff.sh |
<pre><code> find ~/src/obc -type f -a -name &quot;*.c&quot; | xargs ./spotcheck.sh ./prog | ./spotdiff.sh |
grep -v keep | diff -bw - discrep* | grep &quot;[&lt;&gt;] cl &quot;</code></pre>
<p>In summary, there are only 6 unique entries out of 366 that have any variation
in Rule 2 counts; in all cases, the differences are due to bugs within
@@ -273,10 +274,10 @@ This feature enables interesting analyses of C (and C++) code that’s hard to g
<p>For instance, here is a simple token counter, useful in finding repeated long tokens, or operator
frequency, or counting the references to identifiers, constants, or breadth of use of the
language:</p>
<pre class="&lt;!---sh--&gt;"><code> #!/usr/bin/env bash
<pre><code> #!/usr/bin/env bash
cat $* | ./prog -t | sort | uniq -c | sort -k1nr</code></pre>
<p>And here is a C keyword frequency counter:</p>
<pre class="&lt;!---sh--&gt;"><code> #!/usr/bin/env bash
<pre><code> #!/usr/bin/env bash
function iskeyword {
awk &#39;BEGIN{f=&quot;c11&quot;;while(getline&lt;f)k[$1]=0} {if($1 in k)k[$1]++}END{for(i in k)print k[i],i}&#39;
}
@@ -299,7 +300,7 @@ handful of simple rules (and another use of the external keyword file). A more
refined version of this is included in the file <a href="unob.sh">unob.sh</a>, but the
simple code below is a serviceable obfuscated C de-obfuscator in a <em>scripting
language</em>. It really is this easy with <code>tac</code>:</p>
<pre class="&lt;!---sh--&gt;"><code> #!/usr/bin/env bash
<pre><code> #!/usr/bin/env bash
script=&#39;
BEGIN {
last=nl=&quot;\n&quot;;
@@ -401,7 +402,7 @@ the IOJCC trash can.</p>
which is neither complete (<code>#define</code>, <code>#ifndef</code>, <code>#undef</code> are missing
– yes, Virginia knows about <code>#define</code> omitted on purpose),
nor correct (many more are added: <code>I</code>, <code>true</code>, <code>bool</code>, <code>compl</code>, …):</p>
<pre class="&lt;!---sh--&gt;"><code> (sed -n &#39;1p&#39; c11; sed -n &#39;2,$p&#39; ioccc.kw.freq | sort) | comm -3 - c11</code></pre>
<pre><code> (sed -n &#39;1p&#39; c11; sed -n &#39;2,$p&#39; ioccc.kw.freq | sort) | comm -3 - c11</code></pre>
<p>That is an obfuscated way to say “diff”. But it also more clearly shows the, um, diffs.</p>
<p>The usage string is similarly externalized, providing a better usability string than
the limits would otherwise allow. If this is considered bending the rules too far,
@@ -429,7 +430,7 @@ for obfuscation. Thus <code>-trigraphs -Wno-trigraphs</code> (which is also humo
<p>The code uses <code>unsigned char</code>s, but C strings are <code>signed</code>. Thus <code>-Wno-pointer-sign</code>.
NB: This is <em>not</em> a portability concern, the one string holds only printable ASCII characters.</p>
<p>Thus:</p>
<pre class="&lt;!---sh--&gt;"><code> cc -ansi -Wall -trigraphs -Wno-trigraphs -Wno-parentheses -Wno-empty-body -Wno-char-subscripts -Wno-pointer-sign -DU=O -DW=\&quot;keywords\&quot; -o prog prog.c</code></pre>
<pre><code> cc -ansi -Wall -trigraphs -Wno-trigraphs -Wno-parentheses -Wno-empty-body -Wno-char-subscripts -Wno-pointer-sign -DU=O -DW=\&quot;keywords\&quot; -o prog prog.c</code></pre>
<h3 id="coda">Coda:</h3>
<p><a href="../../authors.html#Cody_Boone_Ferguson">Cody Boone Ferguson</a> was relentless in his pursuit of bugs.
Thanks to his reports, the version of <a href="unob.sh">unob.sh</a> is stronger,
@@ -442,7 +443,7 @@ works well on most inputs, but tends to need some raw nroff for more fancy
constructions, such as combined arguments (e.g. the <code>-r</code> and <code>-s</code> arguments to tac
are not recognised when written as <code>-rs</code> in prose).</p>
<p>Try:</p>
<pre class="&lt;!---sh--&gt;"><code> ./manpage.sh tac
<pre><code> ./manpage.sh tac
./manpage.sh -h
./manpage.sh -h | ./manpage.sh
@@ -527,10 +528,10 @@ are not recognised when written as <code>-rs</code> in prose).</p>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/burton2/v7unix">v7unix</a> - reserved words for a given C standard</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/burton2/spotdiff.sh">spotdiff.sh</a> - summarize the results of spotcheck</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/burton2/src.doc.txt">src.doc.txt</a> - SPOILER WARNING hints about the source</li>
<li><a href="2018_burton2.tar.bz2">2018_burton2.tar.bz2</a> - download entry tarball</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="2018_burton2.tar.bz2">2018_burton2.tar.bz2</a> - download entry tarball</li>
<li><a href="index.html">index.html</a> - this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/burton2/README.md">README.md</a> - markdown source for this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/burton2/discrepancies.md">discrepancies.md</a> - markdown source for discrepancies.html</li>
+1 -1
View File
@@ -67,7 +67,7 @@
},
{
"file_path" : "2018_ciura.tar.bz2",
"inventory_order" : 100000,
"inventory_order" : 1415926535,
"OK_to_edit" : false,
"display_as" : "tbz2",
"display_via_github" : false,
+7 -6
View File
@@ -88,6 +88,7 @@
<div class="sidenav">
<a href="../../news.html">IOCCC News</a>
<a href="../../status.html">Contest status</a>
<a href="../../next/index.html">Rules and Guidelines</a>
<a href="../../faq.html#submit">How to enter the IOCCC</a>
<a href="../../faq.html">FAQ</a>
</div>
@@ -141,24 +142,24 @@ Location: <a href="../../location.html#PL">PL</a> - <em>Republic of Poland</em>
<!-- 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>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<pre><code> make</code></pre>
<p>There is an alternate version that lacks a useful bug fix. See <a href="#alternate-code">Alternate
code</a> and the author’s remarks (<a href="#remarks">remarks section</a>)
below for more details.</p>
<h2 id="to-use">To use:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./prog &lt; text</code></pre>
<pre><code> ./prog &lt; text</code></pre>
<h2 id="try">Try:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<pre><code> ./try.sh</code></pre>
<h2 id="alternate-code">Alternate code:</h2>
<p>An alternate version of this entry, <a href="prog.alt.c">prog.alt.c</a>, is provided. As
mentioned in the author’s <a href="#remarks">remarks</a>, the alternate version lacks a
useful bug fix.</p>
<h3 id="alternate-build">Alternate build:</h3>
<pre class="&lt;!---sh--&gt;"><code> make alt</code></pre>
<pre><code> make alt</code></pre>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>prog.alt</code> as you would <code>prog</code> above.</p>
<h3 id="alternate-try">Alternate try:</h3>
<pre class="&lt;!---sh--&gt;"><code> ./try.alt.sh</code></pre>
<pre><code> ./try.alt.sh</code></pre>
<p>Do you spot the fix by running both <a href="try.sh">try.sh</a> and
<a href="try.alt.sh">try.alt.sh</a>?</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
@@ -386,10 +387,10 @@ to <code>CSILENCE</code>.</p>
<li><a href="lexicon.pdf">lexicon.pdf</a> - How to squeeze a lexicon paper</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/ciura/try.alt.sh">try.alt.sh</a> - how to run alternate code</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/ciura/try.sh">try.sh</a> - how to run</li>
<li><a href="2018_ciura.tar.bz2">2018_ciura.tar.bz2</a> - download entry tarball</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="2018_ciura.tar.bz2">2018_ciura.tar.bz2</a> - download entry tarball</li>
<li><a href="index.html">index.html</a> - this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/ciura/README.md">README.md</a> - markdown source for this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/ciura/.entry.json">.entry.json</a> - description of entry in JSON</li>
+1 -1
View File
@@ -67,7 +67,7 @@
},
{
"file_path" : "2018_endoh1.tar.bz2",
"inventory_order" : 100000,
"inventory_order" : 1415926535,
"OK_to_edit" : false,
"display_as" : "tbz2",
"display_via_github" : false,
+8 -7
View File
@@ -88,6 +88,7 @@
<div class="sidenav">
<a href="../../news.html">IOCCC News</a>
<a href="../../status.html">Contest status</a>
<a href="../../next/index.html">Rules and Guidelines</a>
<a href="../../faq.html#submit">How to enter the IOCCC</a>
<a href="../../faq.html">FAQ</a>
</div>
@@ -141,12 +142,12 @@ Location: <a href="../../location.html#JP">JP</a> - <em>Japan</em></li>
<!-- 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>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<pre><code> make</code></pre>
<h2 id="to-use">To use:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./prog &lt; textfile &gt; output.gif</code></pre>
<pre><code> ./prog &lt; textfile &gt; output.gif</code></pre>
<h2 id="try">Try:</h2>
<p>To see the input files and feed them to the program, redirecting to GIF files:</p>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<pre><code> ./try.sh</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>To get the best experience, use a GIF viewer that can handle animated GIFs.
With macOS you can use Safari using <code>open -a Safari smily.gif</code>.</p>
@@ -158,16 +159,16 @@ how does it know which characters are closed?</p>
least 2MiB of memory to run in.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This program generates an animated GIF from a plain text. Run:</p>
<pre class="&lt;!---sh--&gt;"><code> cc -o prog prog.c
<pre><code> cc -o prog prog.c
./prog &lt; invisible.txt &gt; invisible.gif</code></pre>
<p>Open <code>invisible.gif</code> with a GIF viewer that can show animated GIFs and then wait
a minute. You will see a hidden message. Can you tell the difference between
letters that leave the mark and ones that do not?</p>
<p>Other examples:</p>
<pre class="&lt;!---sh--&gt;"><code> ./prog &lt; golem.txt &gt; golem.gif
<pre><code> ./prog &lt; golem.txt &gt; golem.gif
./prog &lt; smily.txt &gt; smily.gif</code></pre>
<p>The program itself has a hidden message.</p>
<pre class="&lt;!---sh--&gt;"><code> ./prog &lt; prog.c &gt; prog.gif</code></pre>
<pre><code> ./prog &lt; prog.c &gt; prog.gif</code></pre>
<!--
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
@@ -198,10 +199,10 @@ letters that leave the mark and ones that do not?</p>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/endoh1/invisible.txt">invisible.txt</a> - input data</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/endoh1/smily.txt">smily.txt</a> - input data</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/endoh1/try.sh">try.sh</a> - how to run</li>
<li><a href="2018_endoh1.tar.bz2">2018_endoh1.tar.bz2</a> - download entry tarball</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="2018_endoh1.tar.bz2">2018_endoh1.tar.bz2</a> - download entry tarball</li>
<li><a href="index.html">index.html</a> - this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/endoh1/README.md">README.md</a> - markdown source for this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/endoh1/.entry.json">.entry.json</a> - description of entry in JSON</li>
+1 -1
View File
@@ -67,7 +67,7 @@
},
{
"file_path" : "2018_endoh2.tar.bz2",
"inventory_order" : 100000,
"inventory_order" : 1415926535,
"OK_to_edit" : false,
"display_as" : "tbz2",
"display_via_github" : false,
+5 -4
View File
@@ -88,6 +88,7 @@
<div class="sidenav">
<a href="../../news.html">IOCCC News</a>
<a href="../../status.html">Contest status</a>
<a href="../../next/index.html">Rules and Guidelines</a>
<a href="../../faq.html#submit">How to enter the IOCCC</a>
<a href="../../faq.html">FAQ</a>
</div>
@@ -141,11 +142,11 @@ Location: <a href="../../location.html#JP">JP</a> - <em>Japan</em></li>
<!-- 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>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<pre><code> make</code></pre>
<h2 id="to-use">To use:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./prog</code></pre>
<pre><code> ./prog</code></pre>
<h2 id="try">Try:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<pre><code> ./try.sh</code></pre>
<p>NOTE: to interrupt the loops send intr (typically ctrl-C).</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>And now for something completely different: A program whose metabolic
@@ -223,10 +224,10 @@ is also used in the opening.</p>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/endoh2/try.sh">try.sh</a> - how to run</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/endoh2/python3.sh">python3.sh</a> - python3 rule script</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/endoh2/python.sh">python.sh</a> - python rule script</li>
<li><a href="2018_endoh2.tar.bz2">2018_endoh2.tar.bz2</a> - download entry tarball</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="2018_endoh2.tar.bz2">2018_endoh2.tar.bz2</a> - download entry tarball</li>
<li><a href="index.html">index.html</a> - this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/endoh2/README.md">README.md</a> - markdown source for this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/endoh2/.entry.json">.entry.json</a> - description of entry in JSON</li>
+1 -1
View File
@@ -131,7 +131,7 @@
},
{
"file_path" : "2018_ferguson.tar.bz2",
"inventory_order" : 100000,
"inventory_order" : 1415926535,
"OK_to_edit" : false,
"display_as" : "tbz2",
"display_via_github" : false,
+40 -39
View File
@@ -88,6 +88,7 @@
<div class="sidenav">
<a href="../../news.html">IOCCC News</a>
<a href="../../status.html">Contest status</a>
<a href="../../next/index.html">Rules and Guidelines</a>
<a href="../../faq.html#submit">How to enter the IOCCC</a>
<a href="../../faq.html">FAQ</a>
</div>
@@ -141,13 +142,13 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- 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>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<pre><code> make</code></pre>
<p>The author provided an alternate version which has a simpler keyboard for the
monkey Eric. See <a href="#alternate-code">Alternate code</a> below.</p>
<h2 id="to-use">To use:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./weasel</code></pre>
<pre><code> ./weasel</code></pre>
<h2 id="try">Try:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh
<pre><code> ./try.sh
# For those who believe in &#39;&quot;intelligent&quot; design&#39; or want to see how easy it is
# to prove evolution is a proven fact:
@@ -167,11 +168,11 @@ make use of some of these.</p>
about this under the <a href="#keyboards">keyboards</a> section, briefly referred to in the
<a href="#what">what it is</a> section.</p>
<h3 id="alternate-build">Alternate build:</h3>
<pre class="&lt;!---sh--&gt;"><code> make alt</code></pre>
<pre><code> make alt</code></pre>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>weasel.alt</code> as you would <code>weasel</code> above.</p>
<h3 id="alternate-try">Alternate try:</h3>
<pre class="&lt;!---sh--&gt;"><code> ./try.alt.sh
<pre><code> ./try.alt.sh
# For those who believe in &#39;&quot;intelligent&quot; design&#39; or want to see how easy it is
# to prove evolution is a proven fact:
@@ -186,7 +187,7 @@ first one, <a href="id.alt.sh">id.alt.sh</a> is terminated early in the try scri
<p>You can reconfigure certain values. These are described by the author in more
detail in the <a href="#constants">S, M and N Constants</a> section. The script above will
make use of some of these.</p>
<pre class="&lt;!---sh--&gt;"><code> ./try.alt.sh</code></pre>
<pre><code> ./try.alt.sh</code></pre>
<p>You can reconfigure certain values. These are described by the author in more
detail in the <a href="#constants">S, M and N Constants</a> section. The script above will
make use of some of these.</p>
@@ -203,7 +204,7 @@ from the phylogenetic tree of life.</p>
<p>If you wish your computer to maintain one branch in the Cretaceous C code era,
while using more Cenozoic minded code migration, read <a href="rpm.html">rpm.html</a>.</p>
<p>If you find yourself in an evolutionary dead end, try:</p>
<pre class="&lt;!---sh--&gt;"><code> man ./weasel.1</code></pre>
<pre><code> man ./weasel.1</code></pre>
<h2 id="authors-remarks">Author’s remarks:</h2>
<ol start="0" type="1">
<li>Preface</li>
@@ -228,7 +229,7 @@ didn’t want to reveal as much publicly and many people don’t like to read lo
texts. To resolve this I think the best way is referencing the judges’ remarks:
if you want a quick rundown of the entry try what they suggest and view the man
page (it explains all the options and describes the program briefly):</p>
<pre class="&lt;!---sh--&gt;"><code> man ./weasel.man</code></pre>
<pre><code> man ./weasel.man</code></pre>
<p>If that isn’t sufficient <strong>I would recommend reading this section</strong> <em>(and
possibly the next)</em> where I attempt to give a brief explanation of the sections
to make reading it easier and faster. In addition I want to point out a few
@@ -461,14 +462,14 @@ it must be a single parameter which means you’ll need to quote the string if i
has more than one word (that is it contains spaces) or anything else interpreted
specially by your shell e.g. parentheses. For instance if you just want to find
<code>METHINKS</code> you could do one of:</p>
<pre class="&lt;!---sh--&gt;"><code> ./weasel METHINKS
<pre><code> ./weasel METHINKS
./weasel &quot;METHINKS&quot;
./weasel &#39;METHINKS&#39;</code></pre>
<p>If you wanted <code>YOU ARE A MONKEY</code>:</p>
<pre class="&lt;!---sh--&gt;"><code> ./weasel &quot;YOU ARE A MONKEY&quot;
<pre><code> ./weasel &quot;YOU ARE A MONKEY&quot;
./weasel &#39;YOU ARE A MONKEY&#39;</code></pre>
<p>If you do one of:</p>
<pre class="&lt;!---sh--&gt;"><code> ./weasel &quot;METHINKS IT IS A&quot; &quot;MONKEY&quot;
<pre><code> ./weasel &quot;METHINKS IT IS A&quot; &quot;MONKEY&quot;
./weasel METHINKS IT IS A MONKEY</code></pre>
<p>It will search for <code>MONKEY</code> in both cases; in other words it’s the last one.
If the string is too long given the value of <code>S</code> (see<br />
@@ -476,11 +477,11 @@ If the string is too long given the value of <code>S</code> (see<br />
<p>If you actually do want to search for a string starting with a <code>-</code> you must
disable further parsing of options by using the <code>-</code> option itself; for
example if you were to do any of:</p>
<pre class="&lt;!---sh--&gt;"><code> ./weasel -q- -- -test
<pre><code> ./weasel -q- -- -test
./weasel -q- -test
./weasel -q -- -test</code></pre>
<p>The target string will be: <code>-TEST</code>. This means though that here:</p>
<pre class="&lt;!---sh--&gt;"><code> ./weasel -q -- -test -r5</code></pre>
<pre><code> ./weasel -q -- -test -r5</code></pre>
<p>The string to be searched would actually be <code>-r5</code> and the mutation rate
will remain the default because after the <code>-</code> option is seen it will no
longer parse additional options: only target strings if anything left on the
@@ -490,7 +491,7 @@ are equivalent:</p>
<pre><code> -q-\
-q --</code></pre>
<p>As for the caveat I referenced what does the following do?</p>
<pre class="&lt;!---sh--&gt;"><code> ./weasel -qr 5</code></pre>
<pre><code> ./weasel -qr 5</code></pre>
<p>In fact it will set quiet output and set the target string to be ‘5’. So the
mutation rate will be out of range, thus enabling that Easter egg, but it will
likely come to an answer fairly quickly because it’s just a single character. A
@@ -498,7 +499,7 @@ note on the parsing of the <code>-</code> option; if the program is currently pa
<code>argv[N]</code>, for example, and it encounters a <code>--</code> then depending on where
the other options are in the command line it might still parse the options. Thus
you have:</p>
<pre class="&lt;!---sh--&gt;"><code> $ ./weasel -qr-r5
<pre><code> $ ./weasel -qr-r5
quiet output
mutation rate out of range
target &#39;METHINKS IT IS LIKE A WEASEL&#39;
@@ -506,9 +507,9 @@ you have:</p>
Generation 440 Offspring 20: METHINKS IT IS LIKE A WEASEL</code></pre>
<p>Similarly this would set quiet output, then an invalid mutation rate and then a
mutation rate of 5:</p>
<pre class="&lt;!---sh--&gt;"><code> ./weasel --qrr5</code></pre>
<pre><code> ./weasel --qrr5</code></pre>
<p>If you were instead to do one of (for example):</p>
<pre class="&lt;!---sh--&gt;"><code> ./weasel -q -- -r
<pre><code> ./weasel -q -- -r
./weasel -q -q- -r</code></pre>
<p>Then it <em>would</em> set quiet output then see the <code>--</code> (the <code>-</code> option
itself) and then the target string would <em>literally</em> be set to <code>-r</code> because
@@ -536,7 +537,7 @@ monkey mode be disabled? If yes how do we know if monkey mode was specially
requested? There are at least two ways to go about it: I took the monkey safe
(‘fool safe’) method; *if you explicitly request monkey mode you cannot disable
it in the same invocation of <code>weasel</code>!</p>
<pre class="&lt;!---sh--&gt;"><code> $ ./weasel -qr101r5r101r1r test
<pre><code> $ ./weasel -qr101r5r101r1r test
quiet output
mutation rate out of range
mutation rate out of range
@@ -575,7 +576,7 @@ matter</em> because of truncation but I do in any case specifically check for <c
<p>Given that it was a short string it did find the answer relatively quickly, even
in monkey mode.</p>
<p>Another example:</p>
<pre class="&lt;!---sh--&gt;"><code> $ ./weasel -q -r101 test -r5
<pre><code> $ ./weasel -q -r101 test -r5
quiet output
mutation rate out of range
target &#39;test&#39;
@@ -586,7 +587,7 @@ in monkey mode.</p>
the target string and then set a valid mutation rate. This disabled monkey mode
which means that it’ll use the genetic algorithm.</p>
<p>One more example of monkey mode:</p>
<pre class="&lt;!---sh--&gt;"><code> $ ./weasel -q -mr101 test -r5
<pre><code> $ ./weasel -q -mr101 test -r5
quiet output
mutation rate out of range
target &#39;test&#39;
@@ -676,9 +677,9 @@ file and pass each string to the program itself</em>. I’ve included a script
<code>test.sh</code> and a file of sample input <code>test-strings.txt</code> that you can play
with.</p>
<p>Try:</p>
<pre class="&lt;!---sh--&gt;"><code> make test</code></pre>
<pre><code> make test</code></pre>
<p>This will essentially make sure the program is compiled and then do:</p>
<pre class="&lt;!---sh--&gt;"><code> chmod +x test.sh
<pre><code> chmod +x test.sh
./test.sh</code></pre>
<p>The script will first try compiling the program (if necessary) and if it fails
for any reason it will exit; else it will read each line in the file
@@ -689,7 +690,7 @@ string it’ll sleep approximately 2 seconds and then read the next string
processed).</p>
<p>You can pass additional options directly to the script but remember that it
stops when there are no more strings in the file - so if you try:</p>
<pre class="&lt;!---sh--&gt;"><code> ./test.sh -q test</code></pre>
<pre><code> ./test.sh -q test</code></pre>
<p>The final string <code>test</code> won’t be searched for; it will however run the program
in all invocations with quiet output enabled. The following are some notes about
how the shell and the program interact with each other:</p>
@@ -713,7 +714,7 @@ and the fact the program does not accept spaces other than a literal space<br />
program prints an error message and then exits (returning 1). But since the
keyboard doesn’t have <code>'\n'</code> if you were to type a <code>'</code> and send a
<code>'\n'</code> before the closing <code>'</code> you might see something like:</p>
<pre class="&lt;!---sh--&gt;"><code> $ ./weasel &#39;!!
<pre><code> $ ./weasel &#39;!!
&gt; &#39;
&#39;
@@ -737,7 +738,7 @@ rather confusing and hard to read.</p>
as well as some C keywords.</p></li>
<li><p>The way <code>main()</code> is declared is:</p></li>
</ol>
<pre class="&lt;!---c--&gt;"><code> /* Special C main() handler (encapsulation): */
<pre><code> /* Special C main() handler (encapsulation): */
#define r(main) main
r(k main(k a, E **V)) {</code></pre>
<p>It appears to be recursively defined but is it? And is it truly
@@ -813,7 +814,7 @@ won’t spoil; yes this ironically and amusingly means I’ve left a rotten egg
somewhere!).</p>
<p>The Makefile simplifies how to reconfigure this value with the variable
<code>MAX_SIZE</code>:</p>
<pre class="&lt;!---sh--&gt;"><code> make clobber MAX_SIZE=55 all</code></pre>
<pre><code> make clobber MAX_SIZE=55 all</code></pre>
<p>The next macro that can be reconfigured, <code>M</code> (or <code>MAX_ATTEMPTS</code> in the
Makefile), is the maximum attempts before giving up. This was added as another
feature in 2024 but it was not made an alt version because there already is an
@@ -821,7 +822,7 @@ alt version. This macro allows for seeing what happens when reaching the maximum
number attempts without waiting for a very long time.</p>
<p>The Makefile simplifies how to reconfigure this value with the variable
<code>MAX_ATTEMPTS</code>:</p>
<pre class="&lt;!---sh--&gt;"><code> make clobber MAX_ATTEMPTS=100 all</code></pre>
<pre><code> make clobber MAX_ATTEMPTS=100 all</code></pre>
<p>The final macro, <code>N</code> (or <code>OFFSPRING</code> in the Makefile), is the number of offspring
per generation.</p>
<p>Anything less than 4 will be set to 3 (that’s not a typo!) and this is part of
@@ -831,23 +832,23 @@ both individually and together the program will use varying amounts of memory
and the larger the values the more memory it’ll require.</p>
<p>The Makefile simplifies how to reconfigure this value with the variable
<code>OFFSPRING</code>:</p>
<pre class="&lt;!---sh--&gt;"><code> make clobber OFFSPRING=55 all</code></pre>
<pre><code> make clobber OFFSPRING=55 all</code></pre>
<h3 id="compilation"><a name="compiling">Compilation</a></h3>
<p>Skip to <a href="#portability">Portability</a>.</p>
<p>The following options <strong>must always be passed to the compiler:</strong></p>
<pre class="&lt;!---sh--&gt;"><code> -DQ=&#39;typedef&#39; -D&#39;g(o)&#39;=&#39;goto o;&#39; -D&#39;w(x)&#39;=&quot;x:&quot; -D&#39;H(main)&#39;=&#39;r(main)&#39;</code></pre>
<pre><code> -DQ=&#39;typedef&#39; -D&#39;g(o)&#39;=&#39;goto o;&#39; -D&#39;w(x)&#39;=&quot;x:&quot; -D&#39;H(main)&#39;=&#39;r(main)&#39;</code></pre>
<p>which running <code>make</code> will always do.</p>
<p>If you want to increase the number of offspring to <code>50</code> (<code>N</code>) and the size of the
chromosome to <code>75</code> (<code>S</code>) you would do:</p>
<pre class="&lt;!---sh--&gt;"><code> make clobber OFFSPRING=50 MAX_SIZE=75 everything</code></pre>
<pre><code> make clobber OFFSPRING=50 MAX_SIZE=75 everything</code></pre>
<p>If you wanted to change <code>N</code> to <code>3</code>:</p>
<pre class="&lt;!---sh--&gt;"><code> make clobber OFFSPRING=3 everything</code></pre>
<pre><code> make clobber OFFSPRING=3 everything</code></pre>
<p>Remember that it cannot be less than <code>3</code>; <em>more correctly if it’s less than
4 it’s redefined to 3</em> so you could have passed in <code>-DN=2</code> (or <code>MAX_SIZE=2</code>) and have the same
result. Remember too that <code>S</code> (<code>MAX_SIZE</code>) cannot be less than <code>38</code>. Both <code>S</code> and
<code>N</code> are capped at <code>SIZE_MAX - 1</code> or whatever <code>M</code> (<code>MAX_ATTEMPTS</code>) is set to.</p>
<p>If you wanted to change the maximum number attempts to 100 you could do:</p>
<pre class="&lt;!---sh--&gt;"><code> make clobber MAX_ATTEMPTS=100 everything</code></pre>
<pre><code> make clobber MAX_ATTEMPTS=100 everything</code></pre>
<h3 id="portability"><a name="portability">Portability</a></h3>
<p>Skip to <a href="#bugs">An aside on bugs</a>.</p>
<p>This entry requires at least C99 even if you translate digraphs. The program
@@ -857,7 +858,7 @@ smaller and this I believe includes <code>SIZE_MAX</code>). I don’t think Wind
ports would have many issues (if any) either but I have no way to test this.
Originally I tested it on the below systems.</p>
<h4 id="fedora-26">Fedora 26:</h4>
<pre class="&lt;!---sh--&gt;"><code> $ clang --version|head -n1
<pre><code> $ clang --version|head -n1
clang version 4.0.1 (tags/RELEASE_401/final)
$ gcc --version|head -n1
gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2)
@@ -866,7 +867,7 @@ Originally I tested it on the below systems.</p>
$ lscpu |grep Endian
Byte Order: Little Endian</code></pre>
<h4 id="centos-linux-release-7.4.1708-core">CentOS Linux release 7.4.1708 (Core)</h4>
<pre class="&lt;!---sh--&gt;"><code> $ clang --version|head -n1
<pre><code> $ clang --version|head -n1
clang version 3.4.2 (tags/RELEASE_34/dot2-final)
$ gcc --version|head -n1
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
@@ -875,7 +876,7 @@ Originally I tested it on the below systems.</p>
$ lscpu |grep Endian
Byte Order: Little Endian</code></pre>
<h4 id="fedora-27">Fedora 27:</h4>
<pre class="&lt;!---sh--&gt;"><code> $ clang --version|head -n1
<pre><code> $ clang --version|head -n1
clang version 5.0.1 (tags/RELEASE_501/final)
$ gcc --version|head -n1
gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
@@ -886,7 +887,7 @@ Originally I tested it on the below systems.</p>
<h4 id="macos">macOS:</h4>
<p>System Version: macOS 10.13.4 (17E199)
Kernel Version: Darwin 17.5.0</p>
<pre class="&lt;!---sh--&gt;"><code> $ gcc -v
<pre><code> $ gcc -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.1)
Target: x86_64-apple-darwin17.5.0
@@ -1012,7 +1013,7 @@ When we found others were actually trying to programs with A, we quickly added
additional cryptic features and evolved into B, BCPL, and finally C. We stopped
when we got a clean compile on the following syntax:</p>
</blockquote>
<pre class="&lt;!---c--&gt;"><code> for(;P(&quot;\n&quot;),R=;P(&quot;|&quot;))for(e=C;e=P(&quot;_&quot;+(*u++/
<pre><code> for(;P(&quot;\n&quot;),R=;P(&quot;|&quot;))for(e=C;e=P(&quot;_&quot;+(*u++/
8)%2))P(&quot;|&quot;+(*u/4)%2);</code></pre>
<blockquote>
<p>“To think that modern programmers would try to use a language that allowed
@@ -1054,7 +1055,7 @@ person to talk about it with is more than welcome!</em>). Ken suggested that the
is a lack of common sense but since he was part of its creation I don’t think
it’s a bad thing; <strong>on the contrary it makes all of us C programmers even more
talented! :)</strong> I do wonder if he tested that bit of C code though:</p>
<pre class="&lt;!---c--&gt;"><code> for(;P(&quot;\n&quot;),R=;P(&quot;|&quot;))for(e=C;e=P(&quot;_&quot;+(*u++/
<pre><code> for(;P(&quot;\n&quot;),R=;P(&quot;|&quot;))for(e=C;e=P(&quot;_&quot;+(*u++/
8)%2))P(&quot;|&quot;+(*u/4)%2);</code></pre>
<p>How is <code>R=;</code> valid? Since I don’t have the context maybe there is something
I’m missing but either way it’s a funny piece. It could also be for irony itself
@@ -1154,10 +1155,10 @@ email but I’m more likely to respond to mastodon messages.</p>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/ferguson/try.sh">try.sh</a> - how to run</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/ferguson/weasel.1">weasel.1</a> - weasel program man page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/ferguson/weasel.spec">weasel.spec</a> - RPM spec file</li>
<li><a href="2018_ferguson.tar.bz2">2018_ferguson.tar.bz2</a> - download entry tarball</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="2018_ferguson.tar.bz2">2018_ferguson.tar.bz2</a> - download entry tarball</li>
<li><a href="index.html">index.html</a> - this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/ferguson/README.md">README.md</a> - markdown source for this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/ferguson/.entry.json">.entry.json</a> - description of entry in JSON</li>
+1
View File
@@ -83,6 +83,7 @@
<div class="sidenav">
<a href="../../news.html">IOCCC News</a>
<a href="../../status.html">Contest status</a>
<a href="../../next/index.html">Rules and Guidelines</a>
<a href="../../faq.html#submit">How to enter the IOCCC</a>
<a href="../../faq.html">FAQ</a>
</div>
+1 -1
View File
@@ -59,7 +59,7 @@
},
{
"file_path" : "2018_giles.tar.bz2",
"inventory_order" : 100000,
"inventory_order" : 1415926535,
"OK_to_edit" : false,
"display_as" : "tbz2",
"display_via_github" : false,
+5 -4
View File
@@ -88,6 +88,7 @@
<div class="sidenav">
<a href="../../news.html">IOCCC News</a>
<a href="../../status.html">Contest status</a>
<a href="../../next/index.html">Rules and Guidelines</a>
<a href="../../faq.html#submit">How to enter the IOCCC</a>
<a href="../../faq.html">FAQ</a>
</div>
@@ -144,11 +145,11 @@ Location: <a href="../../location.html#AU">AU</a> - <em>Commonwealth of Australi
<p>This entry requires SDL2 to be installed. See <a href="../../faq.html#SDL">FAQ 3.8: How do I compile an
IOCCC entry that requires SDL1 or SDL2?</a> if you don’t have it
installed and don’t know how to do so.</p>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<pre><code> make</code></pre>
<h2 id="to-use">To use:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./prog</code></pre>
<pre><code> ./prog</code></pre>
<h2 id="try">Try:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./prog ioccc.txt
<pre><code> ./prog ioccc.txt
./prog prog.c
@@ -212,10 +213,10 @@ so that they are short and easily confused with each other.</p>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/giles/ioccc.txt">ioccc.txt</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/giles/sand.alt.txt">sand.alt.txt</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/giles/sand.txt">sand.txt</a> - sample input</li>
<li><a href="2018_giles.tar.bz2">2018_giles.tar.bz2</a> - download entry tarball</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="2018_giles.tar.bz2">2018_giles.tar.bz2</a> - download entry tarball</li>
<li><a href="index.html">index.html</a> - this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/giles/README.md">README.md</a> - markdown source for this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/giles/.entry.json">.entry.json</a> - description of entry in JSON</li>
+1 -1
View File
@@ -51,7 +51,7 @@
},
{
"file_path" : "2018_hou.tar.bz2",
"inventory_order" : 100000,
"inventory_order" : 1415926535,
"OK_to_edit" : false,
"display_as" : "tbz2",
"display_via_github" : false,
+5 -4
View File
@@ -88,6 +88,7 @@
<div class="sidenav">
<a href="../../news.html">IOCCC News</a>
<a href="../../status.html">Contest status</a>
<a href="../../next/index.html">Rules and Guidelines</a>
<a href="../../faq.html#submit">How to enter the IOCCC</a>
<a href="../../faq.html">FAQ</a>
</div>
@@ -141,16 +142,16 @@ Location: <a href="../../location.html#CN">CN</a> - <em>People’s Republic of C
<!-- 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>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<pre><code> make</code></pre>
<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#2018_hou">2018 hou bugs</a>.</p>
<h2 id="to-use">To use:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./prog &lt; input.json &gt; output.html</code></pre>
<pre><code> ./prog &lt; input.json &gt; output.html</code></pre>
<p>View <code>output.html</code> in a browser.</p>
<h2 id="try">Try:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<pre><code> ./try.sh</code></pre>
<p>The script will generate a JSON file called <code>ioccc.json</code>, showing it via
<code>tee(1)</code> and then run the program on that. Can you find any problem with the
JSON file? What happens if you try and fix it?</p>
@@ -202,10 +203,10 @@ page is already generated?</p>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/hou/prog.orig.c">prog.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/hou/input.json">input.json</a> - sample JSON data</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/hou/try.sh">try.sh</a> - how to run</li>
<li><a href="2018_hou.tar.bz2">2018_hou.tar.bz2</a> - download entry tarball</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="2018_hou.tar.bz2">2018_hou.tar.bz2</a> - download entry tarball</li>
<li><a href="index.html">index.html</a> - this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/hou/README.md">README.md</a> - markdown source for this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/hou/.entry.json">.entry.json</a> - description of entry in JSON</li>
+1
View File
@@ -86,6 +86,7 @@
<div class="sidenav">
<a href="../news.html">IOCCC News</a>
<a href="../status.html">Contest status</a>
<a href="../next/index.html">Rules and Guidelines</a>
<a href="../faq.html#submit">How to enter the IOCCC</a>
<a href="../faq.html">FAQ</a>
</div>
+1 -1
View File
@@ -35,7 +35,7 @@
},
{
"file_path" : "2018_mills.tar.bz2",
"inventory_order" : 100000,
"inventory_order" : 1415926535,
"OK_to_edit" : false,
"display_as" : "tbz2",
"display_via_github" : false,
+13 -12
View File
@@ -88,6 +88,7 @@
<div class="sidenav">
<a href="../../news.html">IOCCC News</a>
<a href="../../status.html">Contest status</a>
<a href="../../next/index.html">Rules and Guidelines</a>
<a href="../../faq.html#submit">How to enter the IOCCC</a>
<a href="../../faq.html">FAQ</a>
</div>
@@ -141,11 +142,11 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- 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>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<pre><code> make</code></pre>
<p>If you wish to save state so that you can run the program and keep files changed
(for instance you don’t want to compile <code>mullender.c</code> again) you can compile it
like:</p>
<pre class="&lt;!---sh--&gt;"><code> make clobber SAVE=1 all</code></pre>
<pre><code> make clobber SAVE=1 all</code></pre>
<p>Make sure that if you do add a file (including by compiling code) that before
you exit (ctrl-e) you type in <code>sync</code>! Otherwise the file might not exist or it
will be corrupt if it does.</p>
@@ -155,20 +156,20 @@ will be corrupt if it does.</p>
STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2018_mills">2018 mills bugs</a>.</p>
<h2 id="to-use">To use:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./prog</code></pre>
<pre><code> ./prog</code></pre>
<h2 id="try">Try:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./prog</code></pre>
<pre><code> ./prog</code></pre>
<p>At the <code>&gt;boot</code> prompt, type return.</p>
<p>At the <code>:</code> prompt, type <code>rk(0,0)rkunix</code> and wait for it to initialise itself.
Now try typing:</p>
<pre class="&lt;!---sh--&gt;"><code> cat &gt; prog.c
<pre><code> cat &gt; prog.c
main(){ printf(&quot;Hello, world!\n&quot;); }
^D
cc prog.c
a.out</code></pre>
<p>where <code>^D</code> is EOF.</p>
<p>Next try:</p>
<pre class="&lt;!---sh--&gt;"><code> cc mullender.c
<pre><code> cc mullender.c
a.out</code></pre>
<p>… and enjoy the classic <a href="../../1984/mullender/index.html">1984/mullender</a> entry as
it would have been in 1984 with a VAX-11/PDP-11! Once it reaches the end of the
@@ -180,18 +181,18 @@ line, hit enter and see what happens again. When you’re tired of it hit ctrl-c
3636 bytes, which is considerably lighter than the original machine it can replace.</p>
<p>This program can take you back to the start of everything, it is possible to
run v0. Just type:</p>
<pre class="&lt;!---sh--&gt;"><code> ./v0</code></pre>
<pre><code> ./v0</code></pre>
<p>NOTE: To quit v0, press Control-E.</p>
<p>You will be greeted with a familiar prompt of “login”. The username and
password are “dmr” and “dmr”. To make things more familiar you’ll need to
create ‘.’ as it hasn’t been invented yet on this image!</p>
<pre class="&lt;!---sh--&gt;"><code> @ ln dd dmr .</code></pre>
<pre><code> @ ln dd dmr .</code></pre>
<p>An <code>ls</code> will reveal that C hasn’t been invented yet! IOBCC anyone? The
compiler is <code>bc</code>. It produces assembly, which will then need to be assembled
together like <code>ops.s bl.s hello.s bi.s</code> (in that order) to produce a.out!</p>
<p>But wait, we said this was the start of it all! This program can also run a
program that replaces an even larger machine that can run BSD 2.9. To start this,</p>
<pre class="&lt;!---sh--&gt;"><code> ./prog</code></pre>
<pre><code> ./prog</code></pre>
<p>At the <code>&gt;boot</code> prompt, type return.</p>
<p>At the “:” prompt, type <code>rk(0,0)rkunix</code>.</p>
<p>NOTE: To quit prog, press Control-E.</p>
@@ -199,7 +200,7 @@ program that replaces an even larger machine that can run BSD 2.9. To start this
the very first IOCCC entries <a href="../../1984/mullender/index.html">1984/mullender</a>, as
shown earlier.</p>
<p>But wait, there is even more! Try:</p>
<pre class="&lt;!---sh--&gt;"><code> ./v6</code></pre>
<pre><code> ./v6</code></pre>
<p>At the <code>@</code> prompt, type <code>rkunix</code>. You might want to type <code>stty -lcase</code> as
otherwise the output will be in all caps.</p>
<p>NOTE: To quit v6, press Control-E.</p>
@@ -269,7 +270,7 @@ If so, consider a <code>make clean</code> to start from scratch.</p>
root prompt. Most of the commands you are familiar with work here (this was
only a quarter of a century ago – how much could things have changed?).
Let’s try some:</p>
<pre class="&lt;!---sh--&gt;"><code> # ls
<pre><code> # ls
.cshrc .profile boot hkunix mnt tmp
.login 2.9stamp dev lib mullender.c unix
.msgsrc bin etc lost+found rkunix usr
@@ -778,10 +779,10 @@ time…</p>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/mills/prog.c">prog.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/mills/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/mills/prog.orig.c">prog.orig.c</a> - original source</li>
<li><a href="2018_mills.tar.bz2">2018_mills.tar.bz2</a> - download entry tarball</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="2018_mills.tar.bz2">2018_mills.tar.bz2</a> - download entry tarball</li>
<li><a href="index.html">index.html</a> - this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/mills/README.md">README.md</a> - markdown source for this web page</li>
<li><a href="boot.dat">boot.dat</a> - binary support file</li>
+1 -1
View File
@@ -59,7 +59,7 @@
},
{
"file_path" : "2018_poikola.tar.bz2",
"inventory_order" : 100000,
"inventory_order" : 1415926535,
"OK_to_edit" : false,
"display_as" : "tbz2",
"display_via_github" : false,
+7 -6
View File
@@ -88,6 +88,7 @@
<div class="sidenav">
<a href="../../news.html">IOCCC News</a>
<a href="../../status.html">Contest status</a>
<a href="../../next/index.html">Rules and Guidelines</a>
<a href="../../faq.html#submit">How to enter the IOCCC</a>
<a href="../../faq.html">FAQ</a>
</div>
@@ -141,13 +142,13 @@ Location: <a href="../../location.html#FI">FI</a> - <em>Republic of Finland </em
<!-- 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>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<pre><code> make</code></pre>
<h2 id="to-use">To use:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./prog</code></pre>
<pre><code> ./prog</code></pre>
<h2 id="try">Try:</h2>
<p>On a terminal that supports 24 bit color, has black background, and size at
least 125x38, try:</p>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<pre><code> ./try.sh</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>It is said by some students of Astronomy:</p>
<pre><code> Oh, Be A Fine Gal, Kiss Me!
@@ -157,9 +158,9 @@ You might wish, on a star, to better understand the colors being displayed.
And those in the deep south might wish to go north for a better view.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="how-to-build">How to build:</h3>
<pre class="&lt;!---sh--&gt;"><code> cc -o prog -std=gnu11 -O3 prog.c</code></pre>
<pre><code> cc -o prog -std=gnu11 -O3 prog.c</code></pre>
<p>or</p>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<pre><code> make</code></pre>
<h3 id="poster">Poster:</h3>
<p>You can generate an A3 sized poster by <em>make docs</em>. This command creates a pdf
file <em>poikola.pdf</em>.</p>
@@ -278,10 +279,10 @@ text that says:</p>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/poikola/try.sh">try.sh</a> - how to run</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/poikola/poikola.tex">poikola.tex</a> - supplied documentation</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/poikola/prog-doc.c">prog-doc.c</a> - minor change to entry source</li>
<li><a href="2018_poikola.tar.bz2">2018_poikola.tar.bz2</a> - download entry tarball</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="2018_poikola.tar.bz2">2018_poikola.tar.bz2</a> - download entry tarball</li>
<li><a href="index.html">index.html</a> - this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/poikola/README.md">README.md</a> - markdown source for this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/poikola/.entry.json">.entry.json</a> - description of entry in JSON</li>
+1 -1
View File
@@ -75,7 +75,7 @@
},
{
"file_path" : "2018_vokes.tar.bz2",
"inventory_order" : 100000,
"inventory_order" : 1415926535,
"OK_to_edit" : false,
"display_as" : "tbz2",
"display_via_github" : false,
+5 -4
View File
@@ -88,6 +88,7 @@
<div class="sidenav">
<a href="../../news.html">IOCCC News</a>
<a href="../../status.html">Contest status</a>
<a href="../../next/index.html">Rules and Guidelines</a>
<a href="../../faq.html#submit">How to enter the IOCCC</a>
<a href="../../faq.html">FAQ</a>
</div>
@@ -141,15 +142,15 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- 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>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<pre><code> make</code></pre>
<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#2018_vokes">2018 vokes bugs</a>.</p>
<h2 id="to-use">To use:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./prog &lt; file.txt</code></pre>
<pre><code> ./prog &lt; file.txt</code></pre>
<h2 id="try">Try:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<pre><code> ./try.sh</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>What this program does is not witchcraft and there are no spectres, but you
might have a meltdown trying to work it all out (look at the source code to
@@ -336,10 +337,10 @@ this program has nothing to do with a hand.</p></li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/vokes/example-tab.txt">example-tab.txt</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/vokes/ioccc.txt">ioccc.txt</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/vokes/try.sh">try.sh</a> - how to run</li>
<li><a href="2018_vokes.tar.bz2">2018_vokes.tar.bz2</a> - download entry tarball</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="2018_vokes.tar.bz2">2018_vokes.tar.bz2</a> - download entry tarball</li>
<li><a href="index.html">index.html</a> - this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/vokes/README.md">README.md</a> - markdown source for this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/vokes/.entry.json">.entry.json</a> - description of entry in JSON</li>
+1 -1
View File
@@ -51,7 +51,7 @@
},
{
"file_path" : "2018_yang.tar.bz2",
"inventory_order" : 100000,
"inventory_order" : 1415926535,
"OK_to_edit" : false,
"display_as" : "tbz2",
"display_via_github" : false,
+11 -10
View File
@@ -88,6 +88,7 @@
<div class="sidenav">
<a href="../../news.html">IOCCC News</a>
<a href="../../status.html">Contest status</a>
<a href="../../next/index.html">Rules and Guidelines</a>
<a href="../../faq.html#submit">How to enter the IOCCC</a>
<a href="../../faq.html">FAQ</a>
</div>
@@ -141,15 +142,15 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- 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>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<pre><code> make</code></pre>
<h2 id="to-use">To use:</h2>
<p>The author suggested that after compilation one should look at the generated
files. For instance:</p>
<pre class="&lt;!---sh--&gt;"><code> less generated1.c
<pre><code> less generated1.c
less generated2.c
less generated3.c</code></pre>
<h2 id="try">Try:</h2>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<pre><code> ./try.sh</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Code should be readable in any direction! This tool will help you rotate your
code so you don’t have to stare at it sideways or even upside down. Rotating
@@ -164,19 +165,19 @@ reveal messages and one more tool that can be used to reveal the final message
hidden in the original source. All of these can be created using combinations
of <code>./left</code>, <code>./right</code> and <code>./shift</code> and the additionally generated programs.</p>
<p>The final message can be revealed using</p>
<pre class="&lt;!---sh--&gt;"><code> ./msg9 &lt; prog.c</code></pre>
<pre><code> ./msg9 &lt; prog.c</code></pre>
<p>But what combinations will generate <code>./msg3</code>, <code>./msg4</code>, <code>./msg5</code>, <code>./msg6</code>,
<code>./msg7</code>, <code>./msg8</code> and finally <code>./msg9</code>?</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="tools-usage">Tools’ usage:</h3>
<p><code>Nuko</code> is a text rotator: given some text in <code>stdin</code>, <code>Nuko</code> will write the
same text to <code>stdout</code>, but rotated 90 degrees counterclockwise.</p>
<pre class="&lt;!---sh--&gt;"><code> cc prog.c -o left
<pre><code> cc prog.c -o left
./left &lt; input.txt &gt; rotated_counterclockwise.txt</code></pre>
<p>Due to static memory allocation, only the first 1K columns by 1K rows
are rotated, the rest are silently ignored. But fear not, a separate
tool with dynamic memory allocation is included:</p>
<pre class="&lt;!---sh--&gt;"><code> ./left &lt; prog.c &gt; r1.c
<pre><code> ./left &lt; prog.c &gt; r1.c
cc r1.c -o right
./right &lt; input.txt &gt; rotated_clockwise.txt</code></pre>
<p>For variety, this second tool rotates clockwise instead of
@@ -186,12 +187,12 @@ depending on how much memory you have.</p>
rotate counterclockwise once more, we get another program. This
program outputs a single message to <code>stdout</code>, which is the name of the
series that <code>Nuko</code> came from.</p>
<pre class="&lt;!---sh--&gt;"><code> ./left &lt; prog.c | ./left &gt; r2.c
<pre><code> ./left &lt; prog.c | ./left &gt; r2.c
cc r2.c -o msg0
./msg0</code></pre>
<p>There is one final rotation, which produces a tool that removes
leading whitespaces:</p>
<pre class="&lt;!---sh--&gt;"><code> ./left &lt; prog.c | ./left | ./left &gt; r3.c
<pre><code> ./left &lt; prog.c | ./left | ./left &gt; r3.c
cc r3.c -o shift
./shift &lt; input.txt &gt; no_leading_space.txt</code></pre>
<p>Where this might be useful, besides ruining the formatting of certain
@@ -204,7 +205,7 @@ toward one of those notches (and create a new notch on the other
side). This shifted code behaves slightly different from the original
program. For example, here are two more messages that can be
produced:</p>
<pre class="&lt;!---sh--&gt;"><code> ./shift &lt; prog.c | ./right &gt; msg1.c &amp;&amp; gcc msg1.c -o msg1 &amp;&amp; ./msg1
<pre><code> ./shift &lt; prog.c | ./right &gt; msg1.c &amp;&amp; gcc msg1.c -o msg1 &amp;&amp; ./msg1
./shift &lt; prog.c | ./left &gt; msg2.c &amp;&amp; gcc msg2.c -o msg2 &amp;&amp; ./msg2</code></pre>
<p>In total, there are 9 embedded strings that can be produced via a
sequence of rotates and shifts, one of which can be used to extract
@@ -276,10 +277,10 @@ will look weird after rotation, for example.</p>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/yang/prog.orig.c">prog.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/yang/try.sh">try.sh</a> - how to run</li>
<li><a href="spoiler.html">spoiler.html</a> - SPOILER WARNING</li>
<li><a href="2018_yang.tar.bz2">2018_yang.tar.bz2</a> - download entry tarball</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="2018_yang.tar.bz2">2018_yang.tar.bz2</a> - download entry tarball</li>
<li><a href="index.html">index.html</a> - this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/yang/README.md">README.md</a> - markdown source for this web page</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/yang/.entry.json">.entry.json</a> - description of entry in JSON</li>