force use of pandoc version >= 3.1.12.2

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

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

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

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

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

No files matched your search

+57 -113
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Michael_Birken">Michael
Birken</a><br> Location: <a href="../../location.html#US">US</a> -
<em>United States of America</em> (<em>United States</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Michael_Birken">Michael Birken</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -144,8 +144,7 @@ Birken</a><br> Location: <a href="../../location.html#US">US</a> -
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code>STATUS: uses gets() - change to fgets() if possible</code></pre>
<p>For more detailed information see <a
href="../../bugs.html#2006_birken">2006 birken bugs</a>.</p>
<p>For more detailed information see <a href="../../bugs.html#2006_birken">2006 birken 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">./birken</span> <span class="op">&lt;</span> file.tofu</span></code></pre></div>
<h2 id="try">Try:</h2>
@@ -153,132 +152,77 @@ href="../../bugs.html#2006_birken">2006 birken bugs</a>.</p>
<p>etc.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Q: EDAMAME?</p>
<p>A: Electronic Design Automation - Mechanical Abstract Machine
Emulator</p>
<p>What is TOFU? It’s not a veggie friendly food, nor it is <a
href="https://en.wikipedia.org/wiki/Verilog">Verilog</a> or <a
href="https://en.wikipedia.org/wiki/VHDL">VHDL</a> It is not even <a
href="https://en.wikipedia.org/wiki/Pascal_(programming_language)">Pascal</a>!</p>
<p>NOTE: On some systems, <code>file(1)</code> claims one of the
<code>.tofu</code> files is Pascal source. :-)</p>
<p>It may not be the most readable hardware description language, but it
is one of the easiest 55 page long manuals to learn. :-)</p>
<p>For a small but non-trivial design, try implementing a <a
href="http://en.wikipedia.org/wiki/LFSR">Linear Feedback Shift
Register</a></p>
<p>And for those who are still confused, see <a
href="http://en.wikipedia.org/wiki/Edamame"
class="uri">http://en.wikipedia.org/wiki/Edamame</a> and <a
href="http://en.wikipedia.org/wiki/Tofu"
class="uri">http://en.wikipedia.org/wiki/Tofu</a>.</p>
<p>A: Electronic Design Automation - Mechanical Abstract Machine Emulator</p>
<p>What is TOFU? It’s not a veggie friendly food, nor it is
<a href="https://en.wikipedia.org/wiki/Verilog">Verilog</a> or
<a href="https://en.wikipedia.org/wiki/VHDL">VHDL</a> It is not even
<a href="https://en.wikipedia.org/wiki/Pascal_(programming_language)">Pascal</a>!</p>
<p>NOTE: On some systems, <code>file(1)</code> claims one of the <code>.tofu</code> files is Pascal
source. :-)</p>
<p>It may not be the most readable hardware description language, but it is
one of the easiest 55 page long manuals to learn. :-)</p>
<p>For a small but non-trivial design, try implementing a
<a href="http://en.wikipedia.org/wiki/LFSR">Linear Feedback Shift Register</a></p>
<p>And for those who are still confused, see <a href="http://en.wikipedia.org/wiki/Edamame" class="uri">http://en.wikipedia.org/wiki/Edamame</a>
and <a href="http://en.wikipedia.org/wiki/Tofu" class="uri">http://en.wikipedia.org/wiki/Tofu</a>.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>If man is capable of creating <a
href="http://en.wikipedia.org/wiki/Tofu">tofu</a> <a
href="https://en.wikipedia.org/wiki/Hot_dog">hot dogs</a> (simulated
meat), then why not tofu <a
href="https://en.wikipedia.org/wiki/Electronic_circuit">circuitry</a>
(simulated circuits)? This program is my tribute to the early computer
pioneers like <a href="https://en.wikipedia.org/wiki/Konrad_Zuse">Konrad
Zuse</a>. It’s an educational tool designed to introduce students to
digital circuit theory using technology that was considered state of the
art in the 1940s! To enable you to fully understand the capabilities of
this circuit simulator, I have included a 55 page manual (<a
href="info.pdf">info.pdf</a>) in the info portion of the entry
submission.</p>
<p>If man is capable of creating <a href="http://en.wikipedia.org/wiki/Tofu">tofu</a> <a href="https://en.wikipedia.org/wiki/Hot_dog">hot
dogs</a> (simulated meat), then why not tofu
<a href="https://en.wikipedia.org/wiki/Electronic_circuit">circuitry</a> (simulated
circuits)? This program is my tribute to the early computer pioneers like
<a href="https://en.wikipedia.org/wiki/Konrad_Zuse">Konrad Zuse</a>. It’s an educational
tool designed to introduce students to digital circuit theory using technology
that was considered state of the art in the 1940s! To enable you to fully
understand the capabilities of this circuit simulator, I have included a 55 page
manual (<a href="info.pdf">info.pdf</a>) in the info portion of the entry submission.</p>
<p>The primary obfuscation is the data structure chosen for parsing the
input file and for executing the simulation. Oh man… coding that data
structure gave me such a bad headache. But, I figure, who needs more
than a pair anyway? Subtle obfuscations abound. Bonus points go out to
the one who discovers the hidden program within the source.</p>
input file and for executing the simulation. Oh man… coding that
data structure gave me such a bad headache. But, I figure, who needs
more than a pair anyway? Subtle obfuscations abound. Bonus points go
out to the one who discovers the hidden program within the source.</p>
<p>Note that the shape of the source is a wave, not a waveform.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-2006birken"><a name="inventory"></a>Inventory for
2006/birken</h1>
<h1 id="inventory-for-2006birken"><a name="inventory"></a>Inventory for 2006/birken</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/2006/birken/birken.c">birken.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/birken.orig.c">birken.orig.c</a>
- original source</li>
<li><a href="info.pdf">info.pdf</a> - about the TOFO circuit
simulator</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/try.sh">try.sh</a>
- how to run</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/adder.tofu">adder.tofu</a>
- TOFU circuit</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/buffer.tofu">buffer.tofu</a>
- TOFU circuit</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/computer.tofu">computer.tofu</a>
- TOFU circuit</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/counter.tofu">counter.tofu</a>
- TOFU circuit</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/divider.tofu">divider.tofu</a>
- TOFU circuit</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/lfsr.tofu">lfsr.tofu</a>
- TOFU circuit</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/memory.tofu">memory.tofu</a>
- TOFU circuit</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/multiplier.tofu">multiplier.tofu</a>
- TOFU circuit</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/multiplier2.tofu">multiplier2.tofu</a>
- TOFU circuit</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/oneline.tofu">oneline.tofu</a>
- TOFU circuit</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/shift.tofu">shift.tofu</a>
- TOFU circuit</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/zuse.tofu">zuse.tofu</a>
- TOFU circuit</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/zuse2.tofu">zuse2.tofu</a>
- TOFU circuit</li>
<li><a href="2006_birken.tar.bz2">2006_birken.tar.bz2</a> - download
entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/birken.c">birken.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/birken.orig.c">birken.orig.c</a> - original source</li>
<li><a href="info.pdf">info.pdf</a> - about the TOFO circuit simulator</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/try.sh">try.sh</a> - how to run</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/adder.tofu">adder.tofu</a> - TOFU circuit</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/buffer.tofu">buffer.tofu</a> - TOFU circuit</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/computer.tofu">computer.tofu</a> - TOFU circuit</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/counter.tofu">counter.tofu</a> - TOFU circuit</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/divider.tofu">divider.tofu</a> - TOFU circuit</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/lfsr.tofu">lfsr.tofu</a> - TOFU circuit</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/memory.tofu">memory.tofu</a> - TOFU circuit</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/multiplier.tofu">multiplier.tofu</a> - TOFU circuit</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/multiplier2.tofu">multiplier2.tofu</a> - TOFU circuit</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/oneline.tofu">oneline.tofu</a> - TOFU circuit</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/shift.tofu">shift.tofu</a> - TOFU circuit</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/zuse.tofu">zuse.tofu</a> - TOFU circuit</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/zuse2.tofu">zuse2.tofu</a> - TOFU circuit</li>
<li><a href="2006_birken.tar.bz2">2006_birken.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+49 -72
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Szabolcs_Borsanyi">Szabolcs
Borsanyi</a><br> Location: <a href="../../location.html#DE">DE</a> -
<em>Federal Republic of Germany</em> (<em>Germany</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Szabolcs_Borsanyi">Szabolcs Borsanyi</a><br>
Location: <a href="../../location.html#DE">DE</a> - <em>Federal Republic of Germany</em> (<em>Germany</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -144,40 +144,35 @@ Borsanyi</a><br> Location: <a href="../../location.html#DE">DE</a> -
<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#2006_borsanyi">2006 borsanyi bugs</a>.</p>
<p>For more detailed information see <a href="../../bugs.html#2006_borsanyi">2006 borsanyi 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">./borsanyi</span> string <span class="op">&gt;</span> file.gif</span></code></pre></div>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<p>We recommend you input for the filename <code>example.gif</code> and
for the string <code>ioccc@example.com</code>. The script will not
overwrite files. It runs the program in a loop until you answer that you
do not wish to make another.</p>
<p>We recommend you input for the filename <code>example.gif</code> and for the string
<code>ioccc@example.com</code>. The script will not overwrite files. It runs the program in
a loop until you answer that you do not wish to make another.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This entry uses a very user-friendly representation of the font it
uses (with a few exceptions). Check out the source and see yourself!
:-)</p>
<p>This entry uses a very user-friendly representation of the font
it uses (with a few exceptions). Check out the source and see
yourself! :-)</p>
<p>The resulting GIF file is likely to puzzle optical character
recognition tools. The amount of imagination necessary to recognise the
<code>@</code> character will certainly challenge a few anti-CAPTCHA
tools.</p>
recognition tools. The amount of imagination necessary to
recognise the <code>@</code> character will certainly challenge a few
anti-CAPTCHA tools.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="email-address-to-gif-converter">Email address to gif
converter</h3>
<h3 id="email-address-to-gif-converter">Email address to gif converter</h3>
<h3 id="introduction">Introduction:</h3>
<p>Most spam robots collect email addresses from the web sites of
innocent people, like you. Conference organizers cannot disclose the
participant’s address to prevent malicious users from grabbing them. One
solution is to write as <code>my_email _at_ address _dot_ com</code>.
But robots are clever enough to sort that out. A more sophisticated
approach is to create an image file with the email address and put that
on the web page.</p>
<p>This program creates a GIF image file from the address given in the
command line. To avoid complications with patent issues the <a
href="https://en.wikipedia.org/wiki/Lempel-Ziv-Welch">LZW
compression</a> feature is not used. A typical email address is stored
in less than 1-2 kilobytes.</p>
innocent people, like you. Conference organizers cannot disclose
the participant’s address to prevent malicious users from
grabbing them. One solution is to write as <code>my_email _at_ address _dot_ com</code>. But robots are clever enough to sort that out. A
more sophisticated approach is to create an image file with the
email address and put that on the web page.</p>
<p>This program creates a GIF image file from the address given in the command
line. To avoid complications with patent issues the <a href="https://en.wikipedia.org/wiki/Lempel-Ziv-Welch">LZW
compression</a> feature is not
used. A typical email address is stored in less than 1-2 kilobytes.</p>
<h3 id="usage">Usage:</h3>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> all</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./borsanyi</span> my@example.com <span class="op">&gt;</span> email.gif</span>
@@ -186,12 +181,13 @@ in less than 1-2 kilobytes.</p>
the characters: <code>a-z_A-Z0-9@.-</code>.</p>
<p>The program is (like email addresses are) case insensitive.</p>
<h3 id="obfuscation">Obfuscation:</h3>
<p>Multicore support is a must in present-day applications. This entry
supports up to 25 cores. The odd names in the bottom part of the program
do have a meaning, they are not there just for obfuscation. The
preprocessor is used to keep the program small, in fact, everything is a
macro. Are you familiar with the GIF format? Studying this program will
give you a (very) little insight.</p>
<p>Multicore support is a must in present-day applications. This
entry supports up to 25 cores. The odd names in the bottom
part of the program do have a meaning, they are not there just
for obfuscation. The preprocessor is used to keep the program
small, in fact, everything is a macro. Are you familiar with
the GIF format? Studying this program will give you a (very)
little insight.</p>
<h3 id="questions">Questions:</h3>
<p>After analyzing the source code, try to answer these questions:</p>
<ol type="1">
@@ -200,61 +196,42 @@ give you a (very) little insight.</p>
<li>What limits the number of input characters to 42?</li>
</ol>
<h3 id="portability">Portability:</h3>
<p>The program uses POSIX threads (using the linker flag
<code>-lpthread</code>). The program accepts email addresses not longer
than 42 bytes composed from letters, digits, and the <code>@._-</code>
symbols. An address not obeying these rules will cause undefined
behaviour. The program is not expected to depend on endianness. The
standard output is used for a binary output, which might cause problems.
<p>The program uses POSIX threads (using the linker flag <code>-lpthread</code>).
The program accepts email addresses not longer than 42 bytes
composed from letters, digits, and the <code>@._-</code> symbols. An address
not obeying these rules will cause undefined behaviour. The
program is not expected to depend on endianness. The standard
output is used for a binary output, which might cause problems.
To avoid most caveats, the program does not output the octet
<code>0x0a</code>. The program assumes the use of ASCII.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-2006borsanyi"><a name="inventory"></a>Inventory
for 2006/borsanyi</h1>
<h1 id="inventory-for-2006borsanyi"><a name="inventory"></a>Inventory for 2006/borsanyi</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/2006/borsanyi/borsanyi.c">borsanyi.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/borsanyi/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/borsanyi/borsanyi.orig.c">borsanyi.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/borsanyi/try.sh">try.sh</a>
- how to run</li>
<li><a href="2006_borsanyi.tar.bz2">2006_borsanyi.tar.bz2</a> - download
entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/borsanyi/borsanyi.c">borsanyi.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/borsanyi/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/borsanyi/borsanyi.orig.c">borsanyi.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/borsanyi/try.sh">try.sh</a> - how to run</li>
<li><a href="2006_borsanyi.tar.bz2">2006_borsanyi.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/borsanyi/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/borsanyi/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/borsanyi/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/borsanyi/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/borsanyi/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/borsanyi/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+63 -102
View File
@@ -130,8 +130,8 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Aaron_Grothe">Aaron Grothe</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of
America</em> (<em>United States</em>) <br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -146,149 +146,110 @@ America</em> (<em>United States</em>) <br><br></li>
<h2 id="try">Try:</h2>
<p>Put on your “electronic ears” and then try:</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<p>You may find using a tunable scanning electronic ear helps.</p>
<p>You may find using
a tunable scanning electronic ear helps.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Most of the time, interference is annoying. This entry is the
exception that proves the rule. What is a bug to some is a feature to
this entry. :-)</p>
exception that proves the rule. What is a bug to some is a
feature to this entry. :-)</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>The program draws patterns on the screen that can be picked up by a
<a href="https://en.wikipedia.org/wiki/Shortwave_radio">shortwave
radio</a>. It emulates the frequencies for an old fashion touch tone
phone, so old songs can be played by hitting
<code>0-9</code>,<code>#</code>, and <code>*</code>.</p>
<a href="https://en.wikipedia.org/wiki/Shortwave_radio">shortwave radio</a>. It emulates
the frequencies for an old fashion touch tone phone, so old songs can be played
by hitting <code>0-9</code>,<code>#</code>, and <code>*</code>.</p>
<p>To be able to run the program you need to determine the following
parameters:</p>
<pre><code>carrier_freq - base frequency used to host music
pixelclock - refresh rate of the monitor
horizontal_total - total scan along the horizontal axis</code></pre>
<p>If you have <code>xvidtune</code> installed you can get the
<code>pixelclock</code> and <code>horizontal_total</code> with the
following command</p>
<p>If you have <code>xvidtune</code> installed you can get the <code>pixelclock</code> and
<code>horizontal_total</code> with the following command</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">xvidtune</span> <span class="at">-show</span> <span class="kw">|</span> <span class="fu">head</span> <span class="at">-n</span> 1 <span class="kw">|</span> <span class="fu">awk</span> <span class="st">&#39;{ print &quot;pixelclock &quot; $2 * 1000000 &quot; horizontal_total = &quot; $6 }&#39;</span></span></code></pre></div>
<p>Example from my laptops:</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">./grothe</span> 65000000 10000000 1344 <span class="op">&lt;</span> twinkle.txt</span></code></pre></div>
<p>Even if the user gets a setting off, the sound will usually be able
to be heard on <a
href="https://en.wikipedia.org/wiki/AM_broadcasting">AM</a> at a
multiple of the original frequency.</p>
<p>The core idea of using a machine to play music on AM radio goes all
the way back to the <a
href="https://en.wikipedia.org/wiki/Altair_8800">Altair computers</a>
and <a href="https://en.wikipedia.org/wiki/ZX81">Timex Sinclair
ZX-81</a>s.</p>
<p>Even if the user gets a setting off, the sound will usually be able to be
heard on <a href="https://en.wikipedia.org/wiki/AM_broadcasting">AM</a> at a multiple of
the original frequency.</p>
<p>The core idea of using a machine to play music on AM radio goes all the
way back to the <a href="https://en.wikipedia.org/wiki/Altair_8800">Altair computers</a>
and <a href="https://en.wikipedia.org/wiki/ZX81">Timex Sinclair ZX-81</a>s.</p>
<h3 id="several-example-songs">Several example songs</h3>
<p>Olympics Fanfare - from <code>antang@phakt.usc.edu</code> - Tony:</p>
<pre><code>4-9-91231,2222-321123123-9-91231,2222-32112321</code></pre>
<p>Twinkle Twinkle Little Star - from <code>fsufunkyb@aol.com</code> -
Ben Schmidt:</p>
<p>Twinkle Twinkle Little Star - from <code>fsufunkyb@aol.com</code> - Ben Schmidt:</p>
<pre><code>1199##9-6633221-9966332-9966332-1199#9-6633221-</code></pre>
<p>Generic Arabian Tune - from <code>rdippold@qualcomm.com</code> - Ron
“Asbestos” Dippold:</p>
<p>Generic Arabian Tune - from <code>rdippold@qualcomm.com</code> - Ron “Asbestos” Dippold:</p>
<pre><code>453,54,4569564459,9#95458,8987453 54</code></pre>
<p>Others can be found by doing a search for “touch tone phone
songs”.</p>
<p>Others can be found by doing a search for “touch tone phone songs”.</p>
<h3 id="obfuscations">Obfuscations</h3>
<ul>
<li><p>Some numbers expressed in Octal, some in hex and some in decimal:
“A foolish consistency is the hobgoblin of little minds” - Ralph Waldo
Emerson.</p></li>
<li><p>Funky scoping, looking at the nanosleep section and
<code>XsetWindowAttributes</code> declares local variables.</p></li>
<li><p>Algorithm is very weird, uses <code>y</code> dimension to draw
carrier frequency and <code>x</code> dimension to draw audio frequency,
based on <a href="http://www.erikyyy.de">Erik Thiele</a>’s <a
href="http://www.erikyyy.de/tempest/">Tempest for Eliza</a>.</p></li>
<li><p>Funky scoping, looking at the nanosleep section and <code>XsetWindowAttributes</code>
declares local variables.</p></li>
<li><p>Algorithm is very weird, uses <code>y</code> dimension to draw carrier frequency
and <code>x</code> dimension to draw audio frequency, based on <a href="http://www.erikyyy.de">Erik
Thiele</a>’s
<a href="http://www.erikyyy.de/tempest/">Tempest for Eliza</a>.</p></li>
<li><p>lack of <code>#define</code>s confuses many people :-)</p></li>
<li><p>figuring out your <code>pixelclock</code> and
<code>horizontal_total</code> and which <code>carrier_freq</code> to use
can be an exercise in obfuscation for the user.</p></li>
<li><p>figuring out your <code>pixelclock</code> and <code>horizontal_total</code> and which <code>carrier_freq</code>
to use can be an exercise in obfuscation for the user.</p></li>
<li><p>use of commas in various places, confuses most C code beautifiers
sometimes making the beautified code harder to read</p></li>
<li><p>use of <code>static</code> to ensure initialization is EVIL and
done in several places</p></li>
<li><p>uses <code>static</code> declarations &amp; <code>void</code>
function returns we don’t care about making the code harder to
read.</p></li>
<li><p>does sound using only <a
href="https://en.wikipedia.org/wiki/Xlib">X11 libs</a>, no other libs
required.</p></li>
<li><p>use of <code>static</code> to ensure initialization is EVIL and done in several
places</p></li>
<li><p>uses <code>static</code> declarations &amp; <code>void</code> function returns we don’t care about
making the code harder to read.</p></li>
<li><p>does sound using only <a href="https://en.wikipedia.org/wiki/Xlib">X11 libs</a>, no other
libs required.</p></li>
<li><p>demonstrates tempest emissions in a fun/easy way.</p></li>
<li><p>follows good programming practices of actually setting exit codes
and giving usage when run with incorrect parameters.</p></li>
<li><p>follows good programming practices of actually setting exit codes and giving
usage when run with incorrect parameters.</p></li>
</ul>
<h3 id="references">References</h3>
<p><a href="http://www.erikyyy.de/tempest/">Tempest for Eliza - Basis
for Algorithms</a>.</p>
<p><a
href="https://web.archive.org/web/20070612152538if_/http://silcnet.org/priikone/programs/tempest-AM-1.0.tar.gz">Tempest
AM</a> - Another early program in this field. See <a
href="https://web.archive.org/web/20070612152538/http://silcnet.org/priikone/programs.php?lang=en">here</a>
for a bit more information on the program (search for
<code>Tempest-AM Radio Signal Transmitter</code>).</p>
<p>The paper <a
href="https://www.cl.cam.ac.uk/~mgk25/ih98-tempest.pdf">Soft Tempest:
Hidden Data Transmission Using Electromagnetic Emanations</a> by Markus
G. Kuhn’s and Ross J. Anderson’s.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<p><a href="http://www.erikyyy.de/tempest/">Tempest for Eliza - Basis for Algorithms</a>.</p>
<p><a href="https://web.archive.org/web/20070612152538if_/http://silcnet.org/priikone/programs/tempest-AM-1.0.tar.gz">Tempest
AM</a>
- Another early program in this field. See
<a href="https://web.archive.org/web/20070612152538/http://silcnet.org/priikone/programs.php?lang=en">here</a>
for a bit more information on the program (search for <code>Tempest-AM Radio Signal Transmitter</code>).</p>
<p>The paper
<a href="https://www.cl.cam.ac.uk/~mgk25/ih98-tempest.pdf">Soft Tempest: Hidden Data Transmission Using Electromagnetic
Emanations</a> by Markus G.
Kuhn’s and Ross J. Anderson’s.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-2006grothe"><a name="inventory"></a>Inventory for
2006/grothe</h1>
<h1 id="inventory-for-2006grothe"><a name="inventory"></a>Inventory for 2006/grothe</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/2006/grothe/grothe.c">grothe.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/grothe.orig.c">grothe.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/arabian.txt">arabian.txt</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/olympics.txt">olympics.txt</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/test.txt">test.txt</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/try.sh">try.sh</a>
- how to run</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/twinkle.txt">twinkle.txt</a>
- sample input</li>
<li><a href="2006_grothe.tar.bz2">2006_grothe.tar.bz2</a> - download
entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/grothe.c">grothe.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/grothe.orig.c">grothe.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/arabian.txt">arabian.txt</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/olympics.txt">olympics.txt</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/test.txt">test.txt</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/try.sh">try.sh</a> - how to run</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/twinkle.txt">twinkle.txt</a> - sample input</li>
<li><a href="2006_grothe.tar.bz2">2006_grothe.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+36 -57
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Steinar_Hamre">Steinar
Hamre</a><br> Location: <a href="../../location.html#NO">NO</a> -
<em>Kingdom of Norway</em> (<em>Norway</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Steinar_Hamre">Steinar Hamre</a><br>
Location: <a href="../../location.html#NO">NO</a> - <em>Kingdom of Norway</em> (<em>Norway</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -147,88 +147,67 @@ Hamre</a><br> Location: <a href="../../location.html#NO">NO</a> -
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>An irrationally coded source presents rational things!</p>
<p>A rational person might want to attempt the <a
href="https://rationalwiki.org/wiki/Rationality">irrational</a> task of
supporting a new operator by way of an existing macro in the source. And
can you determine which macro this is and understand the purpose of its
arguments?</p>
<p>A rational person might want to attempt the
<a href="https://rationalwiki.org/wiki/Rationality">irrational</a> task
of supporting a new operator by way of an existing macro
in the source. And can you determine which macro this is
and understand the purpose of its arguments?</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This is a calculator for <a
href="https://en.wikipedia.org/wiki/Rational_number">rational
numbers</a>. Believe it or not, that is a useful tool to have around,
and I haven’t found a useful version, much less an obfuscated one.</p>
<p>This is a calculator for <a href="https://en.wikipedia.org/wiki/Rational_number">rational
numbers</a>. Believe it or not, that
is a useful tool to have around, and I haven’t found a useful version, much less
an obfuscated one.</p>
<p>It is rather feature complete as rational calculators go. The
supported operators are: <code>+</code>, <code>-</code> (binary and
unary), <code>*</code>, <code>/</code> and <code>()</code>. Run it by
supplying an expression as the first argument, and the normalized result
will be written to <code>stdout</code>.</p>
supported operators are: <code>+</code>, <code>-</code> (binary and unary), <code>*</code>, <code>/</code> and <code>()</code>. Run it
by supplying an expression as the first argument, and the normalized
result will be written to <code>stdout</code>.</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./hamre</span> <span class="st">&#39;-1+4/3*(2+1/(3/2*(7/2-7/3+1/6)))/2&#39;</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="ex">2/3</span></span></code></pre></div>
<p>If you do not supply an argument, the calculator will crash. Other
arguments are ignored. Supplying more arguments may further limit the
number of nested operators supported.</p>
<p>Remember that <code>1/0</code> is not a rational number. You will not
get any answer if you divide by zero.</p>
<p>Remember that <code>1/0</code> is not a rational number. You will not get any
answer if you divide by zero.</p>
<p>By default, only 31 nested levels of operators are supported.</p>
<p>The code is well documented, even with an example. In fact this
documentation accounts for 100% of the source. Personally I find
preprocessing or re-indenting the program counterproductive when it
comes to understanding the source. The preprocessed source becomes
rather verbose.</p>
<p>IOCCC entries are often loaded with all kinds of hard-coded numbers.
I have restricted myself to mostly use sensible numbers
(<code>&lt;= 7</code>) as smaller numbers are much easier to remember.
Also the macros really help hide most of the uses of these numbers away.
All macros and variables are easy-to-remember single character
abbreviations, from some language, meaningful to the purpose(s) of the
macro, I hope.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<p>IOCCC entries are often loaded with all kinds of hard-coded numbers. I
have restricted myself to mostly use sensible numbers (<code>&lt;= 7</code>) as
smaller numbers are much easier to remember. Also the macros really
help hide most of the uses of these numbers away. All macros and
variables are easy-to-remember single character abbreviations, from
some language, meaningful to the purpose(s) of the macro, I hope.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-2006hamre"><a name="inventory"></a>Inventory for
2006/hamre</h1>
<h1 id="inventory-for-2006hamre"><a name="inventory"></a>Inventory for 2006/hamre</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/2006/hamre/hamre.c">hamre.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/hamre/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/hamre/hamre.orig.c">hamre.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/hamre/try.sh">try.sh</a>
- how to run</li>
<li><a href="2006_hamre.tar.bz2">2006_hamre.tar.bz2</a> - download entry
source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/hamre/hamre.c">hamre.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/hamre/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/hamre/hamre.orig.c">hamre.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/hamre/try.sh">try.sh</a> - how to run</li>
<li><a href="2006_hamre.tar.bz2">2006_hamre.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/hamre/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/hamre/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/hamre/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/hamre/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/hamre/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/hamre/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+39 -60
View File
@@ -123,96 +123,75 @@
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h1 id="nineteenth-international-obfuscated-c-code-contest">Nineteenth
International Obfuscated C Code Contest</h1>
<h1 id="nineteenth-international-obfuscated-c-code-contest">Nineteenth International Obfuscated C Code Contest</h1>
<h2 id="standard-ioccc-stuff">Standard IOCCC stuff</h2>
<p>View the <code>index.html</code> web page for the given winning entry
for information on how on how to compile it and how to run the winning
program. Look at the winning source and try to figure how it does what
it does! You may then wish to look at the Author’s remarks for even more
details.</p>
<p>The IOCCC has a web site and now has a number of international
mirrors. The primary site can be found at <a
href="https://www.ioccc.org">www.ioccc.org</a>.</p>
<p>Use <code>make</code> to compile entries. It is possible that on
non-Unix / non-Linux systems the Makefile needs to be changed. See the
Makefile for details.</p>
<p>This year we included most of the information included by the
submitters in the <code>README.md</code> files (that were used to build
the <code>index.html</code> web pages).</p>
<p>Read over the Makefile for compile/build issues. Your system may
require certain changes (add or remove a library, add or remove a
<code>#define</code>).</p>
<p>View the <code>index.html</code> web page for the given winning entry for information on how
on how to compile it and how to run the winning program.
Look at the winning source and try to figure how it does what it does!
You may then wish to look at the Author’s remarks for even more details.</p>
<p>The IOCCC has a web site and now has a number of international mirrors.
The primary site can be found at <a href="https://www.ioccc.org">www.ioccc.org</a>.</p>
<p>Use <code>make</code> to compile entries. It is possible that on non-Unix / non-Linux
systems the Makefile needs to be changed. See the Makefile for details.</p>
<p>This year we included most of the information included by the submitters
in the <code>README.md</code> files (that were used to build the <code>index.html</code> web pages).</p>
<p>Read over the Makefile for compile/build issues. Your system may require
certain changes (add or remove a library, add or remove a <code>#define</code>).</p>
<p>Some ANSI C compilers are not quite as good as they should be. If
yours is lacking, you may need to compile using gcc instead of your
local compiler.</p>
<h2 id="remarks-on-some-of-the-entries">Remarks on some of the
entries</h2>
<h2 id="remarks-on-some-of-the-entries">Remarks on some of the entries</h2>
<p>There were some outstanding entries that did not win. Unfortunately
some very good entries lost because they:</p>
<ul>
<li><p>depended too much on non-portable side effects in
expressions;</p></li>
<li><p>depended too much on non-portable side effects in expressions;</p></li>
<li><p>depended too much on a particular byte order;</p></li>
<li><p>required the use of a special script, data file or pseudo-machine
language that was not supplied with the entry.</p></li>
</ul>
<p>We hope the authors of some of those entries will fix and re-submit
them for the next IOCCC.</p>
<p>We believe you will be impressed with this year’s winning entries.
The Best of Show is a fine example of (retro) obfuscation. But don’t
ignore the other entries! There are games, puzzles, puzzle solvers,
simulators, emulators, calculators and graphical and audio tools.</p>
<p>This year a single person won three awards and another two awards!
Many authors won for the first time this year. (Please note that judging
is done completely anonymously. Be warned that we may disqualify entries
that reveal the identity of the submitter).</p>
<p>We believe you will be impressed with this year’s winning entries. The Best
of Show is a fine example of (retro) obfuscation. But don’t ignore the other
entries! There are games, puzzles, puzzle solvers, simulators, emulators,
calculators and graphical and audio tools.</p>
<p>This year a single person won three awards and another two awards! Many
authors won for the first time this year. (Please note that judging is done completely
anonymously. Be warned that we may disqualify entries that reveal the identity
of the submitter).</p>
<h2 id="final-comments">Final Comments</h2>
<p><strong>IMPORTANT NOTE</strong>: See <a
href="../contact.html">contact.html</a> for up to date contact details
as well as details on how to provide fixes to any of the entries. See
also <a href="../faq.html">the IOCCC FAQ</a> for addition information on
the IOCCC.</p>
<p><strong>IMPORTANT NOTE</strong>: See <a href="../contact.html">contact.html</a> for up to date contact details
as well as details on how to provide fixes to any of the entries.
See also <a href="../faq.html">the IOCCC FAQ</a> for addition information on the IOCCC.</p>
<h1 id="copyright-and-license">Copyright and License</h1>
<p>Copyright (c) 2006,2023, Landon Curt Noll and Leonid A. Broukhis. All
Rights Reserved. This work is licensed under a <a
href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons
CC BY-SA 4.0 DEED Attribution-ShareAlike 4.0 International</a> license.
If you do use this work in some form, the <a href="../judges.html">IOCCC
judges</a> would appreciate (but does not require) if you were to <a
href="../contact.html">send us a note about your use</a>.</p>
<p>Copyright (c) 2006,2023, Landon Curt Noll and Leonid A. Broukhis. All Rights Reserved.
This work is licensed under a <a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons CC BY-SA 4.0 DEED Attribution-ShareAlike
4.0 International</a> license.
If you do use this work in some form, the <a href="../judges.html">IOCCC judges</a> would appreciate
(but does not require) if you were to <a href="../contact.html">send us a note about your use</a>.</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-year-index.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-year-index.sh -->
<h1
id="winning-entries-of-2006---the-19th-ioccc"><a name=inventory></a><a name=2006></a>Winning
Entries of 2006 - The 19th IOCCC</h1>
<p><strong>Download IOCCC</strong> <a
href="2006/ioccc.2006.tar.bz2">2006 entry source</a></p>
<h1 id="winning-entries-of-2006---the-19th-ioccc"><a name=inventory></a><a name=2006></a>Winning Entries of 2006 - The 19th IOCCC</h1>
<p><strong>Download IOCCC</strong> <a href="2006/ioccc.2006.tar.bz2">2006 entry source</a></p>
<ul>
<li><a href="birken/index.html">2006/birken</a> - EDAMAME Award</li>
<li><a href="borsanyi/index.html">2006/borsanyi</a> - Most Useful</li>
<li><a href="grothe/index.html">2006/grothe</a> - Most Obfuscated
Audio</li>
<li><a href="grothe/index.html">2006/grothe</a> - Most Obfuscated Audio</li>
<li><a href="hamre/index.html">2006/hamre</a> - Most Irrational</li>
<li><a href="meyer/index.html">2006/meyer</a> - Best Game</li>
<li><a href="monge/index.html">2006/monge</a> - Best Compiled
Graphics</li>
<li><a href="night/index.html">2006/night</a> - Best Abuse of
Computation</li>
<li><a href="monge/index.html">2006/monge</a> - Best Compiled Graphics</li>
<li><a href="night/index.html">2006/night</a> - Best Abuse of Computation</li>
<li><a href="sloane/index.html">2006/sloane</a> - Homer’’s Favorite</li>
<li><a href="stewart/index.html">2006/stewart</a> - Best Computed
Graphics</li>
<li><a href="stewart/index.html">2006/stewart</a> - Best Computed Graphics</li>
<li><a href="sykes1/index.html">2006/sykes1</a> - Best Assembler</li>
<li><a href="sykes2/index.html">2006/sykes2</a> - Best One Liner</li>
<li><a href="toledo1/index.html">2006/toledo1</a> - Best Small
Program</li>
<li><a href="toledo1/index.html">2006/toledo1</a> - Best Small Program</li>
<li><a href="toledo2/index.html">2006/toledo2</a> - Best of Show</li>
<li><a href="toledo3/index.html">2006/toledo3</a> - Most Portable Chess
Set</li>
<li><a href="toledo3/index.html">2006/toledo3</a> - Most Portable Chess Set</li>
</ul>
<p> <strong>Jump to:</strong> <a href="#">top</a></p>
+49 -75
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Raphael_Meyer">Raphael
Meyer</a><br> Location: <a href="../../location.html#US">US</a> -
<em>United States of America</em> (<em>United States</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Raphael_Meyer">Raphael Meyer</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -147,74 +147,65 @@ Meyer</a><br> Location: <a href="../../location.html#US">US</a> -
<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">./meyer</span> <span class="pp">[</span><span class="ss">SEED</span><span class="pp">]</span></span></code></pre></div>
<p>For your first input try:</p>
<pre><code>a 0 1</code></pre>
<p>where <code>a</code> is the row (<code>a</code>-<code>i</code>),
<code>0</code> is the column (<code>0</code>-<code>8</code>) and
<code>1</code> is the number (<code>1</code>-<code>9</code>).</p>
<p>NOTE: if you do not input three different ‘words’ it will block. You
can input more text to fulfil the program’s requirements.</p>
<p>NOTE: if your move is invalid it will prompt you again but not show
the board.</p>
<p>where <code>a</code> is the row (<code>a</code>-<code>i</code>), <code>0</code> is the column (<code>0</code>-<code>8</code>) and <code>1</code> is the
number (<code>1</code>-<code>9</code>).</p>
<p>NOTE: if you do not input three different ‘words’ it will block. You can input
more text to fulfil the program’s requirements.</p>
<p>NOTE: if your move is invalid it will prompt you again but not show the board.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This entry turns a newspaper solitaire puzzle into a competition with
the computer to be the last one moving. The object of this <a
href="meyer.c">source code</a> is to determine the object of this <a
href="meyer.c">source code</a>! :-)</p>
<p>This entry turns a newspaper solitaire puzzle into a competition
with the computer to be the last one moving. The object of this
<a href="meyer.c">source code</a> is to determine the object of this <a href="meyer.c">source
code</a>! :-)</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>I wanted submit a fully object-oriented entry to show that
object-orientated code:</p>
<ol type="1">
<li>is ridiculously bloated.</li>
<li>is unreadable.</li>
<li>isn’t ‘<code>WYWIWID</code>’ (‘what you write is what it does’)
anymore.</li>
<li>isn’t ‘<code>WYWIWID</code>’ (‘what you write is what it does’) anymore.</li>
</ol>
<p>But I just totally failed. No, I didn’t fail in showing any of the
points above. Before I even had the chance to prove any of these claims,
(1) already brought me to my knees. The code got so bloated up, that I
missed the size limit by a few hundred bytes. Therefore, I broke the
only rule in this contest, I think you shouldn’t break in any case: Rule
Nr 2, The size of …</p>
<p>But I just totally failed. No, I didn’t fail in showing any of
the points above. Before I even had the chance to prove any of
these claims, (1) already brought me to my knees. The code got
so bloated up, that I missed the size limit by a few hundred
bytes. Therefore, I broke the only rule in this contest, I think
you shouldn’t break in any case: Rule Nr 2, The size of …</p>
<p>The degree of claim (2) actually depends on the compiler. As I
<em>manually</em> translated it from a generic object-oriented
programming language to C, it didn’t just end up unreadable, but awfully
<em>manually</em> translated it from a generic object-oriented programming
language to C, it didn’t just end up unreadable, but awfully
messed up, i.e. obfuscated.</p>
<p>As it is already (pre)translated to C, you could also call it an
object- disoriented program.</p>
<p>As it is already (pre)translated to C, you could also call it an object-
disoriented program.</p>
<p>Comparing this program to a potential object-oriented implementation,
it is obvious, that object-oriented code isn’t ‘<code>WYWIWID</code>’
(‘what you write is what it does’). It may be tempting to think that</p>
it is obvious, that object-oriented code isn’t ‘<code>WYWIWID</code>’ (‘what
you write is what it does’). It may be tempting to think that</p>
<pre><code>Object o;</code></pre>
<p>might do something similar as</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="kw">struct</span> not_an_object o<span class="op">;</span></span></code></pre></div>
<p>But this program reveals that it doesn’t. Even worse, this program
only reveals the tip of the iceberg, what kind of black magic is
involved in a simple declaration of an object.</p>
<p>But this program reveals that it doesn’t. Even worse, this program only
reveals the tip of the iceberg, what kind of black magic is involved in
a simple declaration of an object.</p>
<p>A few things you can explore about object-orientation in this program
include:</p>
<ul>
<li>constructors (invoked by the new operator).</li>
<li>new operators (every class gets its own new operator at compile
time).</li>
<li>virtual method tables (all the virtual method tables have been
combined to a single <a
href="https://en.wikipedia.org/wiki/Virtual_method_table">vtable</a>).</li>
<li>new operators (every class gets its own new operator at compile time).</li>
<li>virtual method tables (all the virtual method tables have been combined to a
single <a href="https://en.wikipedia.org/wiki/Virtual_method_table">vtable</a>).</li>
<li>runtime method binding.</li>
<li><a
href="https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming)">inheritance</a>
and <a
href="https://en.wikipedia.org/wiki/Polymorphism_(computer_science)">polymorphism</a>.</li>
<li><a href="https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming)">inheritance</a>
and <a href="https://en.wikipedia.org/wiki/Polymorphism_(computer_science)">polymorphism</a>.</li>
</ul>
<p>It is left as an exercise to the reader to find a corresponding
implementation in a popular object-oriented programming language.</p>
<h3 id="starting-the-game">Starting the game</h3>
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./meyer</span> <span class="pp">[</span><span class="ss">SEED</span><span class="pp">]</span></span></code></pre></div>
<h3 id="gameplay">Gameplay</h3>
<p>It is a <a href="https://en.wikipedia.org/wiki/Sudoku">sudoku</a>
based game. The goal of the game is to be able to do the last valid
‘move’.</p>
<p>On your turn you have to set a free cell to a value between 1 to 9
without breaking the following rule. Any number must be unique in
its:</p>
<p>It is a <a href="https://en.wikipedia.org/wiki/Sudoku">sudoku</a> based game. The goal of
the game is to be able to do the last valid ‘move’.</p>
<p>On your turn you have to set a free cell to a value between 1 to 9 without
breaking the following rule. Any number must be unique in its:</p>
<ol type="1">
<li>row</li>
<li>column</li>
@@ -228,50 +219,33 @@ column: [0-8]
number: [1-9].</code></pre>
<p>The game can be aborted with <code>q</code>.</p>
<p>The one who can do the last move wins the game.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-2006meyer"><a name="inventory"></a>Inventory for
2006/meyer</h1>
<h1 id="inventory-for-2006meyer"><a name="inventory"></a>Inventory for 2006/meyer</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/2006/meyer/meyer.c">meyer.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/meyer/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/meyer/meyer.orig.c">meyer.orig.c</a>
- original source</li>
<li><a href="2006_meyer.tar.bz2">2006_meyer.tar.bz2</a> - download entry
source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/meyer/meyer.c">meyer.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/meyer/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/meyer/meyer.orig.c">meyer.orig.c</a> - original source</li>
<li><a href="2006_meyer.tar.bz2">2006_meyer.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/meyer/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/meyer/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/meyer/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/meyer/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/meyer/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/meyer/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+118 -171
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Maurizio_Monge">Maurizio
Monge</a><br> Location: <a href="../../location.html#IT">IT</a> -
<em>Italian Republic</em> (<em>Italy</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Maurizio_Monge">Maurizio Monge</a><br>
Location: <a href="../../location.html#IT">IT</a> - <em>Italian Republic</em> (<em>Italy</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -140,63 +140,53 @@ Monge</a><br> Location: <a href="../../location.html#IT">IT</a> -
<!-- 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>
<p>Make sure you have the SDL1 (not SDL2!) development environment
installed.</p>
<p>Make sure you have the SDL1 (not SDL2!) development environment installed.</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<p>There is alternate version that lets you redefine the width and
height and number of iterations to use. See <a
href="#alternate-code">Alternate code</a> below.</p>
<p>There is alternate version that lets you redefine the width and height and number
of iterations to use. See <a href="#alternate-code">Alternate code</a> below.</p>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code>STATUS: doesn&#39;t work with some platforms - please help us fix
STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a
href="../../bugs.html#2006_monge">2006 monge bugs</a>.</p>
<p>For more detailed information see <a href="../../bugs.html#2006_monge">2006 monge 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">./monge</span> expression ...</span></code></pre></div>
<p>Incorrect formulas will ungracefully crash the program.</p>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>This alternate code lets you specify the width and height of the
image as well as the number of iterations to perform.</p>
<p>This alternate code lets you specify the width and height of the image as well
as the number of iterations to perform.</p>
<h3 id="alternate-build">Alternate build:</h3>
<p>To use the default values, the same as <a href="monge.c">monge.c</a>,
just do:</p>
<p>To use the default values, the same as <a href="monge.c">monge.c</a>, just do:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<p>But if you wish to actually make use of it you will want to redefine
one or more of the variables <code>W</code>, <code>H</code> and
<code>I</code>. The defaults are (respectively) 400, 300 and \128. If
you wish to change the image size to 500x500 but keep the iterations the
same then do:</p>
<p>But if you wish to actually make use of it you will want to redefine one or more
of the variables <code>W</code>, <code>H</code> and <code>I</code>. The defaults are (respectively) 400, 300 and
\128. If you wish to change the image size to 500x500 but keep the iterations
the same then do:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> clobber WIDTH=500 HEIGHT=500 alt</span></code></pre></div>
<p>If you wish to keep the dimensions the same but change the iterations
to 512:</p>
<p>If you wish to keep the dimensions the same but change the iterations to 512:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> clobber ITERATIONS=512 alt</span></code></pre></div>
<p>If you specify a value less than 1 for any of these it sets it back
to the default. The value 1 was selected arbitrarily and such a small
number as 1 will not do anything useful but as long as it’s at least 1
it’ll not be redefined. It does not try taking care of overflows but
such large values would be impractical anyway.</p>
<p>If you specify a value less than 1 for any of these it sets it back to the
default. The value 1 was selected arbitrarily and such a small number as 1 will
not do anything useful but as long as it’s at least 1 it’ll not be redefined.
It does not try taking care of overflows but such large values would be impractical
anyway.</p>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>monge.alt</code> exactly as you would <code>monge</code>
above.</p>
<p>Use <code>monge.alt</code> exactly as you would <code>monge</code> above.</p>
<h3 id="alternate-try">Alternate try:</h3>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.alt.sh</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>For those who are familiar with the previous <a
href="../../authors.html">IOCCC entries</a>, this program is best
described as “<a href="../../1994/tvr/index.html">1994/tvr</a> meets <a
href="../../2001/bellard/index.html">2001/bellard</a>”. Here you have
mouse-manipulated fractals AND generated binary code, all in one
package.</p>
<p>A more appropriate award could have been “Best abuse of the rules”,
because on a non-x86-based architecture this program is, quite
predictably, a dud.</p>
<p>At the time of judging we were too mesmerized by the graphics to
realize it; and, after all, this entry does take a special effort to
work on both <code>i386</code> and <code>x86_64</code>. Portable it is!
:)</p>
<p>For those who are familiar with the previous <a href="../../authors.html">IOCCC entries</a>,
this program is best described as “<a href="../../1994/tvr/index.html">1994/tvr</a> meets
<a href="../../2001/bellard/index.html">2001/bellard</a>”. Here you have mouse-manipulated
fractals AND generated binary code, all in one package.</p>
<p>A more appropriate award could have been “Best abuse of the
rules”, because on a non-x86-based architecture this program
is, quite predictably, a dud.</p>
<p>At the time of judging we were too mesmerized by the graphics
to realize it; and, after all, this entry does take a special
effort to work on both <code>i386</code> and <code>x86_64</code>. Portable it is! :)</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="for-the-impatient">For the impatient:</h3>
<ol start="0" type="1">
@@ -206,37 +196,29 @@ work on both <code>i386</code> and <code>x86_64</code>. Portable it is!
<ol type="1">
<li>Run:</li>
</ol>
<div class="sourceCode" id="cb10"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./monge</span> <span class="st">&quot;z = 0&quot;</span> <span class="st">&quot;z = z*z + c; Abs2(z) &lt; 4&quot;</span></span></code></pre></div>
<div class="sourceCode" id="cb10"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./monge</span> <span class="st">&quot;z = 0&quot;</span> <span class="st">&quot;z = z*z + c; Abs2(z) &lt; 4&quot;</span></span></code></pre></div>
<ol start="2" type="1">
<li><p>Keep clicking with left or right button to zoom in or
out.</p></li>
<li><p>Use the number pad <code>+</code> and <code>-</code> to
increase/decrease the iteration count when needed.</p></li>
<li><p>Enjoy, unless you’re more interested in trying to understand how
it works. :)</p></li>
<li><p>Keep clicking with left or right button to zoom in or out.</p></li>
<li><p>Use the number pad <code>+</code> and <code>-</code> to increase/decrease the iteration count when
needed.</p></li>
<li><p>Enjoy, unless you’re more interested in trying to understand how it works. :)</p></li>
</ol>
<h3 id="introduction">Introduction</h3>
<p>This is a fractal generator that supports custom formulas and real
time zoom. The program needs to be run with two arguments, the first
being a semicolon separated list of assignments to do once per pixel,
and the second a semicolon separated list of assignments and conditions
that will be executed (and conditions checked) for each iteration (up to
the maximum). Using the left and right mouse buttons you will be able to
zoom in and out (a la <a
href="https://github.com/xaos-project/XaoS">XaoS</a>), the zooming
algorithm is a bit slower than <code>XaoS</code>’s but it should give
slightly better results.</p>
<p>Formulas can use all <code>a-z</code> (lowercase) variables, and the
special variables <code>c</code> and <code>i</code> are respectively set
by default to the complex coordinate of the pixel and to the complex
imaginary <code>i</code>.</p>
<p>All the constant numbers will be interpreted as real double values.
Each expression must be an assignment (<code>[variable] = [expr]</code>)
or a comparison with <code>&lt;</code> or <code>&gt;</code>
(<code>[expr1] &lt; [expr2]</code> or
<code>[expr1] &gt; [expr2]</code>), and you can add spaces as you like
(as understood by the C function <code>isspace()</code>).</p>
<p>This is a fractal generator that supports custom formulas and real time zoom.
The program needs to be run with two arguments, the first being a semicolon
separated list of assignments to do once per pixel, and the second a semicolon
separated list of assignments and conditions that will be executed (and
conditions checked) for each iteration (up to the maximum). Using the left and
right mouse buttons you will be able to zoom in and out (a la
<a href="https://github.com/xaos-project/XaoS">XaoS</a>), the zooming algorithm is a bit
slower than <code>XaoS</code>’s but it should give slightly better results.</p>
<p>Formulas can use all <code>a-z</code> (lowercase) variables, and the special
variables <code>c</code> and <code>i</code> are respectively set by default to the
complex coordinate of the pixel and to the complex imaginary <code>i</code>.</p>
<p>All the constant numbers will be interpreted as real double values. Each
expression must be an assignment (<code>[variable] = [expr]</code>) or a comparison with
<code>&lt;</code> or <code>&gt;</code> (<code>[expr1] &lt; [expr2]</code> or <code>[expr1] &gt; [expr2]</code>), and you can add spaces
as you like (as understood by the C function <code>isspace()</code>).</p>
<p>Supported operations and functions are:</p>
<pre><code>Operation | Description
:-------- | :----------
@@ -257,154 +239,119 @@ or a comparison with <code>&lt;</code> or <code>&gt;</code>
<ul>
<li>Mandelbrot:</li>
</ul>
<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">./monge</span> <span class="st">&quot;z=1&quot;</span> <span class="st">&quot;z=z*z+c; Abs2(z)&lt;4&quot;</span></span></code></pre></div>
<div class="sourceCode" id="cb12"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./monge</span> <span class="st">&quot;z=1&quot;</span> <span class="st">&quot;z=z*z+c; Abs2(z)&lt;4&quot;</span></span></code></pre></div>
<ul>
<li>Mandelbrot (return time variation):</li>
</ul>
<div class="sourceCode" id="cb13"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./monge</span> <span class="st">&quot;z=c&quot;</span> <span class="st">&quot;z=z*z+c; Abs2(z-c)&gt;0.0001&quot;</span></span></code></pre></div>
<div class="sourceCode" id="cb13"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./monge</span> <span class="st">&quot;z=c&quot;</span> <span class="st">&quot;z=z*z+c; Abs2(z-c)&gt;0.0001&quot;</span></span></code></pre></div>
<ul>
<li>Julia, for <code>c=0.31+i*0.5</code>:</li>
</ul>
<div class="sourceCode" id="cb14"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./monge</span> <span class="st">&quot;z=c; c=0.31+i*0.5&quot;</span> <span class="st">&quot;z=z*z+c; Abs2(z)&lt;4&quot;</span></span></code></pre></div>
<div class="sourceCode" id="cb14"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./monge</span> <span class="st">&quot;z=c; c=0.31+i*0.5&quot;</span> <span class="st">&quot;z=z*z+c; Abs2(z)&lt;4&quot;</span></span></code></pre></div>
<ul>
<li>Julia (return time variation), <code>for c=0.31+i*0.5</code>:</li>
</ul>
<div class="sourceCode" id="cb15"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./monge</span> <span class="st">&quot;z=c; c=0.31+i*0.5&quot;</span> <span class="st">&quot;z=z*z+c; Abs2(z-c)&gt;0.0001&quot;</span></span></code></pre></div>
<div class="sourceCode" id="cb15"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./monge</span> <span class="st">&quot;z=c; c=0.31+i*0.5&quot;</span> <span class="st">&quot;z=z*z+c; Abs2(z-c)&gt;0.0001&quot;</span></span></code></pre></div>
<ul>
<li>Newton, for <code>x^3-1</code>:</li>
</ul>
<div class="sourceCode" id="cb16"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./monge</span> <span class="st">&quot;z=c&quot;</span> <span class="st">&quot;p=z; z=0.6666*z+0.3333/(z*z); Abs2(p-z) &gt; 0.001&quot;</span></span></code></pre></div>
<div class="sourceCode" id="cb16"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./monge</span> <span class="st">&quot;z=c&quot;</span> <span class="st">&quot;p=z; z=0.6666*z+0.3333/(z*z); Abs2(p-z) &gt; 0.001&quot;</span></span></code></pre></div>
<ul>
<li>Newton-Mandelbrot:</li>
</ul>
<div class="sourceCode" id="cb17"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./monge</span> <span class="st">&quot;z=0&quot;</span> <span class="st">&quot;p=z; z=z-(z*z*z + (c-1)*z - c)/(3*z*z+c-1); Abs2(p-z) &gt; 0.001&quot;</span></span></code></pre></div>
<div class="sourceCode" id="cb17"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./monge</span> <span class="st">&quot;z=0&quot;</span> <span class="st">&quot;p=z; z=z-(z*z*z + (c-1)*z - c)/(3*z*z+c-1); Abs2(p-z) &gt; 0.001&quot;</span></span></code></pre></div>
<ul>
<li>Phoenix, Mandelbrot version:</li>
</ul>
<div class="sourceCode" id="cb18"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./monge</span> <span class="st">&quot;z=0; q=0&quot;</span> <span class="st">&quot;t=z; z=z*z+Re(c)+Im(c)*q; q=t; Abs2(z)&lt;4&quot;</span></span></code></pre></div>
<div class="sourceCode" id="cb18"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./monge</span> <span class="st">&quot;z=0; q=0&quot;</span> <span class="st">&quot;t=z; z=z*z+Re(c)+Im(c)*q; q=t; Abs2(z)&lt;4&quot;</span></span></code></pre></div>
<ul>
<li>Phoenix, Julia version for <code>c=0.56667-i*0.5</code>:</li>
</ul>
<div class="sourceCode" id="cb19"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./monge</span> <span class="st">&quot;z=c; c=0.56667-i*0.5; q=0&quot;</span> <span class="st">&quot;t=z; z=z*z+Re(c)+Im(c)*q; q=t; Abs2(z)&lt;4&quot;</span></span></code></pre></div>
<div class="sourceCode" id="cb19"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./monge</span> <span class="st">&quot;z=c; c=0.56667-i*0.5; q=0&quot;</span> <span class="st">&quot;t=z; z=z*z+Re(c)+Im(c)*q; q=t; Abs2(z)&lt;4&quot;</span></span></code></pre></div>
<h3 id="compilation-and-portability">Compilation and portability</h3>
<p>This program will only work on x86 (with an x87 FPU) or x86_64
machines, but it requires the SDL library.</p>
<p>Another system requirement is the <code>mmap(2)</code> function (as
<code>#define</code>d at the beginning of the program). If it is not
available the macro <code>M(a)</code> will have to be replaced with a
system dependent function that allocates readable, writable <em>AND</em>
executable memory (it will not be possible to make this program run on
paranoid systems (like OpenBSD IIRC) that do not allow <code>rwx</code>
memory).</p>
<p>However I was able to compile and make work the program under Linux
(Debian/x86 and openSUSE/x86_64) and under Cygwin/x86. A friend of mine
was able to make it work under macOS too.</p>
<p>If you want you can change the window width and height, or the
default number of iterations (that one can be tweaked at runtime,
anyway) by changing the definitions of <code>W</code>, <code>H</code>
and <code>I</code> at the beginning of the code.</p>
<h3 id="caveats-i-just-a-selected-few-of-them">Caveats (I just a
selected few of them!)</h3>
<p>This program will only work on x86 (with an x87 FPU) or x86_64 machines,
but it requires the SDL library.</p>
<p>Another system requirement is the <code>mmap(2)</code> function (as <code>#define</code>d at the
beginning of the program). If it is not available the macro <code>M(a)</code> will have to
be replaced with a system dependent function that allocates readable, writable
<em>AND</em> executable memory (it will not be possible to make this program run on
paranoid systems (like OpenBSD IIRC) that do not allow <code>rwx</code> memory).</p>
<p>However I was able to compile and make work the program under
Linux (Debian/x86 and openSUSE/x86_64) and under Cygwin/x86. A
friend of mine was able to make it work under macOS too.</p>
<p>If you want you can change the window width and height, or the default
number of iterations (that one can be tweaked at runtime, anyway) by
changing the definitions of <code>W</code>, <code>H</code> and <code>I</code> at the beginning of the code.</p>
<h3 id="caveats-i-just-a-selected-few-of-them">Caveats (I just a selected few of them!)</h3>
<ul>
<li>The zooming speed depends on the speed of the computer.</li>
<li>Incorrect formulas will ungracefully crash the program.</li>
<li>Many SDL identifiers are hardcoded as number, this is safe up to ABI
incompatibility.</li>
<li>Better optimization could be done treating known real numbers as
just one <code>double</code>, instead of adding a 0 imaginary part to
treat them as complex numbers.</li>
<li>There should be some way to switch from Mandelbrot to Julia with
chosen parameter.</li>
<li>Better optimization could be done treating known real numbers as just one
<code>double</code>, instead of adding a 0 imaginary part to treat them as complex
numbers.</li>
<li>There should be some way to switch from Mandelbrot to Julia with chosen
parameter.</li>
</ul>
<h3 id="spoiler">Spoiler</h3>
<p>Sure, I don’t want to deprive you of the pleasure of digging into the
infernal mess created by my corrupted mind (writing this remark I
noticed that I was ending sentences with ‘;’ instead of with ‘.’, and I
worried for my sanity), but just in case…</p>
<p>I used many obfuscation techniques, including a few ones that are
different from the tricks used in most common IOCCC program (more ‘high
level’, in the sense that they require an understanding of how all the
program works to be worked out).</p>
<p>Sure, I don’t want to deprive you of the pleasure of digging
into the infernal mess created by my corrupted mind (writing
this remark I noticed that I was ending sentences with ‘;’ instead
of with ‘.’, and I worried for my sanity), but just in case…</p>
<p>I used many obfuscation techniques, including a few ones that
are different from the tricks used in most common IOCCC program
(more ‘high level’, in the sense that they require an understanding
of how all the program works to be worked out).</p>
<p>This program is a formula parser that outputs machine code that
calculates the formula and check the given conditions. The machine code
targets the x87 stack based <a
href="https://en.wikipedia.org/wiki/Floating-point_unit">FPU</a>, and it
is almost identical for x86 and x86_64 (except for the comparison
instructions, that have to be generated differently). The program keeps
track of the FPU stack (the FPU has a cyclic stack of 8 registers) and
will automatically swap to and from the main memory when required (i.e.,
adds instructions to the generated machine code to take care of this
issue).</p>
<p>The formulas are parsed recursively and machine code for the inner
iteration loop is also generated.</p>
<p>After generating the machine code, a big event loop creates (or zooms
into) the fractal executing the generated code when needed, and then
waits for input events.</p>
calculates the formula and check the given conditions. The
machine code targets the x87 stack based
<a href="https://en.wikipedia.org/wiki/Floating-point_unit">FPU</a>, and it is almost
identical for x86 and x86_64 (except for the comparison
instructions, that have to be generated differently). The
program keeps track of the FPU stack (the FPU has a cyclic stack
of 8 registers) and will automatically swap to and from the
main memory when required (i.e., adds instructions to the generated
machine code to take care of this issue).</p>
<p>The formulas are parsed recursively and machine code for the
inner iteration loop is also generated.</p>
<p>After generating the machine code, a big event loop creates (or
zooms into) the fractal executing the generated code when needed,
and then waits for input events.</p>
<p>The zooming algorithm works by remembering for each pixel the
floating point offset to where the value was actually calculated. When
zooming, the best match is searched, and if the offset is too big
(<code>&gt;1</code>) the pixel is recalculated.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
floating point offset to where the value was actually calculated.
When zooming, the best match is searched, and if the offset is
too big (<code>&gt;1</code>) the pixel is recalculated.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-2006monge"><a name="inventory"></a>Inventory for
2006/monge</h1>
<h1 id="inventory-for-2006monge"><a name="inventory"></a>Inventory for 2006/monge</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/2006/monge/monge.c">monge.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/monge/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/monge/monge.alt.c">monge.alt.c</a>
- alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/monge/monge.orig.c">monge.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/monge/try.alt.sh">try.alt.sh</a>
- how to run alternative code</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/monge/try.sh">try.sh</a>
- how to run</li>
<li><a href="2006_monge.tar.bz2">2006_monge.tar.bz2</a> - download entry
source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/monge/monge.c">monge.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/monge/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/monge/monge.alt.c">monge.alt.c</a> - alternative source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/monge/monge.orig.c">monge.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/monge/try.alt.sh">try.alt.sh</a> - how to run alternative code</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/monge/try.sh">try.sh</a> - how to run</li>
<li><a href="2006_monge.tar.bz2">2006_monge.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/monge/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/monge/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/monge/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/monge/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/monge/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/monge/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+65 -91
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Christopher_Night">Christopher
Night</a><br> Location: <a href="../../location.html#US">US</a> -
<em>United States of America</em> (<em>United States</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Christopher_Night">Christopher Night</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -141,138 +141,112 @@ Night</a><br> Location: <a href="../../location.html#US">US</a> -
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<p>There is an alternate version that supports arrow keys. See the <a
href="#alternate-code">alternate code</a> section below.</p>
<p>There is an alternate version that supports arrow keys. See the <a href="#alternate-code">alternate
code</a> section below.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./night</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>This version allows you to use arrow keys instead of the more awkward
<code>wasd</code> keys.</p>
<p>This version allows you to use arrow keys instead of the more awkward <code>wasd</code>
keys.</p>
<h3 id="alternate-build">Alternate build:</h3>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>night.alt</code> as you would <code>night</code> above.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>You’d never guess, from looking at the code, that there is a <a
href="https://towardsdatascience.com/introduction-to-genetic-algorithms-including-example-code-e396e98d8bf3">genetic
algorithm</a> involved. Somewhere. But what does it do? Well, it might
take you a while to navigate the results, let alone the code.</p>
<p>You’d never guess, from looking at the code, that there is a <a href="https://towardsdatascience.com/introduction-to-genetic-algorithms-including-example-code-e396e98d8bf3">genetic
algorithm</a>
involved. Somewhere. But what does it do? Well, it might take you a while to
navigate the results, let alone the code.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>Don’t worry; this is not a self-reproducing program, as you might at
first guess from the layout. I would never be so foolhardy as to submit
an entry on an overused theme!</p>
first guess from the layout. I would never be so foolhardy as to
submit an entry on an overused theme!</p>
<p>Oh, wait a second… it is a maze-generating program. Oops!</p>
<h3 id="what-it-does">What it does:</h3>
<p>This program solves an optimization problem, namely, generating a
challenging maze. It uses a very simple genetic algorithm: a maze
layout’s <a href="https://en.wikipedia.org/wiki/DNA">DNA</a> is
represented as a 32-bit integer, and mutations consist of flipping three
different bits. The algorithm is simple in that it doesn’t employ sexual
reproduction, only mutations, and it has a population size of 1. So much
for diversity!</p>
<p>This particular optimization problem, I believe, has a unique
maximum: there is but one maze out of <code>2^32</code> that requires 64
moves to solve. The program will run until finding this global maximum,
or if you get bored, you can accept a sub-optimal solution by pressing
any key. On my system, it takes an average of 15 minutes to find the
maximum, whereas a random search would take an average of 3.5 days.</p>
<p>Should you take my word for it that the maze it generates requires as
many moves as I say it does? The answer is yes. But if you’re not
convinced, you can try to solve it yourself. The goal is to traverse
from the upper-left to the upper-right and out the top, where the number
of moves remaining is printed. Use the arrow keys for suckers
(<code>w</code>, <code>a</code>, <code>s</code>, <code>d</code>) to move
around. <code>q</code> quits and <code>r</code> restarts. Also, the maze
changes as you move through it, in a predictable way. It should be easy
enough to figure out the pattern. For best results, use a display with
bold-text capabilities and color.</p>
<p>Finally, in the world of DNA, the medium is truly the message.
There’s a short message encoded in here that will only appear when you
<p>This program solves an optimization problem, namely, generating a challenging
maze. It uses a very simple genetic algorithm: a maze layout’s
<a href="https://en.wikipedia.org/wiki/DNA">DNA</a> is represented as a 32-bit integer, and
mutations consist of flipping three different bits. The algorithm is simple in
that it doesn’t employ sexual reproduction, only mutations, and it has a
population size of 1. So much for diversity!</p>
<p>This particular optimization problem, I believe, has a unique maximum:
there is but one maze out of <code>2^32</code> that requires 64 moves to solve. The
program will run until finding this global maximum, or if you get
bored, you can accept a sub-optimal solution by pressing any key. On
my system, it takes an average of 15 minutes to find the maximum,
whereas a random search would take an average of 3.5 days.</p>
<p>Should you take my word for it that the maze it generates requires as many moves
as I say it does? The answer is yes. But if you’re not convinced, you can try to
solve it yourself. The goal is to traverse from the upper-left to the
upper-right and out the top, where the number of moves remaining is printed. Use
the arrow keys for suckers (<code>w</code>, <code>a</code>, <code>s</code>, <code>d</code>) to move around. <code>q</code> quits and
<code>r</code> restarts. Also, the maze changes as you move through it, in a predictable
way. It should be easy enough to figure out the pattern. For best results, use a
display with bold-text capabilities and color.</p>
<p>Finally, in the world of DNA, the medium is truly the message. There’s
a short message encoded in here that will only appear when you
complete the optimal maze in the required 64 moves.</p>
<h3 id="issues">Issues:</h3>
<p>These depend on your compiler, and they were all intentionally added
for obfuscation purposes. No, really!</p>
<p>These depend on your compiler, and they were all intentionally
added for obfuscation purposes. No, really!</p>
<p>My compiler warns of nulls in a string literal, and the redefinition
of the macro <code>T</code>.</p>
<p>With one compiler, compilation took about two minutes.</p>
<p><code>sizeof(unsigned short)</code> must be 2, and
<code>sizeof(unsigned long)</code> must be 4.</p>
<p><code>CLOCKS_PER_SEC</code> is assumed to be <code>1000000</code>. If
it’s a lot less than that, expect delays.</p>
<p><code>sizeof(unsigned short)</code> must be 2, and <code>sizeof(unsigned long)</code> must be 4.</p>
<p><code>CLOCKS_PER_SEC</code> is assumed to be <code>1000000</code>. If it’s a lot less than that,
expect delays.</p>
<h3 id="algorithmic-obfuscation">Algorithmic obfuscation:</h3>
<p>The representation of the maze layout in a 32-bit integer type is
pretty opaque. As a hint, the optimum layout’s DNA is, in base 4,
<code>2102231031201230</code>. Try getting from there to the maze that
appears on screen.</p>
<p>The recursive function <code>CGAC()</code> replaces a nested for loop
in a handy way.</p>
<p>The maze-solving function <code>TGA()</code> returns no solution both
if no solution exists, and if the search space grows too large, with a
single test.</p>
<code>2102231031201230</code>. Try getting from there to the maze that appears on
screen.</p>
<p>The recursive function <code>CGAC()</code> replaces a nested for loop in a handy way.</p>
<p>The maze-solving function <code>TGA()</code> returns no solution both if no solution
exists, and if the search space grows too large, with a single test.</p>
<h3 id="stylistic-obfuscation">Stylistic obfuscation:</h3>
<p>Four-letter alphabets are confusing. I don’t know how <a
href="https://en.wikipedia.org/wiki/Ribosome">ribosomes</a> manage.</p>
<p>Four-letter alphabets are confusing. I don’t know how
<a href="https://en.wikipedia.org/wiki/Ribosome">ribosomes</a> manage.</p>
<p>Overloaded symbols, such as <code>G</code> and <code>G()</code>.</p>
<p>Who needs <code>!=</code> when you’ve got <code>^</code>?</p>
<p>Who needs <code>if</code> when you’ve got <code>while</code>?</p>
<p>For that matter, who needs fixed-iteration-count <code>for</code> and
<code>while</code> when you can just duplicate code with the
preprocessor? Duplication by this macro causes one particular graphics
line to be replicated 512 times. On my system the preprocessed code is
over 80KB in length, hindering the preprocessor’s ability to
deobfuscate.</p>
<p>For that matter, who needs fixed-iteration-count <code>for</code> and <code>while</code> when you can
just duplicate code with the preprocessor? Duplication by this macro causes one
particular graphics line to be replicated 512 times. On my system the
preprocessed code is over 80KB in length, hindering the preprocessor’s ability
to deobfuscate.</p>
<p>Keypad support was removed to save space. To restore, modify the
following two macros to:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define ATG srand</span><span class="op">(</span><span class="pp">time</span><span class="op">(</span><span class="dv">0</span><span class="op">));</span><span class="pp"> initscr</span><span class="op">();</span><span class="pp"> cbreak</span><span class="op">();</span><span class="pp"> noecho</span><span class="op">();</span><span class="pp"> start_color</span><span class="op">();</span><span class="pp"> keypad</span><span class="op">(</span><span class="pp">stdscr</span><span class="op">,</span><span class="dv">1</span><span class="op">);</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define AGG A</span><span class="op">&amp;</span><span class="dv">2</span><span class="op">?</span><span class="pp">KEY_UP</span><span class="op">:</span><span class="pp">KEY_DOWN</span><span class="op">:</span><span class="pp">A</span><span class="op">&amp;</span><span class="dv">1</span><span class="op">?</span><span class="pp">KEY_RIGHT</span><span class="op">:</span><span class="pp">KEY_LEFT</span></span></code></pre></div>
<p>Code on!</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-2006night"><a name="inventory"></a>Inventory for
2006/night</h1>
<h1 id="inventory-for-2006night"><a name="inventory"></a>Inventory for 2006/night</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/2006/night/night.c">night.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/night/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/night/night.alt.c">night.alt.c</a>
- alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/night/night.orig.c">night.orig.c</a>
- original source</li>
<li><a href="2006_night.tar.bz2">2006_night.tar.bz2</a> - download entry
source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/night/night.c">night.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/night/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/night/night.alt.c">night.alt.c</a> - alternative source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/night/night.orig.c">night.orig.c</a> - original source</li>
<li><a href="2006_night.tar.bz2">2006_night.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/night/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/night/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/night/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/night/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/night/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/night/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+62 -91
View File
@@ -130,8 +130,8 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Andy_Sloane">Andy Sloane</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of
America</em> (<em>United States</em>) <br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -141,136 +141,107 @@ America</em> (<em>United States</em>) <br><br></li>
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<p>We recommend the alt version so that you can see what this looked
like back in 2006. If you wish to see the original faster version see <a
href="#original-code">original code</a> below.</p>
<p>We recommend the alt version so that you can see what this looked like back in 2006.
If you wish to see the original faster version see <a href="#original-code">original
code</a> below.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./slone.alt</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<p>The alternate version, which we recommend that you use in order to
see what is happening with modern systems, and to not flash too quickly,
which can be problematic for some people, can be configured to different
speeds by way of the value used in <code>usleep()</code>. The default is
<code>75000</code> but you can easily change it. To do so try:</p>
<p>The alternate version, which we recommend that you use in order to see what is
happening with modern systems, and to not flash too quickly, which can be
problematic for some people, can be configured to different speeds by way of the
value used in <code>usleep()</code>. The default is <code>75000</code> but you can easily change
it. To do so try:</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> clobber SLEEP=70000 clobber alt</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./sloane.alt</span></span></code></pre></div>
<p>If you wish to make it like the original, as if the below <a
href="#original-code">Original code</a> was being used, you can do:</p>
<p>If you wish to make it like the original, as if the below <a href="#original-code">Original
code</a> was being used, you can do:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> SLEEP=0 clobber alt</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./sloane.alt</span></span></code></pre></div>
<h2 id="original-code">Original code:</h2>
<p>Should you wish to see the original you may do so with the original
code, <a href="sloane.c">sloane.c</a>.</p>
<p>Should you wish to see the original you may do so with the original code,
<a href="sloane.c">sloane.c</a>.</p>
<h3 id="original-build">Original build:</h3>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> clobber all</span></code></pre></div>
<h3 id="original-use">Original use:</h3>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./sloane</span></span></code></pre></div>
<p>WARNING: if you are easily overstimulated with fast movement or have
photosensitivity please be careful running this version and instead see
the above!</p>
<p>NOTE: again as above, to see what is going on, we recommend that you
instead use the alternate code which we described in the <a
href="#to-build">To build</a> and <a href="#try">try</a> sections
above.</p>
photosensitivity please be careful running this version and instead see the
above!</p>
<p>NOTE: again as above, to see what is going on, we recommend that you instead use
the alternate code which we described in the <a href="#to-build">To build</a> and
<a href="#try">try</a> sections above.</p>
<h2 id="judges-comments">Judges’ Comments:</h2>
<p>Looks almost good enough to eat, dunnit? I suppose you could argue
that, at first blush, this looks like a self-reproducing program.</p>
<p>Looks almost good enough to eat, dunnit? I suppose you could argue that,
at first blush, this looks like a self-reproducing program.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This program doesn’t require any special build options, other than
that it uses <code>sin(3)</code> and <code>cos(3)</code> and hence
requires the math library.</p>
<p>You will almost certainly get a compiler warning because I declared a
bunch of global <code>int</code>s without types. The code looks better
this way, though, I think. There are also no <code>#include</code>s, so
there may be warnings for undeclared references to
<code>printf(3)</code>, etc. There’s a chance that my failure to include
<code>math.h</code> or declare <code>sin(3)</code> or
<code>cos(3)</code> will make the <a
href="https://en.wikipedia.org/wiki/Doughnut">donut</a> not render
<p>This program doesn’t require any special build options, other than that it
uses <code>sin(3)</code> and <code>cos(3)</code> and hence requires the math library.</p>
<p>You will almost certainly get a compiler warning because I declared a bunch
of global <code>int</code>s without types. The code looks better this way, though, I
think. There are also no <code>#include</code>s, so there may be warnings for
undeclared references to <code>printf(3)</code>, etc. There’s a chance that my failure to
include <code>math.h</code> or declare <code>sin(3)</code> or <code>cos(3)</code> will make the
<a href="https://en.wikipedia.org/wiki/Doughnut">donut</a> not render
properly – it’s worked on every system I’ve tried so far though.</p>
<p>You will need some kind of VT100-ish emulation; so while this
compiles and runs OK in Windows, you will need PuTTYcyg or something
like that.</p>
<p>You will need some kind of VT100-ish emulation; so while this compiles and
runs OK in Windows, you will need PuTTYcyg or something like that.</p>
<p>The shape of the source gives a hint about its output: it’s a little
animation of a shaded donut rotating over an infinite checkerboard. Like
many IOCCC entries, it is thus self-documenting.</p>
<p>I wanted to create something as “pure” as I could - meaning that the
entire source code is shaped into a work of art, without being prefixed
by any <code>#define</code> hacks, or even <code>#includes</code>,
<em>and</em> is portable enough to not require any special libraries to
do the animating. I achieved this with two standard escape codes for
clearing the screen and moving the cursor back to the top-left.</p>
<p>I wanted to create something as “pure” as I could - meaning that the entire
source code is shaped into a work of art, without being prefixed by any
<code>#define</code> hacks, or even <code>#includes</code>, <em>and</em> is portable enough to not require
any special libraries to do the animating. I achieved this with two standard
escape codes for clearing the screen and moving the cursor back to the top-left.</p>
<p>The donut isn’t raytraced. It’s much simpler than that.</p>
<h3 id="how-is-it-obfuscated">How is it obfuscated?</h3>
<p>There are three main pieces to this program: the donut, the
checkerboard, and the ASCII logo. The first two are programmed in a
straightforward way (with <a
href="https://en.wikipedia.org/wiki/Z-buffering">z-buffering</a> even!),
but the mathematics for drawing them is “optimized”. The ASCII logo has
been shrunk into the smallest I could make it by any means
necessary.</p>
<p>There are three main pieces to this program: the donut, the checkerboard, and
the ASCII logo. The first two are programmed in a straightforward way (with
<a href="https://en.wikipedia.org/wiki/Z-buffering">z-buffering</a> even!), but the
mathematics for drawing them is “optimized”. The ASCII logo has been shrunk
into the smallest I could make it by any means necessary.</p>
<p>The logo can actually be compressed much better (ironically, by doing
something simpler), but I didn’t discover this until well after
submitting.</p>
something simpler), but I didn’t discover this until well after submitting.</p>
<h3 id="puzzles">Puzzles</h3>
<p>In increasing order of difficulty:</p>
<ul>
<li><p>Can you change the shading of the donut and
checkerboard?</p></li>
<li><p>Can you change the movement rates of the donut, the checkerboard,
and the scrolling logo?</p></li>
<li><p>Can you change the inner/outer radii of the donut? The
height/scaling of the checkerboard?</p></li>
<li><p>How is the “IOCCC 2006” logo encoded? Can you put something else
in its place? Can you find a smaller encoding?</p></li>
<li><p>Can you change the shading of the donut and checkerboard?</p></li>
<li><p>Can you change the movement rates of the donut, the checkerboard, and
the scrolling logo?</p></li>
<li><p>Can you change the inner/outer radii of the donut? The height/scaling
of the checkerboard?</p></li>
<li><p>How is the “IOCCC 2006” logo encoded? Can you put something else in its
place? Can you find a smaller encoding?</p></li>
</ul>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-2006sloane"><a name="inventory"></a>Inventory for
2006/sloane</h1>
<h1 id="inventory-for-2006sloane"><a name="inventory"></a>Inventory for 2006/sloane</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/2006/sloane/sloane.c">sloane.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sloane/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sloane/sloane.alt.c">sloane.alt.c</a>
- alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sloane/sloane.orig.c">sloane.orig.c</a>
- original source</li>
<li><a href="2006_sloane.tar.bz2">2006_sloane.tar.bz2</a> - download
entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sloane/sloane.c">sloane.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sloane/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sloane/sloane.alt.c">sloane.alt.c</a> - alternative source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sloane/sloane.orig.c">sloane.orig.c</a> - original source</li>
<li><a href="2006_sloane.tar.bz2">2006_sloane.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sloane/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sloane/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sloane/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sloane/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sloane/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sloane/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+119 -230
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Thomas_Stewart">Thomas
Stewart</a><br> Location: <a href="../../location.html#US">US</a> -
<em>United States of America</em> (<em>United States</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Thomas_Stewart">Thomas Stewart</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -150,26 +150,23 @@ crystal curve diamonds diamonds2 dragon dragon2 dragon3
fern gasket gasket_mod gasket_mod2 ioccc maze octagon
pentagon pentagons rings rings2 spirals spirals2 spirals3
spirals4 squares stars stars2 tree tree2 tree3 tree4 triangle</code></pre>
<p>NOTE: you cannot specify a different width from height; it’s one
number.</p>
<p>NOTE: <code>convert(1)</code> belongs to <a
href="https://imagemagick.org/index.php">ImageMagick</a>.</p>
<p>NOTE: you cannot specify a different width from height; it’s one number.</p>
<p>NOTE: <code>convert(1)</code> belongs to <a href="https://imagemagick.org/index.php">ImageMagick</a>.</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>After running the program on a few files it will ask you if you wish
to run it on the remaining files.</p>
<p>The script will try converting the xbm files created by the program
to png files. If it does it will list those that exist in the directory,
at the end of the script. If you do not have <code>convert(1)</code> it
will warn you once. In that case you’ll have to open the xbm files in a
graphics viewer capable of viewing xbm images. In any case choose your
favourite graphics viewer to look at the images created.</p>
<p>After running the program on a few files it will ask you if you wish to run it
on the remaining files.</p>
<p>The script will try converting the xbm files created by the program to png
files. If it does it will list those that exist in the directory, at the end of
the script. If you do not have <code>convert(1)</code> it will warn you once. In that case
you’ll have to open the xbm files in a graphics viewer capable of viewing xbm
images. In any case choose your favourite graphics viewer to look at the images
created.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Note the interesting choice of using a <code>#define</code> in the
output. The selection of input files makes this one endlessly fun to
play with. Many image viewers will be able to read the results, as will
a reasonably experienced user who can parse formats in their mind.
:-)</p>
<p>Note the interesting choice of using a <code>#define</code> in the output.
The selection of input files makes this one endlessly fun to play
with. Many image viewers will be able to read the results, as will
a reasonably experienced user who can parse formats in their mind. :-)</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="execution">Execution</h3>
<p>The program should be run with the following</p>
@@ -179,30 +176,26 @@ a reasonably experienced user who can parse formats in their mind.
n = The number of iterations to run (More will make for a
clearer picture).
ifs = The file to use as input.</code></pre>
<p>The program will spit out an <a
href="https://en.wikipedia.org/wiki/X_BitMap">XBM image</a> on standard
out. Minimal checking is done on the arguments mainly that there are 3.
Wrong arguments will cause the program to bomb out.</p>
<p>The program will spit out an <a href="https://en.wikipedia.org/wiki/X_BitMap">XBM image</a>
on standard out. Minimal checking is done on the arguments mainly that there
are 3. Wrong arguments will cause the program to bomb out.</p>
<h4 id="example">Example:</h4>
<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">./stewart</span> 1024 1000000 gasket <span class="op">&gt;</span> gasket.xbm</span></code></pre></div>
<h3 id="compilationtesting">Compilation/Testing</h3>
<p>The program compiles without warning with
<code>gcc -ansi -Wall</code>. <code>lint</code> also seems to like the
code. This must be a bug in <code>lint</code>.</p>
<p>The program was tested on Linux on a x86 and NetBSD on an alpha. Only
gcc was tested for compilers (4.0.3 and 3.3.3).</p>
<p>The program compiles without warning with <code>gcc -ansi -Wall</code>.
<code>lint</code> also seems to like the code. This must be a bug in <code>lint</code>.</p>
<p>The program was tested on Linux on a x86 and NetBSD on an alpha.
Only gcc was tested for compilers (4.0.3 and 3.3.3).</p>
<h3 id="entry-originality">Entry originality</h3>
<p>In looking through past winning entries, there seem to be only 2 (92
and 94) that generated fractals. Both of those were <a
href="https://en.wikipedia.org/wiki/Julia_set">Julia fractals</a> from
the <a href="https://en.wikipedia.org/wiki/Mandelbrot_set">Mandelbrot
set</a>. Those do make for some pretty pictures. I figured it would be
nice to add some more fractals to the IOCCC, since one hasn’t won since
1994.</p>
<p>In looking through past winning entries, there seem to be only 2 (92 and 94) that
generated fractals. Both of those were <a href="https://en.wikipedia.org/wiki/Julia_set">Julia
fractals</a> from the <a href="https://en.wikipedia.org/wiki/Mandelbrot_set">Mandelbrot
set</a>. Those do make for some
pretty pictures. I figured it would be nice to add some more fractals to the
IOCCC, since one hasn’t won since 1994.</p>
<p>Instead of something that has already won I figured I would go with
another kind of fractal, those from the <a
href="https://en.wikipedia.org/wiki/Iterated_function_system">Iterated
Function System (IFS)</a>.</p>
another kind of fractal, those from the <a href="https://en.wikipedia.org/wiki/Iterated_function_system">Iterated Function System
(IFS)</a>.</p>
<h3 id="input-file">Input File</h3>
<p>The format of the input file is as follows:</p>
<pre><code>&lt;num ifs&gt; &lt;x min&gt; &lt;y min&gt; &lt;x max&gt; &lt;y max&gt;
@@ -213,8 +206,7 @@ Function System (IFS)</a>.</p>
.
.</code></pre>
<p>This file describe an IFS.</p>
<p>One of the most well known would be the <a href="gasket">Sierpinski
Gasket</a>:</p>
<p>One of the most well known would be the <a href="gasket">Sierpinski Gasket</a>:</p>
<pre><code>3 0 0 1 1
.5 0 0 .5 0 0 .33
.5 0 0 .5 .5 0 .33
@@ -227,220 +219,117 @@ Gasket</a>:</p>
-.15 .28 .26 .24 0 .44 .07</code></pre>
<p>etc…</p>
<p>Included in my submission will be a tarball of some IFS files,
including one that attempts (not very well) to mimic the IOCCC logo (I
figure it can’t hurt to attempt to suck up, right?).</p>
including one that attempts (not very well) to mimic the IOCCC logo
(I figure it can’t hurt to attempt to suck up, right?).</p>
<p>I would try to explain how to create an IFS file but I am not smart
enough to condense it down to something that is coherent.</p>
<p>Basically the break down is:</p>
<p><code>num</code> is the number of equations in the <code>IFS</code>.
<code>x</code> (min, max) and <code>y</code> (min, max) define the
ranges that will be displayed in the XBM image file.</p>
<p>The <code>a b c d e f</code> are used to iterative find points that
lie in the IFS from the algorithm</p>
<code>x</code> (min, max) and <code>y</code> (min, max) define the ranges that will be displayed
in the XBM image file.</p>
<p>The <code>a b c d e f</code> are used to iterative find points that lie in the IFS
from the algorithm</p>
<pre><code>x = a * prevx + b * prevy + e;
y = c * prevx + d * prevy + f;</code></pre>
<p>The <code>p</code> is for the probability that the equation will
run.</p>
<p>The <code>p</code> is for the probability that the equation will run.</p>
<h3 id="obfuscations">Obfuscations</h3>
<p>The main obfuscation is using a <code>void *</code> as my only
variable (aside from the args for <code>main()</code>). This causes me
to do much casting and pointer arithmetic to get the correct location
and completely does away with any meaning the variables could have. This
also makes the code more convenient to read in the current form vs
preprocessed. After preprocessing there will be almost 300 casts in the
code and I believe they are all needed… (I would double check but my
brain is kinda mushy right now from chasing down a segfault in the
code.)</p>
<p>The other main obfuscation being that it generates an
<code>IFS</code>. Which isn’t all that common for a program to do. I
mean google only has something like 66,000 hits for “Iterated function
system” so that means it is obscure, right?</p>
<h3 id="some-other-minor-obfuscations">Some other minor
obfuscations</h3>
<p>Since I formatted it as a “normal” program I did inject something
that on first glance will looks like a possible bug. (When you run it
through a C-beautifier this will be removed.)</p>
<p>I decided not to use <code>rand()</code> to generate a pseudo-random
number. Instead I use XOR and bit shifting.</p>
<p>The input file is used to make the program flexible and to allow it
to generate many different <code>IFS</code>s. This has the added bonus
of hiding information about the algorithm.</p>
<p>The use of many magic numbers. I figured if I get yelled about them
in a review they must be bad, right?</p>
<p>The main obfuscation is using a <code>void *</code> as my only variable (aside from
the args for <code>main()</code>). This causes me to do much casting and pointer
arithmetic to get the correct location and completely does away with
any meaning the variables could have. This also makes the code more
convenient to read in the current form vs preprocessed. After
preprocessing there will be almost 300 casts in the code and I believe
they are all needed… (I would double check but my brain is kinda
mushy right now from chasing down a segfault in the code.)</p>
<p>The other main obfuscation being that it generates an <code>IFS</code>. Which isn’t
all that common for a program to do. I mean google only has something
like 66,000 hits for “Iterated function system” so that means it is
obscure, right?</p>
<h3 id="some-other-minor-obfuscations">Some other minor obfuscations</h3>
<p>Since I formatted it as a “normal” program I did inject something that
on first glance will looks like a possible bug. (When you run it through
a C-beautifier this will be removed.)</p>
<p>I decided not to use <code>rand()</code> to generate a pseudo-random number. Instead
I use XOR and bit shifting.</p>
<p>The input file is used to make the program flexible and to allow it to
generate many different <code>IFS</code>s. This has the added bonus of hiding
information about the algorithm.</p>
<p>The use of many magic numbers. I figured if I get yelled about them in
a review they must be bad, right?</p>
<h3 id="silly-things">Silly things</h3>
<p>The use of decimal numbers where one would expect hex. Octal numbers
where one would expect decimal. Shifts instead of divides.</p>
<p>Using xbm as the output format. This might confuse someone who
doesn’t have an X background. It happens to be easy but is probably a
very bad choice from a file size standpoint. 1024x1024 image is 641k in
size.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<p>Using xbm as the output format. This might confuse someone who doesn’t
have an X background. It happens to be easy but is probably a very bad
choice from a file size standpoint. 1024x1024 image is 641k in size.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-2006stewart"><a name="inventory"></a>Inventory for
2006/stewart</h1>
<h1 id="inventory-for-2006stewart"><a name="inventory"></a>Inventory for 2006/stewart</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/2006/stewart/stewart.c">stewart.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/stewart.orig.c">stewart.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/build">build</a>
- how to compile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/try.sh">try.sh</a>
- how to run</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/altar">altar</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/box2">box2</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/box3">box3</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/box">box</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/carpet">carpet</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/circles">circles</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/cross2">cross2</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/cross3">cross3</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/cross">cross</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/crystal">crystal</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/curve">curve</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/diamonds2">diamonds2</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/diamonds">diamonds</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/dragon2">dragon2</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/dragon3">dragon3</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/dragon">dragon</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/fern">fern</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/gasket">gasket</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/gasket_mod2">gasket_mod2</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/gasket_mod">gasket_mod</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/ioccc">ioccc</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/maze">maze</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/octagon">octagon</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/pentagon">pentagon</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/pentagons">pentagons</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/rings2">rings2</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/rings">rings</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/spirals2">spirals2</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/spirals3">spirals3</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/spirals4">spirals4</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/spirals">spirals</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/squares">squares</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/stars2">stars2</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/stars">stars</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/tree2">tree2</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/tree3">tree3</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/tree4">tree4</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/tree">tree</a>
- sample input</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/triangle">triangle</a>
- sample input</li>
<li><a href="2006_stewart.tar.bz2">2006_stewart.tar.bz2</a> - download
entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/stewart.c">stewart.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/stewart.orig.c">stewart.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/build">build</a> - how to compile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/try.sh">try.sh</a> - how to run</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/altar">altar</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/box2">box2</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/box3">box3</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/box">box</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/carpet">carpet</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/circles">circles</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/cross2">cross2</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/cross3">cross3</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/cross">cross</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/crystal">crystal</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/curve">curve</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/diamonds2">diamonds2</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/diamonds">diamonds</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/dragon2">dragon2</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/dragon3">dragon3</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/dragon">dragon</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/fern">fern</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/gasket">gasket</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/gasket_mod2">gasket_mod2</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/gasket_mod">gasket_mod</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/ioccc">ioccc</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/maze">maze</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/octagon">octagon</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/pentagon">pentagon</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/pentagons">pentagons</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/rings2">rings2</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/rings">rings</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/spirals2">spirals2</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/spirals3">spirals3</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/spirals4">spirals4</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/spirals">spirals</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/squares">squares</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/stars2">stars2</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/stars">stars</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/tree2">tree2</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/tree3">tree3</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/tree4">tree4</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/tree">tree</a> - sample input</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/triangle">triangle</a> - sample input</li>
<li><a href="2006_stewart.tar.bz2">2006_stewart.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+88 -132
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Stephen_Sykes">Stephen
Sykes</a><br> Location: <a href="../../location.html#FI">FI</a> -
<em>Republic of Finland </em> (<em>Finland</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Stephen_Sykes">Stephen Sykes</a><br>
Location: <a href="../../location.html#FI">FI</a> - <em>Republic of Finland </em> (<em>Finland</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -141,15 +141,13 @@ Sykes</a><br> Location: <a href="../../location.html#FI">FI</a> -
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<p>There is an alt version based on the author’s remarks. The <a
href="try.sh">try.sh</a> script will compile and use both but if you
wish to see the alternate version specifically see the <a
href="#alternate-code">Alternate code</a> section below.</p>
<p>There is an alt version based on the author’s remarks. The <a href="try.sh">try.sh</a>
script will compile and use both but if you wish to see the alternate version
specifically see the <a href="#alternate-code">Alternate code</a> section below.</p>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code>STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a
href="../../bugs.html#2006_sykes1">2006 sykes1 bugs</a>.</p>
<p>For more detailed information see <a href="../../bugs.html#2006_sykes1">2006 sykes1 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">./sykes1</span></span></code></pre></div>
<p>Next point your browser to the file: <code>sykes1.html</code>.</p>
@@ -158,15 +156,12 @@ href="../../bugs.html#2006_sykes1">2006 sykes1 bugs</a>.</p>
<p>Refresh your browser.</p>
<p>You might also try:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<p>This will run both the original entry and the alt code to show some
differences.</p>
<p>This will run both the original entry and the alt code to show some differences.</p>
<h3 id="also-try">Also try:</h3>
<p>If you have all day :-) and wish to find out how fast your machine
can solve the maximum:</p>
<p>If you have all day :-) and wish to find out how fast your machine can solve the
maximum:</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="bu">time</span> ./sykes1 19186</span></code></pre></div>
<p>This was done on a Rocky Linux 9.2 server with
<code>Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz</code> with 16 cores (via
HyperThreading):</p>
<p>This was done on a Rocky Linux 9.2 server with <code>Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz</code> with 16 cores (via HyperThreading):</p>
<pre><code>real 6m35.524s
user 6m35.159s
sys 0m0.002s</code></pre>
@@ -179,70 +174,58 @@ sys 0m0.110s</code></pre>
<h3 id="alternate-build">Alternate build:</h3>
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>sykes1.alt</code> as you would <code>sykes1</code>
above.</p>
<p>Use <code>sykes1.alt</code> as you would <code>sykes1</code> above.</p>
<h3 id="alternate-try">Alternate try:</h3>
<p>The <a href="try.sh">try.sh</a> script will use both versions to show
some differences. You can do so like:</p>
<div class="sourceCode" id="cb10"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<p>The <a href="try.sh">try.sh</a> script will use both versions to show some differences. You
can do so like:</p>
<div class="sourceCode" id="cb10"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Read the <a href="sykes1.html">sykes1.html</a> page source. Now then
read the C source. Confused? :-) If it’s not clear try:</p>
<div class="sourceCode" id="cb11"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="fu">diff</span> <span class="at">-s</span> sykes1.c sykes1.html</span></code></pre></div>
<p>For extra credit, understand what happens when you give this entry an
negative number argument, and why.</p>
<p>Read the <a href="sykes1.html">sykes1.html</a> page source.
Now then read the C source. Confused? :-) If it’s not clear try:</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="fu">diff</span> <span class="at">-s</span> sykes1.c sykes1.html</span></code></pre></div>
<p>For extra credit, understand what happens when you give this entry
an negative number argument, and why.</p>
<p>See the author’s remarks for how to make your own shapes as well.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This cube shaped program solves the fiendishly difficult “Bedlam
Cube”.</p>
<p>If you did not get one for Christmas, there is an <a
href="http://en.wikipedia.org/wiki/Bedlam_cube">article about these
<p>This cube shaped program solves the fiendishly difficult “Bedlam Cube”.</p>
<p>If you did not get one for Christmas, there is an <a href="http://en.wikipedia.org/wiki/Bedlam_cube">article about these
puzzles in wikipedia</a>.</p>
<p>Some instructions on how to make your own cube are in the included
file <a href="bedlam-cubes.pdf">bedlam-cubes.pdf</a>.</p>
<p>Finally, you can watch it being solved with the video file here, <a
href="solving-bedlam-cube.mp4">solving-bedlam-cube.mp4</a>.</p>
<p>Some instructions on how to make your own cube are in the included file
<a href="bedlam-cubes.pdf">bedlam-cubes.pdf</a>.</p>
<p>Finally, you can watch it being solved with the video file here,
<a href="solving-bedlam-cube.mp4">solving-bedlam-cube.mp4</a>.</p>
<p>Actually the cube is very hard to do by hand by just trying to fit it
together. I have not known anyone to solve it in this way - you would
need to be very lucky indeed to stumble across a solution.</p>
<h3 id="instructions">Instructions</h3>
<p>Compile the program, then test that it works:</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">./sykes1</span></span></code></pre></div>
<div class="sourceCode" id="cb12"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./sykes1</span></span></code></pre></div>
<p>Shortly you should see the first solution pop out on your screen. It
shows you how to build the cube piece by piece, rendered in glorious 3D
ASCII.</p>
<p>ASCII art is all very well, but you also have a web browser, right?
Well, just open the file <a href="sykes1.html">sykes1.html</a>. This
html file is just a copy of <a href="sykes1.c">sykes1.c</a>, which
helpfully contains an html document that should make the browser display
for you a nice animated GIF, showing you how to build the cube. Rendered
in glorious 3D color.</p>
shows you how to build the cube piece by piece, rendered in glorious
3D ASCII.</p>
<p>ASCII art is all very well, but you also have a web browser, right? Well, just
open the file <a href="sykes1.html">sykes1.html</a>. This html file is just a copy of
<a href="sykes1.c">sykes1.c</a>, which helpfully contains an html document that should make
the browser display for you a nice animated GIF, showing you how to build the
cube. Rendered in glorious 3D color.</p>
<p>Want to see another solution? Try:</p>
<div class="sourceCode" id="cb13"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./sykes1</span> some_number</span></code></pre></div>
<p>The program will discard solutions up to the number, and output
numbered solution. Refresh your browser window to see the new
solution.</p>
<p>Try some more - there are exactly <code>19186</code> solutions to
choose from.</p>
<div class="sourceCode" id="cb13"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./sykes1</span> some_number</span></code></pre></div>
<p>The program will discard solutions up to the number, and output numbered
solution. Refresh your browser window to see the new solution.</p>
<p>Try some more - there are exactly <code>19186</code> solutions to choose from.</p>
<p>If you have a fast machine you might try the last solution:</p>
<div class="sourceCode" id="cb14"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./sykes1</span> 19186</span></code></pre></div>
<div class="sourceCode" id="cb14"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./sykes1</span> 19186</span></code></pre></div>
<p>On my machine this takes about half an hour to run.</p>
<h3 id="implementation">Implementation</h3>
<p>The implementation is an optimized recursive algorithm that tries to
fit the pieces into the cube one by one. The cube pieces are defined
near the start of the program:</p>
<p>The implementation is an optimized recursive algorithm that tries to fit
the pieces into the cube one by one. The cube pieces are defined near
the start of the program:</p>
<div class="sourceCode" id="cb15"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> s<span class="op">[</span> <span class="op">]</span> <span class="op">=</span> <span class="op">{</span> <span class="dv">186</span><span class="op">,</span> <span class="dv">94</span><span class="op">,</span> <span class="dv">1426</span><span class="op">,</span> <span class="dv">3098</span></span>
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a> <span class="op">,</span><span class="dv">1047</span> <span class="op">,</span> <span class="dv">122</span> <span class="op">,</span> <span class="dv">1082</span> <span class="op">,</span> <span class="dv">3083</span> <span class="op">,</span> <span class="dv">1039</span></span>
<span id="cb15-3"><a href="#cb15-3" aria-hidden="true" tabindex="-1"></a> <span class="op">,</span> <span class="dv">569</span> <span class="op">,</span> <span class="dv">527</span> <span class="op">,</span> <span class="dv">1054</span> <span class="op">,</span> <span class="dv">531</span> <span class="op">}</span> <span class="op">;</span></span></code></pre></div>
<p>Each piece is a bitmap, and represents a 3x3x3 cube.</p>
<p>For instance the first piece is <code>186</code> - this is
<code>010111010</code> in binary. Written out like this you can see that
it is the cross shaped piece:</p>
<p>For instance the first piece is <code>186</code> - this is <code>010111010</code> in binary.
Written out like this you can see that it is the cross shaped piece:</p>
<pre><code>010
111
010</code></pre>
@@ -269,15 +252,14 @@ shape:</p>
+----+</code></pre>
<h3 id="making-your-own-shapes">Making your own shapes</h3>
<p>The program is in fact a general solver - you can change the shape of
the pieces, and provided that a solution is possible, it will be
found.</p>
<p>For example, if you modify line 13 of the source like this, the
program will solve for a different piece set:</p>
the pieces, and provided that a solution is possible, it will be found.</p>
<p>For example, if you modify line 13 of the source like this, the program
will solve for a different piece set:</p>
<div class="sourceCode" id="cb19"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> s<span class="op">[</span> <span class="op">]</span> <span class="op">=</span> <span class="op">{</span> <span class="dv">187</span><span class="op">,</span> <span class="dv">94</span><span class="op">,</span> <span class="dv">402</span><span class="op">,</span> <span class="dv">3098</span></span></code></pre></div>
<p>And of course you can make your own.</p>
<p>After the pieces are defined, the first thing the program does it to
fit them into a 4x4 cube. It collects every possible placing of each of
the pieces.</p>
fit them into a 4x4 cube. It collects every possible placing of each
of the pieces.</p>
<p>Once those placings are ready, the program recursively checks each
combination thereof.</p>
<p>In order to complete in a reasonable time, care is taken to eliminate
@@ -291,93 +273,67 @@ call.</p>
generated. Care must be taken to render cubes in the right order such
that pieces further back are occluded by those in front.</p>
<p>In the ASCII output care must be taken with drawing the edges of each
<code>1/64th</code> cube (edges must be removed within each piece). In
the GIF this is taken care of by color, which is graded from the back to
the front to ensure edge visibility.</p>
<code>1/64th</code> cube (edges must be removed within each piece). In the GIF
this is taken care of by color, which is graded from the back to the
front to ensure edge visibility.</p>
<h3 id="notes">Notes</h3>
<p>The whole program has just one function - <code>main()</code> - which
is recursively called. In fact if you select solution 19186 it will be
called exactly <code>159,260,759</code> times.</p>
<p>If you pick a number higher than <code>19186</code>, the program will
return a solution but it will be a rotation of one of the first
<code>19186</code>. This is because the cross shaped piece fits 48 ways
in the 4x4 cube, but only 2 of those ways are unique - you can rotate
one of those to make any of the other 46. The algorithm used always
places the cross piece first, so the first two placings of that piece
result in the <code>19186</code> unique solutions.</p>
<p>If you pick a number higher than <code>460464</code>
(<code>24x19186</code>) the program will return without outputting a
solution. If you can wait that long.</p>
<p>The whole program has just one function - <code>main()</code> - which is recursively
called. In fact if you select solution 19186 it will be called exactly
<code>159,260,759</code> times.</p>
<p>If you pick a number higher than <code>19186</code>, the program will return a
solution but it will be a rotation of one of the first <code>19186</code>. This is
because the cross shaped piece fits 48 ways in the 4x4 cube, but only
2 of those ways are unique - you can rotate one of those to make any
of the other 46. The algorithm used always places the cross piece
first, so the first two placings of that piece result in the <code>19186</code>
unique solutions.</p>
<p>If you pick a number higher than <code>460464</code> (<code>24x19186</code>) the program will
return without outputting a solution. If you can wait that long.</p>
<p>I recommend compiling with the most aggressive optimization options
your compiler supports. I find <code>--unroll-loops</code> to be helpful
with gcc.</p>
<p>The program relies on <code>long long int</code> being 64 bits, but
has no other special requirements.</p>
<p>The program is known to compile and run under gcc and Intel cc, as
well as PellesC on Windows.</p>
your compiler supports. I find <code>--unroll-loops</code> to be helpful with gcc.</p>
<p>The program relies on <code>long long int</code> being 64 bits, but has no other special
requirements.</p>
<p>The program is known to compile and run under gcc and Intel cc, as well
as PellesC on Windows.</p>
<h3 id="bugs">Bugs</h3>
<p>The program is not at all a valid html document, but fortunately
browsers have good error recovery and amongst other things will ignore
the <code>/*</code> at the beginning, and won’t mind the missing html
and head tags and the lack of end tags.</p>
the <code>/*</code> at the beginning, and won’t mind the missing html and head tags
and the lack of end tags.</p>
<p>The generated GIF is not compressed. This could be argued as an
advantage - at least I don’t violate any of those old Unisys
patents!</p>
advantage - at least I don’t violate any of those old Unisys patents!</p>
<p>The pieces aren’t really those colors. Unless you make your own.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-2006sykes1"><a name="inventory"></a>Inventory for
2006/sykes1</h1>
<h1 id="inventory-for-2006sykes1"><a name="inventory"></a>Inventory for 2006/sykes1</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/2006/sykes1/sykes1.c">sykes1.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes1/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes1/sykes1.alt.c">sykes1.alt.c</a>
- alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes1/sykes1.orig.c">sykes1.orig.c</a>
- original source</li>
<li><a href="bedlam-cubes.pdf">bedlam-cubes.pdf</a> - instructions on
how to make your own cube</li>
<li><a href="solving-bedlam-cube.mp4">solving-bedlam-cube.mp4</a> -
spoiler movie showing the solution</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes1/try.sh">try.sh</a>
- how to run</li>
<li><a href="2006_sykes1.tar.bz2">2006_sykes1.tar.bz2</a> - download
entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes1/sykes1.c">sykes1.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes1/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes1/sykes1.alt.c">sykes1.alt.c</a> - alternative source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes1/sykes1.orig.c">sykes1.orig.c</a> - original source</li>
<li><a href="bedlam-cubes.pdf">bedlam-cubes.pdf</a> - instructions on how to make your own cube</li>
<li><a href="solving-bedlam-cube.mp4">solving-bedlam-cube.mp4</a> - spoiler movie showing the solution</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes1/try.sh">try.sh</a> - how to run</li>
<li><a href="2006_sykes1.tar.bz2">2006_sykes1.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes1/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes1/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes1/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes1/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes1/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes1/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+30 -53
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Stephen_Sykes">Stephen
Sykes</a><br> Location: <a href="../../location.html#FI">FI</a> -
<em>Republic of Finland </em> (<em>Finland</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Stephen_Sykes">Stephen Sykes</a><br>
Location: <a href="../../location.html#FI">FI</a> - <em>Republic of Finland </em> (<em>Finland</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -145,78 +145,55 @@ Sykes</a><br> Location: <a href="../../location.html#FI">FI</a> -
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./sykes2</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<p>This will repeatedly remake the program and run it then sleep for one
second for a nice show of time.</p>
<p>This will repeatedly remake the program and run it then sleep for one second for
a nice show of time.</p>
<h2 id="judges-comments">Judges’ Comments:</h2>
<p>As they say, “Lather, rinse, repeat”! :-)</p>
<p>If you have the time :-), figure out how this small 1-line entry
works!</p>
<p>If you have the time :-), figure out how this small 1-line entry works!</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>At 130 characters of C code (without the newline at the end), this
should fit into the “1-liner” category.</p>
<p>The clock numerals are rendered as an old fashioned 7 segment
display. The encodings for which segments light for which number, and
for where each segment appears on screen are hidden in the two
strings.</p>
<p>When reading the program, you may want to refer to a table of
operator precedence (try <code>man 7 operator</code>) - careful choices
were made to keep the usage of brackets to a minimum, and to keep the
character count as low as possible.</p>
<p>One interesting bit of obfuscation - the null at the end of the
second string actually forms part of the lookup table.</p>
<p>Intel CC warns about the lack of a declaration for the argument to
<code>main()</code>. (<code>gcc</code> does not notice this though, even
with <code>-Wall</code>.) But anyway it can easily be declared as int at
the expense of 4 more characters.</p>
<p>The clock numerals are rendered as an old fashioned 7 segment display.
The encodings for which segments light for which number, and for where
each segment appears on screen are hidden in the two strings.</p>
<p>When reading the program, you may want to refer to a table of operator
precedence (try <code>man 7 operator</code>) - careful choices were made to keep the usage
of brackets to a minimum, and to keep the character count as low as possible.</p>
<p>One interesting bit of obfuscation - the null at the end of the second
string actually forms part of the lookup table.</p>
<p>Intel CC warns about the lack of a declaration for the argument to <code>main()</code>.
(<code>gcc</code> does not notice this though, even with <code>-Wall</code>.) But anyway it can
easily be declared as int at the expense of 4 more characters.</p>
<p>I’m not sure of the effects on a hard disk of rewriting the same file
multiple times per second for a long time. Run at your own risk!</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-2006sykes2"><a name="inventory"></a>Inventory for
2006/sykes2</h1>
<h1 id="inventory-for-2006sykes2"><a name="inventory"></a>Inventory for 2006/sykes2</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/2006/sykes2/sykes2.c">sykes2.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes2/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes2/sykes2.orig.c">sykes2.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes2/try.sh">try.sh</a>
- how to run</li>
<li><a href="2006_sykes2.tar.bz2">2006_sykes2.tar.bz2</a> - download
entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes2/sykes2.c">sykes2.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes2/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes2/sykes2.orig.c">sykes2.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes2/try.sh">try.sh</a> - how to run</li>
<li><a href="2006_sykes2.tar.bz2">2006_sykes2.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes2/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes2/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes2/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes2/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes2/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes2/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+26 -46
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Oscar_Toledo">Oscar Toledo
G.</a><br> Location: <a href="../../location.html#MX">MX</a> -
<em>United Mexican States</em> (<em>Mexico</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Oscar_Toledo">Oscar Toledo G.</a><br>
Location: <a href="../../location.html#MX">MX</a> - <em>United Mexican States</em> (<em>Mexico</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -147,71 +147,51 @@ G.</a><br> Location: <a href="../../location.html#MX">MX</a> -
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>For most of the arguments (e.g. those above) the resulting path is
not circular, but at least one starting point yields a circular
path.</p>
<p>Why do some of the “illegal” starting points work more or less as
could be expected, and some dump core?</p>
<p>For most of the arguments (e.g. those above) the resulting path
is not circular, but at least one starting point yields a circular path.</p>
<p>Why do some of the “illegal” starting points work more or less as could
be expected, and some dump core?</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>Can you place a knight on a chess board and make it visit the 64
squares without repeating them?</p>
<p>If not, this program does it, just run it with an argument giving
initial position.</p>
<p>Can you place a knight on a chess board and make it
visit the 64 squares without repeating them?</p>
<p>If not, this program does it, just run it with an argument
giving initial position.</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./toledo1</span> 11 <span class="co"># start is A8</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./toledo1</span> 18 <span class="co"># start is H8</span></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./toledo1</span> 81 <span class="co"># start is A1</span></span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a><span class="ex">./toledo1</span> 88 <span class="co"># start is H1</span></span>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a><span class="ex">./toledo1</span> 44 <span class="co"># start is D5</span></span></code></pre></div>
<p>It will print move order. The algorithm is so simple that you can
read it in the source code. At the first glance it can appear checkered.
<p>It will print move order. The algorithm is so simple that you can read
it in the source code. At the first glance it can appear checkered.
Nevertheless, don’t be dismayed, jar, jar. :-)</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-2006toledo1"><a name="inventory"></a>Inventory for
2006/toledo1</h1>
<h1 id="inventory-for-2006toledo1"><a name="inventory"></a>Inventory for 2006/toledo1</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/2006/toledo1/toledo1.c">toledo1.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo1/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo1/toledo1.orig.c">toledo1.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo1/try.sh">try.sh</a>
- how to run</li>
<li><a href="2006_toledo1.tar.bz2">2006_toledo1.tar.bz2</a> - download
entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo1/toledo1.c">toledo1.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo1/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo1/toledo1.orig.c">toledo1.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo1/try.sh">try.sh</a> - how to run</li>
<li><a href="2006_toledo1.tar.bz2">2006_toledo1.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo1/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo1/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo1/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo1/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo1/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo1/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+116 -160
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Oscar_Toledo">Oscar Toledo
G.</a><br> Location: <a href="../../location.html#MX">MX</a> -
<em>United Mexican States</em> (<em>Mexico</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Oscar_Toledo">Oscar Toledo G.</a><br>
Location: <a href="../../location.html#MX">MX</a> - <em>United Mexican States</em> (<em>Mexico</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -141,21 +141,18 @@ G.</a><br> Location: <a href="../../location.html#MX">MX</a> -
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<p>There is <a href="#alternate-code">alternate code</a> that is based
on the author’s notes for DOS/Windows. This cannot be tested by us, not
even to compile, but it appears that it should be fine, after the proper
header files were added.</p>
<p>There is <a href="#alternate-code">alternate code</a> that is based on the author’s notes
for DOS/Windows. This cannot be tested by us, not even to compile, but it appears
that it should be fine, after the proper header files were added.</p>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code>STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a
href="../../bugs.html#2006_toledo2">2006 toledo2 bugs</a>.</p>
<p>For more detailed information see <a href="../../bugs.html#2006_toledo2">2006 toledo2 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">./toledo2</span></span></code></pre></div>
<p>To end execution press <code>ctrl-z</code>. As mentioned in the
author’s remarks and in the below section, it is supposed to crash on
termination though some noted this does not seem to happen in macOS or
linux in 2023.</p>
<p>To end execution press <code>ctrl-z</code>. As mentioned in the author’s remarks and in the
below section, it is supposed to crash on termination though some noted this
does not seem to happen in macOS or linux in 2023.</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">./toledo2</span></span></code></pre></div>
<p>and then type in the following:</p>
@@ -164,56 +161,47 @@ LIST
RUN</code></pre>
<p>To end the program hit ctrl-z.</p>
<h2 id="alternate-code">Alternate code:</h2>
<p>This version, as noted, should work for DOS/Windows. It uses
non-standard functions in place of <code>read(2)</code> and
<code>write(2)</code>.</p>
<p>This version, as noted, should work for DOS/Windows. It uses non-standard
functions in place of <code>read(2)</code> and <code>write(2)</code>.</p>
<h3 id="alternate-build">Alternate build:</h3>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3>
<p>The author noted that for PC/DOS you will have to add
<code>ANSI.SYS</code> to your <code>CONFIG.SYS</code> but this is also
something we can’t test.</p>
<p>Use <code>toledeo2.alt</code> as you would <code>toledo2</code>
above.</p>
<p>The author noted that for PC/DOS you will have to add <code>ANSI.SYS</code> to your
<code>CONFIG.SYS</code> but this is also something we can’t test.</p>
<p>Use <code>toledeo2.alt</code> as you would <code>toledo2</code> above.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>We’re impressed! Last year, it was a <a
href="https://en.wikipedia.org/wiki/MOS_Technology_6502">6502</a>
emulator; this year, it’s <a
href="https://en.wikipedia.org/wiki/Intel_8080">8080</a>! It requires an
input file (<code>C</code>) to be present, but it does not have to be
one of <code>C.BASIC</code> or <code>C.BIOS</code> - you’re welcome to
write a standalone 8080 program yourself! How about <code>C.FORTH</code>
<p>We’re impressed! Last year, it was a
<a href="https://en.wikipedia.org/wiki/MOS_Technology_6502">6502</a> emulator; this year,
it’s <a href="https://en.wikipedia.org/wiki/Intel_8080">8080</a>! It requires an input file
(<code>C</code>) to be present, but it does not have to be one of <code>C.BASIC</code> or <code>C.BIOS</code> -
you’re welcome to write a standalone 8080 program yourself! How about <code>C.FORTH</code>
or <code>C.LISP</code>?</p>
<p>In addition to the functionality you could expect from a program of
this size, it allows importing files from the host file system (one by
one, so you’ll have to be patient).</p>
<p>Remember the good old days and play (or let your kids play) <a
href="https://rickadams.org/adventure/">Adventure</a> (in the directory
<code>ADVENTUR</code>); walking in a maze of twisty little passages all
alike is easier than understanding the code!</p>
<p><strong>NOTE</strong>: The <code>KAYPROII.ZIP</code> file originally
came from <a
href="http://www.retroarchive.org/cpm/os/KAYPROII.ZIP">http://www.retroarchive.org/cpm/os/KAYPROII.ZIP</a>.
For your convenience, we have included <code>KAYPROII.ZIP</code> in this
entry. Both the <code>make all</code> and the <code>make alt</code>
unzip that file, and the <code>make clobber</code> removes those files
extracted from the <code>KAYPROII.ZIP</code>.</p>
<p>In addition to the functionality you could expect from a program
of this size, it allows importing files from the host file
system (one by one, so you’ll have to be patient).</p>
<p>Remember the good old days and play (or let your kids play)
<a href="https://rickadams.org/adventure/">Adventure</a> (in the directory <code>ADVENTUR</code>);
walking in a maze of twisty little passages all alike is easier than
understanding the code!</p>
<p><strong>NOTE</strong>: The <code>KAYPROII.ZIP</code> file originally came from
<a href="http://www.retroarchive.org/cpm/os/KAYPROII.ZIP">http://www.retroarchive.org/cpm/os/KAYPROII.ZIP</a>.
For your convenience, we have included <code>KAYPROII.ZIP</code> in this entry.
Both the <code>make all</code> and the <code>make alt</code> unzip that file, and the <code>make clobber</code>
removes those files extracted from the <code>KAYPROII.ZIP</code>.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This program emulates a complete <a
href="https://en.wikipedia.org/wiki/Intel_8080">Intel(r) 8080</a>
processor, along with a teletype and a disk controller, just like at the
start of the personal computers revolution (circa 1975).</p>
<p>It needs an initial memory image to do something usable, so along
with it you will find two files: (<a href="C.BASIC">C.BASIC</a> and <a
href="C.BIOS">C.BIOS</a>). Rename <a href="C.BASIC">C.BASIC</a> to
<code>C</code> (NOTE from the judges: running <code>make</code> will do
this for you), run the emulator, and et voila! you have the public
domain Palo Alto <a href="https://en.wikipedia.org/wiki/Tiny_BASIC">Tiny
BASIC</a> (by Li-Chen Wang), published in the very first volume of <a
href="https://en.wikipedia.org/wiki/Dr._Dobb%27s_Journal">Dr. Dobb’s
<p>This program emulates a complete <a href="https://en.wikipedia.org/wiki/Intel_8080">Intel(r)
8080</a> processor, along with a teletype
and a disk controller, just like at the start of the personal computers
revolution (circa 1975).</p>
<p>It needs an initial memory image to do something usable, so along with it you
will find two files: (<a href="C.BASIC">C.BASIC</a> and <a href="C.BIOS">C.BIOS</a>). Rename
<a href="C.BASIC">C.BASIC</a> to <code>C</code> (NOTE from the judges: running <code>make</code> will do this for
you), run the emulator, and et voila! you have the public domain Palo Alto <a href="https://en.wikipedia.org/wiki/Tiny_BASIC">Tiny
BASIC</a> (by Li-Chen Wang), published in
the very first volume of <a href="https://en.wikipedia.org/wiki/Dr._Dobb%27s_Journal">Dr. Dobb’s
Journal</a>.</p>
<p>Type using uppercase letters. Here are three example programs. Press
Enter after each line:</p>
<p>Type using uppercase letters. Here are three example programs. Press Enter after
each line:</p>
<pre class="basic"><code>10 PRINT &quot;Hello, world!&quot;
LIST
RUN
@@ -229,22 +217,20 @@ RUN
30 PRINT A+B
LIST
RUN</code></pre>
<p>Press Ctrl+Z to quit. By the way, the segmentation fault is normal at
this point.</p>
<p>All good programmers started learning <a
href="https://en.wikipedia.org/wiki/BASIC">BASIC</a>, now, what about a
<p>Press Ctrl+Z to quit. By the way, the segmentation fault is
normal at this point.</p>
<p>All good programmers started learning
<a href="https://en.wikipedia.org/wiki/BASIC">BASIC</a>, now, what about a
<a href="https://en.wikipedia.org/wiki/CP/M">CP/M</a> emulator?</p>
<p>Copy <code>CPM64.COM</code> to files named <code>A</code> and
<code>B</code> (these will be the disk drives). Now rename the provided
<code>C.BIOS</code> to <code>C</code> and run the emulator.</p>
<p>Now you have a running <a
href="https://en.wikipedia.org/wiki/CP/M">CP/M</a> system!, with two
files on A: drive, <code>HALT.COM</code> to stop the emulator (so it
closes drives) and <code>IMPORT.COM</code> to introduce new files. The
two files are created automatically by the provided C.BIOS.</p>
<p>To get a complete <a
href="https://en.wikipedia.org/wiki/CP/M">CP/M</a> system, you will need
the following files from the <code>SOURCE</code> directory:</p>
<p>Copy <code>CPM64.COM</code> to files named <code>A</code> and <code>B</code> (these
will be the disk drives). Now rename the provided <code>C.BIOS</code> to <code>C</code> and
run the emulator.</p>
<p>Now you have a running <a href="https://en.wikipedia.org/wiki/CP/M">CP/M</a> system!, with
two files on A: drive, <code>HALT.COM</code> to stop the emulator (so it closes drives) and
<code>IMPORT.COM</code> to introduce new files. The two files are created automatically
by the provided C.BIOS.</p>
<p>To get a complete <a href="https://en.wikipedia.org/wiki/CP/M">CP/M</a> system, you will need the following files
from the <code>SOURCE</code> directory:</p>
<pre><code> ASM.COM DDT.COM DUMP.COM ED.COM LOAD.COM
PIP.COM STAT.COM SUBMIT.COM XSUB.COM</code></pre>
<p>To import them, you must run the emulator with an argument, by
@@ -252,59 +238,47 @@ example:</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./toledo2</span> DDT.COM</span></code></pre></div>
<p>When the <code>&gt;</code> prompt appears, do:</p>
<pre><code>IMPORT DDT.COM</code></pre>
<p>When it ends, do <code>HALT</code>, so the file is closed, and you
can start the same process with another file.</p>
<p>At this time I have tested successfully the following software from
<a href="http://www.retroarchive.org"
class="uri">http://www.retroarchive.org</a>:</p>
<p>When it ends, do <code>HALT</code>, so the file is closed, and you can start
the same process with another file.</p>
<p>At this time I have tested successfully the following software
from <a href="http://www.retroarchive.org" class="uri">http://www.retroarchive.org</a>:</p>
<ul>
<li><a href="http://www.retroarchive.org/cpm/lang/c80v30.zip"
class="uri">http://www.retroarchive.org/cpm/lang/c80v30.zip</a></li>
<li><a href="http://www.retroarchive.org/cpm/lang/Mbasic.com"
class="uri">http://www.retroarchive.org/cpm/lang/Mbasic.com</a></li>
<li><a href="http://www.retroarchive.org/cpm/business/MULTPLAN.ZIP"
class="uri">http://www.retroarchive.org/cpm/business/MULTPLAN.ZIP</a></li>
<li><a href="http://www.retroarchive.org/cpm/lang/c80v30.zip" class="uri">http://www.retroarchive.org/cpm/lang/c80v30.zip</a></li>
<li><a href="http://www.retroarchive.org/cpm/lang/Mbasic.com" class="uri">http://www.retroarchive.org/cpm/lang/Mbasic.com</a></li>
<li><a href="http://www.retroarchive.org/cpm/business/MULTPLAN.ZIP" class="uri">http://www.retroarchive.org/cpm/business/MULTPLAN.ZIP</a></li>
</ul>
<p>Some programs require installation to configure the terminal, locate
ANSI or VT-100.</p>
<p>Some programs require installation to configure the terminal,
locate ANSI or VT-100.</p>
<h3 id="what-is-an-8080">What is an 8080?</h3>
<p>It is simply the little brother of the <a
href="https://en.wikipedia.org/wiki/Zilog_Z80">Z80</a>; it has no
extended registers (<code>AF'</code>, <code>BC'</code>,
<code>DE'</code>, <code>HL'</code>, <code>IX</code> or <code>IY</code>),
no relative jumps, and no instruction beginning with <code>CB</code>,
<code>DD</code>, <code>ED</code> or <code>FD</code> exists.</p>
<p>The flags are only <code>S</code> (Sign, bit 7), <code>Z</code>
(Zero, bit 6), <code>P</code> (Parity, bit 2) and <code>C</code> (Carry,
bit 0).</p>
<p>It is simply the little brother of the
<a href="https://en.wikipedia.org/wiki/Zilog_Z80">Z80</a>; it has no extended
registers (<code>AF'</code>, <code>BC'</code>, <code>DE'</code>, <code>HL'</code>, <code>IX</code> or <code>IY</code>), no relative jumps,
and no instruction beginning with <code>CB</code>, <code>DD</code>, <code>ED</code> or <code>FD</code> exists.</p>
<p>The flags are only <code>S</code> (Sign, bit 7), <code>Z</code> (Zero, bit 6), <code>P</code> (Parity,
bit 2) and <code>C</code> (Carry, bit 0).</p>
<h3 id="porting-it">Porting it</h3>
<p>It is easy if your platform has
<code>getch()</code>/<code>kbhit()</code> and ANSI terminal:</p>
<p>It is easy if your platform has <code>getch()</code>/<code>kbhit()</code> and
ANSI terminal:</p>
<pre><code>read --&gt; Z=kbhit()?getch():0
write --&gt; putchar(7[o])
system --&gt; nothing</code></pre>
<p>Notice that you’ll have to do <code>#include &lt;conio.h&gt;</code>
as well.</p>
<p>Notice that you’ll have to do <code>#include &lt;conio.h&gt;</code> as well.</p>
<p>Also add the following to trap Ctrl-C:</p>
<pre><code> #include &lt;signal.h&gt;
signal(SIGINT, SIG_IGN);</code></pre>
<p>NOTE: this is what the <a href="#alternate-code">alternate code</a>
is for!</p>
<p>NOTE from the judges: in Unix like systems <code>getch()</code> is
part of curses but this is not what is needed.</p>
<p>On PC/DOS you need to add <code>ANSI.SYS</code> to
<code>CONFIG.SYS</code>.</p>
<p>In Unix the min 0 on <code>stty</code> is required but circa 2001 it
was not required.</p>
<p>NOTE: this is what the <a href="#alternate-code">alternate code</a> is for!</p>
<p>NOTE from the judges: in Unix like systems <code>getch()</code> is part of curses but this
is not what is needed.</p>
<p>On PC/DOS you need to add <code>ANSI.SYS</code> to <code>CONFIG.SYS</code>.</p>
<p>In Unix the min 0 on <code>stty</code> is required but circa 2001
it was not required.</p>
<h3 id="how-it-works-spoiler">How it works (SPOILER)</h3>
<p>The <code>l</code> array contains the 64K memory; it is initialized
with a boot image loaded from the <code>C</code> file. The <a
href="https://en.wikipedia.org/wiki/Program_counter">program counter</a>
is the <code>c</code> pointer and <a
href="https://en.wikipedia.org/wiki/Processor_register">registers</a>
are in <code>o[]</code>. The main loop reads every <a
href="https://en.wikipedia.org/wiki/Opcode">opcode</a> and separates
them in one of three common forms. A lot of ternary operators selects
<p>The <code>l</code> array contains the 64K memory; it is initialized with a boot image
loaded from the <code>C</code> file. The <a href="https://en.wikipedia.org/wiki/Program_counter">program
counter</a> is the <code>c</code> pointer and
<a href="https://en.wikipedia.org/wiki/Processor_register">registers</a> are in <code>o[]</code>. The
main loop reads every <a href="https://en.wikipedia.org/wiki/Opcode">opcode</a> and
separates them in one of three common forms. A lot of ternary operators selects
the instruction.</p>
<pre><code>o[0] = B register o[1] = C register
o[2] = D register o[3] = E register
@@ -325,76 +299,58 @@ FBFC - Sector
FBFD - Low cylinder
FBFE - High cylinder
FBFF - Drive.</code></pre>
<p>The BIOS is tailor made for this emulator, and helps to simplify
it.</p>
<p>The BIOS is tailor made for this emulator, and helps to simplify it.</p>
<h3 id="other-notes">Other notes</h3>
<ul>
<li>The 8080 runs at your computer speed divided between a number that I
have not calculated.</li>
<li>This obfuscated processor is created using obfuscated code produced
by an obfuscated mind; no brains were harmed during its production,
<li>The 8080 runs at your computer speed divided
between a number that I have not calculated.</li>
<li>This obfuscated processor is created using
obfuscated code produced by an obfuscated mind;
no brains were harmed during its production,
except those that tried to read the code.</li>
<li>The original version of this code was eaten by my C++ dog.</li>
<li>I intended to make it simple to understand; it uses only four C
keywords.</li>
<li>Also I discovered that braces are very useful for commenting.</li>
<li>Why bother with prototypes? Every good C programmer can develop
their C programs using only one function.</li>
<li>The original version of this code was eaten
by my C++ dog.</li>
<li>I intended to make it simple to understand;
it uses only four C keywords.</li>
<li>Also I discovered that braces are very useful
for commenting.</li>
<li>Why bother with prototypes? Every good C
programmer can develop their C programs using
only one function.</li>
</ul>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-2006toledo2"><a name="inventory"></a>Inventory for
2006/toledo2</h1>
<h1 id="inventory-for-2006toledo2"><a name="inventory"></a>Inventory for 2006/toledo2</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/2006/toledo2/toledo2.c">toledo2.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo2/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo2/toledo2.alt.c">toledo2.alt.c</a>
- alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo2/toledo2.orig.c">toledo2.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo2/KAYPROII.ZIP">KAYPROII.ZIP</a>
- zip file of CPM related files</li>
<li><a href="2006_toledo2.tar.bz2">2006_toledo2.tar.bz2</a> - download
entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo2/toledo2.c">toledo2.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo2/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo2/toledo2.alt.c">toledo2.alt.c</a> - alternative source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo2/toledo2.orig.c">toledo2.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo2/KAYPROII.ZIP">KAYPROII.ZIP</a> - zip file of CPM related files</li>
<li><a href="2006_toledo2.tar.bz2">2006_toledo2.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo2/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo2/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo2/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo2/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a href="A">A</a> - binary support file</li>
<li><a href="B">B</a> - binary support file</li>
<li><a href="C.BASIC">C.BASIC</a> - compiled BASIC file</li>
<li><a href="C.BIOS">C.BIOS</a> - basic input output system</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo2/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo2/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+68 -104
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Oscar_Toledo">Oscar Toledo
G.</a><br> Location: <a href="../../location.html#MX">MX</a> -
<em>United Mexican States</em> (<em>Mexico</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Oscar_Toledo">Oscar Toledo G.</a><br>
Location: <a href="../../location.html#MX">MX</a> - <em>United Mexican States</em> (<em>Mexico</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -141,42 +141,36 @@ G.</a><br> Location: <a href="../../location.html#MX">MX</a> -
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<p>The author provided two alternate versions, one which adds a status
bar and another that makes it text only. The author also provided a
version that they tested with Windows. See <a
href="#alternate-code">alternate code</a> below.</p>
<p>The author provided two alternate versions, one which adds a status bar and
another that makes it text only. The author also provided a version that they
tested with Windows. See <a href="#alternate-code">alternate code</a> below.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./toledo3</span> [1 <span class="kw">|</span> <span class="ex">2</span> <span class="kw">|</span> <span class="ex">3</span> <span class="pp">[</span><span class="ss">b</span><span class="pp">]</span>]</span></code></pre></div>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./toledo3</span> 1</span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>The author provided two additional versions, <a
href="toledo3-sbar.c">toledo3-sbar.c</a> and <a
href="toledo3-txt.c">toledo3-txt.c</a>. Respectively these create a
status bar and make the game text only.</p>
<p>The author provided two additional versions, <a href="toledo3-sbar.c">toledo3-sbar.c</a>
and <a href="toledo3-txt.c">toledo3-txt.c</a>. Respectively these create a status bar and
make the game text only.</p>
<h3 id="alternate-build">Alternate build:</h3>
<p>With the exception of the Windows version, these are built by
default. To build the Windows version, <a
href="toledo3.alt.c">toledo3.alt.c</a>, you will have to figure out how
to compile Windows code.</p>
<p>With the exception of the Windows version, these are built by default. To build
the Windows version, <a href="toledo3.alt.c">toledo3.alt.c</a>, you will have to figure out
how to compile Windows code.</p>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>toledo3-sbar</code> and <code>toledo3-txt</code> as you
would <code>toledo3</code> above.</p>
<p>As for the Windows version, <code>toledo3.alt</code>, we presume you
can open it like any other application.</p>
<p>Use <code>toledo3-sbar</code> and <code>toledo3-txt</code> as you would <code>toledo3</code> above.</p>
<p>As for the Windows version, <code>toledo3.alt</code>, we presume you can open it like any
other application.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>It’s pretty obvious from looking at it what this program does, since
it’s clearly spelled out in the code. The interesting question is
whether this is easier or harder to understand than the code for Deep
Blue.</p>
<p>It’s pretty obvious from looking at it what this program does,
since it’s clearly spelled out in the code. The interesting
question is whether this is easier or harder to understand than
the code for Deep Blue.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>There are so many text-based chess programs, what is that of
<code>A1</code>, <code>H5</code>, <code>C4</code>, <code>D5</code>? The
queen is really pointing to the king?</p>
<p>So I managed to do a graphical X11 chess program
(‘<code>WYSIAIE</code>’, or ‘What You See Is An IOCCC Entry’). Pointing
and clicking to move pieces is the only required action, and of course
the command-line options:</p>
<code>A1</code>, <code>H5</code>, <code>C4</code>, <code>D5</code>? The queen is really pointing to the king?</p>
<p>So I managed to do a graphical X11 chess program (‘<code>WYSIAIE</code>’, or ‘What You See
Is An IOCCC Entry’). Pointing and clicking to move pieces is the only required
action, and of course the command-line options:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./toledo3</span> <span class="co"># Two-players mode (useful if you don&#39;t have a board at hand)</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./toledo3</span> 1 <span class="co"># Human white - Computer black, level 1 (fast)</span></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./toledo3</span> 2 <span class="co"># Human white - Computer black, level 2 (medium)</span></span>
@@ -184,21 +178,18 @@ the command-line options:</p>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a><span class="ex">./toledo3</span> 1 b <span class="co"># Human black - Computer white, level 1 (fast)</span></span>
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a><span class="ex">./toledo3</span> 2 b <span class="co"># Human black - Computer white, level 2 (medium)</span></span>
<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a><span class="ex">./toledo3</span> 3 b <span class="co"># Human black - Computer white, level 3 (slow)</span></span></code></pre></div>
<p>The computer will check that your moves are legal. Full legal chess
moves are allowed, except minor promotions on human side.</p>
<p>The game will continue up to its logical conclusion, you make a
mistake and the computer surpasses you. ;)</p>
<p>The computer will check that your moves are legal. Full legal
chess moves are allowed, except minor promotions on human side.</p>
<p>The game will continue up to its logical conclusion, you make
a mistake and the computer surpasses you. ;)</p>
<h3 id="what-about-the-engine">WHAT ABOUT THE ENGINE</h3>
<p>Uses an <a
href="https://en.wikipedia.org/wiki/Alpha_Beta">alpha-beta</a> search up
to a depth of 3+level <a
href="https://en.wikipedia.org/wiki/Ply_(game_theory)">ply</a>, extended
with quiescence search, that helps playing strength, something around
<p>Uses an <a href="https://en.wikipedia.org/wiki/Alpha_Beta">alpha-beta</a> search up to a
depth of 3+level <a href="https://en.wikipedia.org/wiki/Ply_(game_theory)">ply</a>,
extended with quiescence search, that helps playing strength, something around
1500 ELO (level 1) to 1700 ELO (level 3).</p>
<p>It searches the board and generates moves for each piece located. A
lot of comparisons are used for <a
href="https://en.wikipedia.org/wiki/En_passant">en passant</a>, castling
and promotion. Would be faster with optimizations, but that
<p>It searches the board and generates moves for each piece located. A lot of
comparisons are used for <a href="https://en.wikipedia.org/wiki/En_passant">en passant</a>,
castling and promotion. Would be faster with optimizations, but that
optimizations use valuable IOCCC characters.</p>
<p>It plays a different game every time, using the C library random
number generator.</p>
@@ -207,89 +198,62 @@ using maximum optimization. With GCC you can use:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">gcc</span> <span class="at">-O3</span> <span class="at">-fexpensive-optimizations</span> prog.c <span class="at">-o</span> prog <span class="at">-lX11</span></span></code></pre></div>
<h3 id="known-features">KNOWN “FEATURES”</h3>
<ol type="1">
<li><p>Because this is my second X11 program (the first was point n
click happy face), I added sentences everywhere until it worked.
:)</p></li>
<li><p>Because this is my second X11 program (the first was
point n click happy face), I added sentences everywhere
until it worked. :)</p></li>
<li><p>It is portable to Windows (using the supplied layer.c file)
Change <code>#include &lt;X11/Xlib.h&gt; to #include "layer.c"</code>
and use a Windows compiler (only tested with Dev C/C++ 4.9.9.2) The play
level is fixed, though you can change it easily. Of course, this is an
example of an obfuscated Windows program (there exists another way of
write them?).</p></li>
<li><p>It will give warnings on compilation, so you can be sure that
your compiler works.</p></li>
Change <code>#include &lt;X11/Xlib.h&gt; to #include "layer.c"</code> and
use a Windows compiler (only tested with Dev C/C++ 4.9.9.2)
The play level is fixed, though you can change it easily.
Of course, this is an example of an obfuscated Windows
program (there exists another way of write them?).</p></li>
<li><p>It will give warnings on compilation, so you can be sure
that your compiler works.</p></li>
<li><p>It will not update the window while it is “thinking”</p></li>
<li><p>The space character has many useful applications, especially when
it comes to the character limit (8).</p></li>
<li><p>The space character has many useful applications, especially
when it comes to the character limit (8).</p></li>
<li><p>I still don’t understand what to do after semicolons. :P</p></li>
</ol>
<h3 id="challenges">CHALLENGES</h3>
<p>It is possible to convert this code into JavaScript with a graphical
interface. Can you do it?</p>
<p>Can the evaluation function be enhanced to make the program play
stronger?</p>
<p>It is possible to convert this code into JavaScript with a
graphical interface. Can you do it?</p>
<p>Can the evaluation function be enhanced to make the program
play stronger?</p>
<h3 id="upgrades">UPGRADES</h3>
<p>Using <a href="toledo3-sbar.c">toledo3-sbar.c</a> (which is too large
for this IOCCC size rules) creates a status display about gameplay on
the window title bar.</p>
<p>Using <a href="toledo3-txt.c">toledo3-txt.c</a> turns this into being
purely text based.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<p>Using <a href="toledo3-sbar.c">toledo3-sbar.c</a> (which is too large for this IOCCC size
rules) creates a status display about gameplay on the window title bar.</p>
<p>Using <a href="toledo3-txt.c">toledo3-txt.c</a> turns this into being purely text based.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-2006toledo3"><a name="inventory"></a>Inventory for
2006/toledo3</h1>
<h1 id="inventory-for-2006toledo3"><a name="inventory"></a>Inventory for 2006/toledo3</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/2006/toledo3/toledo3.c">toledo3.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo3/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo3/toledo3.alt.c">toledo3.alt.c</a>
- alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo3/toledo3.orig.c">toledo3.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo3/toledo3-sbar.c">toledo3-sbar.c</a>
- source to create a status bar</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo3/toledo3-txt.c">toledo3-txt.c</a>
- source to make the game text</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo3/layer.c">layer.c</a>
- windows portability source</li>
<li><a href="2006_toledo3.tar.bz2">2006_toledo3.tar.bz2</a> - download
entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo3/toledo3.c">toledo3.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo3/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo3/toledo3.alt.c">toledo3.alt.c</a> - alternative source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo3/toledo3.orig.c">toledo3.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo3/toledo3-sbar.c">toledo3-sbar.c</a> - source to create a status bar</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo3/toledo3-txt.c">toledo3-txt.c</a> - source to make the game text</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo3/layer.c">layer.c</a> - windows portability source</li>
<li><a href="2006_toledo3.tar.bz2">2006_toledo3.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo3/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo3/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo3/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo3/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo3/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo3/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->