build index.html for all winners
Updated manifest as per recent file changes. Updated winner `.winner.json` to reflect the manifest changes. Added [bin/all_run.sh](bin/all_run.sh) tool to run a command over all winning entries. These tools had slight improvements in the help usage message: * bin/gen-author.sh VERSION="1.3.1 2024-01-16" * bin/gen-inventory.sh VERSION="1.0.1 2024-01-16" * bin/pandoc_wrapper.sh VERSION="1.3.1 2024-01-16" * bin/subst.default.sh VERSION="1.1.1 2024-01-16" * bin/subst.winner-index.sh VERSION="1.1.1 2024-01-16" The `bin/readme2index.sh` tool was improved so that if the `index.html` file exists and the tool forms the exact same content, then the file `index.html` file is NOT touched. * bin/readme2index.sh VERSION="1.1 2024-01-16" We used the following command to generate `index.html` files for all winning entries: ```sh bin/all_run.sh -v 3 bin/readme2index.sh ``` NOTE: We have not (yet) built HTML files above the winner directory level (e.g., no year level nor top level HTML), nor have be built non-index HTML files for winners. NOTE: By default we are running `pandoc(1)` with: ``` --fail-if-warnings=true ``` This means that any problems with markdown to HTML generates an error. This is done to be sure that the HTML conversion is clean. We had to fix the following `README.md` files: * `2000/rince/README.md` The reference [^2] was never used. We made a guess that [^2] applies to the same spot as [^1]. Perhaps there is a better spot where [^2] applies? NOTE: For every reference, there MUST be some place where that reference is used. * 2012/vik/README.md The string "$...$" is assumed to be a TeX encoded string. NOTE: Every "$..$" needs to be backslashed as in "\$..\$". * 2018/burton1/README.md The reference [2] was duplicated. We changed the second [2] to [3]. NOTE: Every reference needs to have a unique number. * 2020/carlini/README.md The string "$...$" is assumed to be a TeX encoded string. NOTE: Every "$..$" needs to be backslashed as in "\$..\$". We also found 2 errors in the `author/author_handle.json` file set: * author/Anonymous_2001.json The `author/Anonymous_2001.json` file was missing. * author/Jari_Arkko.json The winner ID for `1989_jar.1` had a typo.
This commit is contained in:
1 parent
893cd915b6
commit
c1466f5165
350 files changed
+95242
-4217
No files matched your search
+267
-13
@@ -1,4 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
@@ -6,27 +8,279 @@
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- -->
|
||||
<!-- file: 2006/birken/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
|
||||
<html lang="en">
|
||||
<!-- END: this line ends content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
|
||||
<!-- -->
|
||||
<!-- START: this line starts content from: inc/head.default.html -->
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>2006 birken</title>
|
||||
<meta name="description" content="IOCCC year: 2006 IOCCC winner: birken winner index page">
|
||||
<meta name="keywords" content="IOCCC,2006,birken,winner index page">
|
||||
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>2006/birken</title>
|
||||
<meta name="description" content="2006 IOCCC winner birken">
|
||||
<meta name="keywords" content="IOCCC, 2006, IOCCC 2006, IOCCC winner, birken">
|
||||
</head>
|
||||
|
||||
<!-- END: this line ends content from: inc/head.default.html -->
|
||||
<!-- START: this line starts content from: inc/body.default.html -->
|
||||
|
||||
<body>
|
||||
|
||||
<h1>2006 birken</h1>
|
||||
<!-- END: this line ends content from: inc/body.default.html -->
|
||||
<!-- START: this line starts content from: inc/header.default.html -->
|
||||
|
||||
<p>XXX - fake content until readme2index is working - XXX</p>
|
||||
<div class="header">
|
||||
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
|
||||
<h1>The International Obfuscated C Code Contest</h1>
|
||||
<h2>2006/birken</h2>
|
||||
</div>
|
||||
|
||||
<hr style="width:50%;text-align:left;margin-left:0">
|
||||
<!-- END: this line ends content from: inc/header.default.html -->
|
||||
<!-- START: this line starts content from: inc/topnav.first.html -->
|
||||
|
||||
<!-- Start Nu Html Checker -->
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fbirken%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/birken/index.html</a></p>
|
||||
<!-- End Nu Html Checker -->
|
||||
<div class="topnav">
|
||||
<a class="Left Disabled" href="#">first entry</a>
|
||||
<a class="Left" href="../index.html">↑ 2006 ↑</a>
|
||||
<a class="Left" href="../borsanyi/index.html">borsanyi →</a>
|
||||
<a class="Right" href="#inventory">Inventory</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/topnav.first.html -->
|
||||
<!-- START: this line starts content from: inc/begin-row.default.html -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
|
||||
|
||||
<div class="leftcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/sidenav.default.html -->
|
||||
|
||||
<div class="sidenav">
|
||||
<a href="#content">Jump to contents</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
|
||||
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
|
||||
<a href="/temp-test-ioccc/winners.html">People who have won</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
|
||||
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
|
||||
<a href="/temp-test-ioccc/faq.html">FAQ</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/bugs.html">Bugs & (mis)features</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
|
||||
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
|
||||
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="#top">Jump to top</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/sidenav.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
|
||||
|
||||
<div class="rightcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||||
|
||||
<a name="content"></a>
|
||||
|
||||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||||
<!-- START: this line starts content generated by: bin/gen-author.sh -->
|
||||
|
||||
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
|
||||
href="/temp-test-ioccc/winners.html#Michael_Birken">Michael
|
||||
Birken</a><br> Location: <a
|
||||
href="/temp-test-ioccc/location.html#US">US</a></p>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/gen-author.sh -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
|
||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||
<p>The current status of this entry is:</p>
|
||||
<pre><code>STATUS: uses gets() - change to fgets() if possible</code></pre>
|
||||
<p>For more detailed information see <a href="/bugs.md#2006-birken">2006
|
||||
birken in bugs.md</a>.</p>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./birken</span> <span class="op"><</span> file.tofu</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>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>
|
||||
<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>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>
|
||||
<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>
|
||||
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
|
||||
<p>For more information, see:
|
||||
https://creativecommons.org/licenses/by-sa/4.0/</p>
|
||||
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
|
||||
|
||||
<h1 id="inventory-for-2006birken"><a name="inventory"></a>Inventory for
|
||||
2006/birken</h1>
|
||||
<h2 id="primary-files">Primary files</h2>
|
||||
<ul>
|
||||
<li><a href="index.html">index.html</a> - winner home page</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/birken.c">birken.c</a>
|
||||
- winning source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/birken/Makefile">Makefile</a>
|
||||
- winner 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
|
||||
winning source</li>
|
||||
</ul>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<ul>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/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/.winner.json">.winner.json</a>
|
||||
- description of winner in JSON</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/gen-inventory.sh -->
|
||||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||||
|
||||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-row.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/footer.default.html -->
|
||||
|
||||
<div class="footer">
|
||||
<hr>
|
||||
<h2>Coda</h2>
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fbirken%2Findex.html">Nu HTML check this web page</a></p>
|
||||
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/footer.default.html -->
|
||||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- END: this line ends content from: inc/bottom.default.html -->
|
||||
+236
-13
@@ -1,4 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
@@ -6,27 +8,248 @@
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- -->
|
||||
<!-- file: 2006/borsanyi/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
|
||||
<html lang="en">
|
||||
<!-- END: this line ends content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
|
||||
<!-- -->
|
||||
<!-- START: this line starts content from: inc/head.default.html -->
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>2006 borsanyi</title>
|
||||
<meta name="description" content="IOCCC year: 2006 IOCCC winner: borsanyi winner index page">
|
||||
<meta name="keywords" content="IOCCC,2006,borsanyi,winner index page">
|
||||
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>2006/borsanyi</title>
|
||||
<meta name="description" content="2006 IOCCC winner borsanyi">
|
||||
<meta name="keywords" content="IOCCC, 2006, IOCCC 2006, IOCCC winner, borsanyi">
|
||||
</head>
|
||||
|
||||
<!-- END: this line ends content from: inc/head.default.html -->
|
||||
<!-- START: this line starts content from: inc/body.default.html -->
|
||||
|
||||
<body>
|
||||
|
||||
<h1>2006 borsanyi</h1>
|
||||
<!-- END: this line ends content from: inc/body.default.html -->
|
||||
<!-- START: this line starts content from: inc/header.default.html -->
|
||||
|
||||
<p>XXX - fake content until readme2index is working - XXX</p>
|
||||
<div class="header">
|
||||
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
|
||||
<h1>The International Obfuscated C Code Contest</h1>
|
||||
<h2>2006/borsanyi</h2>
|
||||
</div>
|
||||
|
||||
<hr style="width:50%;text-align:left;margin-left:0">
|
||||
<!-- END: this line ends content from: inc/header.default.html -->
|
||||
<!-- START: this line starts content from: inc/topnav.mid.html -->
|
||||
|
||||
<!-- Start Nu Html Checker -->
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fborsanyi%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/borsanyi/index.html</a></p>
|
||||
<!-- End Nu Html Checker -->
|
||||
<div class="topnav">
|
||||
<a class="Left" href="../birken/index.html">← birken</a>
|
||||
<a class="Left" href="../index.html">↑ 2006 ↑</a>
|
||||
<a class="Left" href="../grothe/index.html">grothe →</a>
|
||||
<a class="Right" href="#inventory">Inventory</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/topnav.mid.html -->
|
||||
<!-- START: this line starts content from: inc/begin-row.default.html -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
|
||||
|
||||
<div class="leftcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/sidenav.default.html -->
|
||||
|
||||
<div class="sidenav">
|
||||
<a href="#content">Jump to contents</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
|
||||
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
|
||||
<a href="/temp-test-ioccc/winners.html">People who have won</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
|
||||
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
|
||||
<a href="/temp-test-ioccc/faq.html">FAQ</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/bugs.html">Bugs & (mis)features</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
|
||||
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
|
||||
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="#top">Jump to top</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/sidenav.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
|
||||
|
||||
<div class="rightcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||||
|
||||
<a name="content"></a>
|
||||
|
||||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||||
<!-- START: this line starts content generated by: bin/gen-author.sh -->
|
||||
|
||||
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
|
||||
href="/temp-test-ioccc/winners.html#Szabolcs_Borsanyi">Szabolcs
|
||||
Borsanyi</a><br> Location: <a
|
||||
href="/temp-test-ioccc/location.html#DE">DE</a></p>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/gen-author.sh -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
|
||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||
<p>The current status of this entry is:</p>
|
||||
<pre><code>STATUS: INABIAF - please **DO NOT** fix</code></pre>
|
||||
<p>For more detailed information see <a
|
||||
href="/bugs.md#2006-borsanyi">2006 borsanyi in bugs.md</a>.</p>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./borsanyi</span> string <span class="op">></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">./borsanyi</span> ioccc@example.com <span class="op">></span> example.gif</span></code></pre></div>
|
||||
<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>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>
|
||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||
<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>
|
||||
<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">></span> email.gif</span>
|
||||
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a><span class="ex">my_favourite_gif_viewer</span> email.gif</span></code></pre></div>
|
||||
<p>The address cannot be longer than 42 characters, and may consist of
|
||||
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>
|
||||
<h3 id="questions">Questions:</h3>
|
||||
<p>After analyzing the source code, try to answer these questions:</p>
|
||||
<ol type="1">
|
||||
<li>How can you add a further supported symbol?</li>
|
||||
<li>Can you alter the look of the output characters?</li>
|
||||
<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.
|
||||
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>
|
||||
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
|
||||
<p>For more information, see:
|
||||
https://creativecommons.org/licenses/by-sa/4.0/</p>
|
||||
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
|
||||
|
||||
<h1 id="inventory-for-2006borsanyi"><a name="inventory"></a>Inventory
|
||||
for 2006/borsanyi</h1>
|
||||
<h2 id="primary-files">Primary files</h2>
|
||||
<ul>
|
||||
<li><a href="index.html">index.html</a> - winner home page</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/borsanyi/borsanyi.c">borsanyi.c</a>
|
||||
- winning source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/borsanyi/Makefile">Makefile</a>
|
||||
- winner 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="2006_borsanyi.tar.bz2">2006_borsanyi.tar.bz2</a> - download
|
||||
winning source</li>
|
||||
</ul>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<ul>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/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/.winner.json">.winner.json</a>
|
||||
- description of winner in JSON</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/gen-inventory.sh -->
|
||||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||||
|
||||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-row.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/footer.default.html -->
|
||||
|
||||
<div class="footer">
|
||||
<hr>
|
||||
<h2>Coda</h2>
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fborsanyi%2Findex.html">Nu HTML check this web page</a></p>
|
||||
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/footer.default.html -->
|
||||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- END: this line ends content from: inc/bottom.default.html -->
|
||||
+277
-13
@@ -1,4 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
@@ -6,27 +8,289 @@
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- -->
|
||||
<!-- file: 2006/grothe/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
|
||||
<html lang="en">
|
||||
<!-- END: this line ends content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
|
||||
<!-- -->
|
||||
<!-- START: this line starts content from: inc/head.default.html -->
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>2006 grothe</title>
|
||||
<meta name="description" content="IOCCC year: 2006 IOCCC winner: grothe winner index page">
|
||||
<meta name="keywords" content="IOCCC,2006,grothe,winner index page">
|
||||
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>2006/grothe</title>
|
||||
<meta name="description" content="2006 IOCCC winner grothe">
|
||||
<meta name="keywords" content="IOCCC, 2006, IOCCC 2006, IOCCC winner, grothe">
|
||||
</head>
|
||||
|
||||
<!-- END: this line ends content from: inc/head.default.html -->
|
||||
<!-- START: this line starts content from: inc/body.default.html -->
|
||||
|
||||
<body>
|
||||
|
||||
<h1>2006 grothe</h1>
|
||||
<!-- END: this line ends content from: inc/body.default.html -->
|
||||
<!-- START: this line starts content from: inc/header.default.html -->
|
||||
|
||||
<p>XXX - fake content until readme2index is working - XXX</p>
|
||||
<div class="header">
|
||||
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
|
||||
<h1>The International Obfuscated C Code Contest</h1>
|
||||
<h2>2006/grothe</h2>
|
||||
</div>
|
||||
|
||||
<hr style="width:50%;text-align:left;margin-left:0">
|
||||
<!-- END: this line ends content from: inc/header.default.html -->
|
||||
<!-- START: this line starts content from: inc/topnav.mid.html -->
|
||||
|
||||
<!-- Start Nu Html Checker -->
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fgrothe%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/grothe/index.html</a></p>
|
||||
<!-- End Nu Html Checker -->
|
||||
<div class="topnav">
|
||||
<a class="Left" href="../borsanyi/index.html">← borsanyi</a>
|
||||
<a class="Left" href="../index.html">↑ 2006 ↑</a>
|
||||
<a class="Left" href="../hamre/index.html">hamre →</a>
|
||||
<a class="Right" href="#inventory">Inventory</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/topnav.mid.html -->
|
||||
<!-- START: this line starts content from: inc/begin-row.default.html -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
|
||||
|
||||
<div class="leftcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/sidenav.default.html -->
|
||||
|
||||
<div class="sidenav">
|
||||
<a href="#content">Jump to contents</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
|
||||
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
|
||||
<a href="/temp-test-ioccc/winners.html">People who have won</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
|
||||
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
|
||||
<a href="/temp-test-ioccc/faq.html">FAQ</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/bugs.html">Bugs & (mis)features</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
|
||||
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
|
||||
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="#top">Jump to top</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/sidenav.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
|
||||
|
||||
<div class="rightcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||||
|
||||
<a name="content"></a>
|
||||
|
||||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||||
<!-- START: this line starts content generated by: bin/gen-author.sh -->
|
||||
|
||||
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
|
||||
href="/temp-test-ioccc/winners.html#Aaron_Grothe">Aaron Grothe</a><br>
|
||||
Location: <a href="/temp-test-ioccc/location.html#US">US</a></p>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/gen-author.sh -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./grothe</span> carrier_freq pixelclock horizontal_total <span class="op"><</span> some_input.txt</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">./grothe</span> 65000000 10000000 1344 <span class="op"><</span> twinkle.txt</span></code></pre></div>
|
||||
<p>… and then put on your “electronic ears”. You may find using a
|
||||
tunable scanning electronic ear helps.</p>
|
||||
<p>There are other text files you may wish to try:</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">./grothe</span> 65000000 10000000 1344 <span class="op"><</span> arabian.txt</span>
|
||||
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./grothe</span> 65000000 10000000 1344 <span class="op"><</span> olympics.txt</span>
|
||||
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./grothe</span> 65000000 10000000 1344 <span class="op"><</span> test.txt</span></code></pre></div>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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">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">'{ print "pixelclock " $2 * 1000000 " horizontal_total = " $6 }'</span></span></code></pre></div>
|
||||
<p>Example from my laptops:</p>
|
||||
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./grothe</span> 65000000 10000000 1344 <span class="op"><</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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>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>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 & <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>
|
||||
</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>
|
||||
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
|
||||
<p>For more information, see:
|
||||
https://creativecommons.org/licenses/by-sa/4.0/</p>
|
||||
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
|
||||
|
||||
<h1 id="inventory-for-2006grothe"><a name="inventory"></a>Inventory for
|
||||
2006/grothe</h1>
|
||||
<h2 id="primary-files">Primary files</h2>
|
||||
<ul>
|
||||
<li><a href="index.html">index.html</a> - winner home page</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/grothe.c">grothe.c</a>
|
||||
- winning source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/grothe/Makefile">Makefile</a>
|
||||
- winner 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/twinkle.txt">twinkle.txt</a>
|
||||
- sample input</li>
|
||||
<li><a href="2006_grothe.tar.bz2">2006_grothe.tar.bz2</a> - download
|
||||
winning source</li>
|
||||
</ul>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<ul>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/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/.winner.json">.winner.json</a>
|
||||
- description of winner in JSON</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/gen-inventory.sh -->
|
||||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||||
|
||||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-row.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/footer.default.html -->
|
||||
|
||||
<div class="footer">
|
||||
<hr>
|
||||
<h2>Coda</h2>
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fgrothe%2Findex.html">Nu HTML check this web page</a></p>
|
||||
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/footer.default.html -->
|
||||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- END: this line ends content from: inc/bottom.default.html -->
|
||||
+216
-13
@@ -1,4 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
@@ -6,27 +8,228 @@
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- -->
|
||||
<!-- file: 2006/hamre/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
|
||||
<html lang="en">
|
||||
<!-- END: this line ends content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
|
||||
<!-- -->
|
||||
<!-- START: this line starts content from: inc/head.default.html -->
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>2006 hamre</title>
|
||||
<meta name="description" content="IOCCC year: 2006 IOCCC winner: hamre winner index page">
|
||||
<meta name="keywords" content="IOCCC,2006,hamre,winner index page">
|
||||
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>2006/hamre</title>
|
||||
<meta name="description" content="2006 IOCCC winner hamre">
|
||||
<meta name="keywords" content="IOCCC, 2006, IOCCC 2006, IOCCC winner, hamre">
|
||||
</head>
|
||||
|
||||
<!-- END: this line ends content from: inc/head.default.html -->
|
||||
<!-- START: this line starts content from: inc/body.default.html -->
|
||||
|
||||
<body>
|
||||
|
||||
<h1>2006 hamre</h1>
|
||||
<!-- END: this line ends content from: inc/body.default.html -->
|
||||
<!-- START: this line starts content from: inc/header.default.html -->
|
||||
|
||||
<p>XXX - fake content until readme2index is working - XXX</p>
|
||||
<div class="header">
|
||||
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
|
||||
<h1>The International Obfuscated C Code Contest</h1>
|
||||
<h2>2006/hamre</h2>
|
||||
</div>
|
||||
|
||||
<hr style="width:50%;text-align:left;margin-left:0">
|
||||
<!-- END: this line ends content from: inc/header.default.html -->
|
||||
<!-- START: this line starts content from: inc/topnav.mid.html -->
|
||||
|
||||
<!-- Start Nu Html Checker -->
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fhamre%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/hamre/index.html</a></p>
|
||||
<!-- End Nu Html Checker -->
|
||||
<div class="topnav">
|
||||
<a class="Left" href="../grothe/index.html">← grothe</a>
|
||||
<a class="Left" href="../index.html">↑ 2006 ↑</a>
|
||||
<a class="Left" href="../meyer/index.html">meyer →</a>
|
||||
<a class="Right" href="#inventory">Inventory</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/topnav.mid.html -->
|
||||
<!-- START: this line starts content from: inc/begin-row.default.html -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
|
||||
|
||||
<div class="leftcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/sidenav.default.html -->
|
||||
|
||||
<div class="sidenav">
|
||||
<a href="#content">Jump to contents</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
|
||||
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
|
||||
<a href="/temp-test-ioccc/winners.html">People who have won</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
|
||||
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
|
||||
<a href="/temp-test-ioccc/faq.html">FAQ</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/bugs.html">Bugs & (mis)features</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
|
||||
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
|
||||
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="#top">Jump to top</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/sidenav.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
|
||||
|
||||
<div class="rightcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||||
|
||||
<a name="content"></a>
|
||||
|
||||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||||
<!-- START: this line starts content generated by: bin/gen-author.sh -->
|
||||
|
||||
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
|
||||
href="/temp-test-ioccc/winners.html#Steinar_Hamre">Steinar Hamre</a><br>
|
||||
Location: <a href="/temp-test-ioccc/location.html#NO">NO</a></p>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/gen-author.sh -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./hamre</span> math_expression_string</span></code></pre></div>
|
||||
<h2 id="try">Try:</h2>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>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>
|
||||
<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>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>
|
||||
<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">'-1+4/3*(2+1/(3/2*(7/2-7/3+1/6)))/2'</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>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><= 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>
|
||||
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
|
||||
|
||||
<h1 id="inventory-for-2006hamre"><a name="inventory"></a>Inventory for
|
||||
2006/hamre</h1>
|
||||
<h2 id="primary-files">Primary files</h2>
|
||||
<ul>
|
||||
<li><a href="index.html">index.html</a> - winner home page</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/hamre/hamre.c">hamre.c</a>
|
||||
- winning source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/hamre/Makefile">Makefile</a>
|
||||
- winner 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
|
||||
winning source</li>
|
||||
</ul>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<ul>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/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/.winner.json">.winner.json</a>
|
||||
- description of winner in JSON</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/gen-inventory.sh -->
|
||||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||||
|
||||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-row.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/footer.default.html -->
|
||||
|
||||
<div class="footer">
|
||||
<hr>
|
||||
<h2>Coda</h2>
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fhamre%2Findex.html">Nu HTML check this web page</a></p>
|
||||
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/footer.default.html -->
|
||||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- END: this line ends content from: inc/bottom.default.html -->
|
||||
+259
-13
@@ -1,4 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
@@ -6,27 +8,271 @@
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- -->
|
||||
<!-- file: 2006/meyer/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
|
||||
<html lang="en">
|
||||
<!-- END: this line ends content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
|
||||
<!-- -->
|
||||
<!-- START: this line starts content from: inc/head.default.html -->
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>2006 meyer</title>
|
||||
<meta name="description" content="IOCCC year: 2006 IOCCC winner: meyer winner index page">
|
||||
<meta name="keywords" content="IOCCC,2006,meyer,winner index page">
|
||||
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>2006/meyer</title>
|
||||
<meta name="description" content="2006 IOCCC winner meyer">
|
||||
<meta name="keywords" content="IOCCC, 2006, IOCCC 2006, IOCCC winner, meyer">
|
||||
</head>
|
||||
|
||||
<!-- END: this line ends content from: inc/head.default.html -->
|
||||
<!-- START: this line starts content from: inc/body.default.html -->
|
||||
|
||||
<body>
|
||||
|
||||
<h1>2006 meyer</h1>
|
||||
<!-- END: this line ends content from: inc/body.default.html -->
|
||||
<!-- START: this line starts content from: inc/header.default.html -->
|
||||
|
||||
<p>XXX - fake content until readme2index is working - XXX</p>
|
||||
<div class="header">
|
||||
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
|
||||
<h1>The International Obfuscated C Code Contest</h1>
|
||||
<h2>2006/meyer</h2>
|
||||
</div>
|
||||
|
||||
<hr style="width:50%;text-align:left;margin-left:0">
|
||||
<!-- END: this line ends content from: inc/header.default.html -->
|
||||
<!-- START: this line starts content from: inc/topnav.mid.html -->
|
||||
|
||||
<!-- Start Nu Html Checker -->
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fmeyer%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/meyer/index.html</a></p>
|
||||
<!-- End Nu Html Checker -->
|
||||
<div class="topnav">
|
||||
<a class="Left" href="../hamre/index.html">← hamre</a>
|
||||
<a class="Left" href="../index.html">↑ 2006 ↑</a>
|
||||
<a class="Left" href="../monge/index.html">monge →</a>
|
||||
<a class="Right" href="#inventory">Inventory</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/topnav.mid.html -->
|
||||
<!-- START: this line starts content from: inc/begin-row.default.html -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
|
||||
|
||||
<div class="leftcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/sidenav.default.html -->
|
||||
|
||||
<div class="sidenav">
|
||||
<a href="#content">Jump to contents</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
|
||||
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
|
||||
<a href="/temp-test-ioccc/winners.html">People who have won</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
|
||||
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
|
||||
<a href="/temp-test-ioccc/faq.html">FAQ</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/bugs.html">Bugs & (mis)features</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
|
||||
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
|
||||
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="#top">Jump to top</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/sidenav.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
|
||||
|
||||
<div class="rightcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||||
|
||||
<a name="content"></a>
|
||||
|
||||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||||
<!-- START: this line starts content generated by: bin/gen-author.sh -->
|
||||
|
||||
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
|
||||
href="/temp-test-ioccc/winners.html#Raphael_Meyer">Raphael Meyer</a><br>
|
||||
Location: <a href="/temp-test-ioccc/location.html#US">US</a></p>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/gen-author.sh -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./meyer</span> <span class="pp">[</span><span class="ss">SEED</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">./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>
|
||||
<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>
|
||||
<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>
|
||||
</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>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
|
||||
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>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>
|
||||
<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>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>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>
|
||||
</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>
|
||||
<ol type="1">
|
||||
<li>row</li>
|
||||
<li>column</li>
|
||||
<li>3x3 block.</li>
|
||||
</ol>
|
||||
<p>Expected input for your move:</p>
|
||||
<pre><code>row column number</code></pre>
|
||||
<p>where</p>
|
||||
<pre><code>row: [a-i]
|
||||
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>
|
||||
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
|
||||
<p>For more information, see:
|
||||
https://creativecommons.org/licenses/by-sa/4.0/</p>
|
||||
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
|
||||
|
||||
<h1 id="inventory-for-2006meyer"><a name="inventory"></a>Inventory for
|
||||
2006/meyer</h1>
|
||||
<h2 id="primary-files">Primary files</h2>
|
||||
<ul>
|
||||
<li><a href="index.html">index.html</a> - winner home page</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/meyer/meyer.c">meyer.c</a>
|
||||
- winning source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/meyer/Makefile">Makefile</a>
|
||||
- winner 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
|
||||
winning source</li>
|
||||
</ul>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<ul>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/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/.winner.json">.winner.json</a>
|
||||
- description of winner in JSON</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/gen-inventory.sh -->
|
||||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||||
|
||||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-row.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/footer.default.html -->
|
||||
|
||||
<div class="footer">
|
||||
<hr>
|
||||
<h2>Coda</h2>
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fmeyer%2Findex.html">Nu HTML check this web page</a></p>
|
||||
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/footer.default.html -->
|
||||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- END: this line ends content from: inc/bottom.default.html -->
|
||||
+389
-13
@@ -1,4 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
@@ -6,27 +8,401 @@
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- -->
|
||||
<!-- file: 2006/monge/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
|
||||
<html lang="en">
|
||||
<!-- END: this line ends content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
|
||||
<!-- -->
|
||||
<!-- START: this line starts content from: inc/head.default.html -->
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>2006 monge</title>
|
||||
<meta name="description" content="IOCCC year: 2006 IOCCC winner: monge winner index page">
|
||||
<meta name="keywords" content="IOCCC,2006,monge,winner index page">
|
||||
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>2006/monge</title>
|
||||
<meta name="description" content="2006 IOCCC winner monge">
|
||||
<meta name="keywords" content="IOCCC, 2006, IOCCC 2006, IOCCC winner, monge">
|
||||
</head>
|
||||
|
||||
<!-- END: this line ends content from: inc/head.default.html -->
|
||||
<!-- START: this line starts content from: inc/body.default.html -->
|
||||
|
||||
<body>
|
||||
|
||||
<h1>2006 monge</h1>
|
||||
<!-- END: this line ends content from: inc/body.default.html -->
|
||||
<!-- START: this line starts content from: inc/header.default.html -->
|
||||
|
||||
<p>XXX - fake content until readme2index is working - XXX</p>
|
||||
<div class="header">
|
||||
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
|
||||
<h1>The International Obfuscated C Code Contest</h1>
|
||||
<h2>2006/monge</h2>
|
||||
</div>
|
||||
|
||||
<hr style="width:50%;text-align:left;margin-left:0">
|
||||
<!-- END: this line ends content from: inc/header.default.html -->
|
||||
<!-- START: this line starts content from: inc/topnav.mid.html -->
|
||||
|
||||
<!-- Start Nu Html Checker -->
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fmonge%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/monge/index.html</a></p>
|
||||
<!-- End Nu Html Checker -->
|
||||
<div class="topnav">
|
||||
<a class="Left" href="../meyer/index.html">← meyer</a>
|
||||
<a class="Left" href="../index.html">↑ 2006 ↑</a>
|
||||
<a class="Left" href="../night/index.html">night →</a>
|
||||
<a class="Right" href="#inventory">Inventory</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/topnav.mid.html -->
|
||||
<!-- START: this line starts content from: inc/begin-row.default.html -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
|
||||
|
||||
<div class="leftcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/sidenav.default.html -->
|
||||
|
||||
<div class="sidenav">
|
||||
<a href="#content">Jump to contents</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
|
||||
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
|
||||
<a href="/temp-test-ioccc/winners.html">People who have won</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
|
||||
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
|
||||
<a href="/temp-test-ioccc/faq.html">FAQ</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/bugs.html">Bugs & (mis)features</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
|
||||
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
|
||||
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="#top">Jump to top</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/sidenav.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
|
||||
|
||||
<div class="rightcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||||
|
||||
<a name="content"></a>
|
||||
|
||||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||||
<!-- START: this line starts content generated by: bin/gen-author.sh -->
|
||||
|
||||
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
|
||||
href="/temp-test-ioccc/winners.html#Maurizio_Monge">Maurizio
|
||||
Monge</a><br> Location: <a
|
||||
href="/temp-test-ioccc/location.html#IT">IT</a></p>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/gen-author.sh -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<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>
|
||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||
<p>The current status of this entry is:</p>
|
||||
<pre><code>STATUS: doesn'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.md#2006-monge">2006
|
||||
monge in bugs.md</a>.</p>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./monge</span> expression ...</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">./monge</span> <span class="st">"z = 0"</span> <span class="st">"z = z*z*z + c; Abs2(z) < 4"</span></span></code></pre></div>
|
||||
<p>Incorrect formulas will ungracefully crash the program.</p>
|
||||
<p>This is supposed to happen. As is written in the <a
|
||||
href="http://catb.org/jargon/html/F/feature.html">The Jargon
|
||||
File</a>:</p>
|
||||
<pre><code>That's not a bug, that's a feature.</code></pre>
|
||||
<h2 id="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>
|
||||
<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>
|
||||
<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>
|
||||
<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="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 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>
|
||||
<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="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. 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>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>For those who are familiar with the previous <a
|
||||
href="/winners.html">IOCCC winners</a>, this program is best described
|
||||
as “<a href="/1994/tvr/tvr.c">1994/tvr</a> meets <a
|
||||
href="/2001/bellard/bellard.c">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">
|
||||
<li>Compile using the Makefile, or just run:</li>
|
||||
</ol>
|
||||
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="fu">gcc</span> monge.c <span class="at">-o</span> monge <span class="at">-O3</span> <span class="kw">`</span><span class="ex">sdl-config</span> <span class="at">--libs</span> <span class="at">--cflags</span><span class="kw">`</span></span></code></pre></div>
|
||||
<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">"z = 0"</span> <span class="st">"z = z*z + c; Abs2(z) < 4"</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>
|
||||
</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><</code> or <code>></code>
|
||||
(<code>[expr1] < [expr2]</code> or
|
||||
<code>[expr1] > [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
|
||||
:-------- | :----------
|
||||
+,-,*,/ | Arithmetic operations, priority of * , / over +,- is
|
||||
| respected.
|
||||
|
|
||||
<,> | Compares the real parts of two complex numbers (the imaginary part
|
||||
| is ignored). Any number of conditions is allowed, the iteration
|
||||
| will just stop as soon as one of them fails.
|
||||
Abs2 | Calculates the squared norm, i.e.: Abs2(a+b*i) is (a*a+b*b)+0*i.
|
||||
Re | Extract the real part, i.e.: Re(a+b*i) is a+0*i.
|
||||
Im | Extract the imaginary part, i.e.: Im(a+b*i) is b+0*i.
|
||||
Exp | Calculates the complex exponential, i.e. Exp(a+b*i) is
|
||||
| e^a*(cos(b)+sin(b)*i).
|
||||
Ln | Calculates the principal value of the natural logarithm, i.e.
|
||||
Ln(a+b*i) is ln(a*a+b*b)/2 + atan(b/a)*i.</code></pre>
|
||||
<p>Here are a few examples of fractals you can draw:</p>
|
||||
<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">"z=1"</span> <span class="st">"z=z*z+c; Abs2(z)<4"</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">"z=c"</span> <span class="st">"z=z*z+c; Abs2(z-c)>0.0001"</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">"z=c; c=0.31+i*0.5"</span> <span class="st">"z=z*z+c; Abs2(z)<4"</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">"z=c; c=0.31+i*0.5"</span> <span class="st">"z=z*z+c; Abs2(z-c)>0.0001"</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">"z=c"</span> <span class="st">"p=z; z=0.6666*z+0.3333/(z*z); Abs2(p-z) > 0.001"</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">"z=0"</span> <span class="st">"p=z; z=z-(z*z*z + (c-1)*z - c)/(3*z*z+c-1); Abs2(p-z) > 0.001"</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">"z=0; q=0"</span> <span class="st">"t=z; z=z*z+Re(c)+Im(c)*q; q=t; Abs2(z)<4"</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">"z=c; c=0.56667-i*0.5; q=0"</span> <span class="st">"t=z; z=z*z+Re(c)+Im(c)*q; q=t; Abs2(z)<4"</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>
|
||||
<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>
|
||||
</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>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>
|
||||
<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>>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>
|
||||
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
|
||||
|
||||
<h1 id="inventory-for-2006monge"><a name="inventory"></a>Inventory for
|
||||
2006/monge</h1>
|
||||
<h2 id="primary-files">Primary files</h2>
|
||||
<ul>
|
||||
<li><a href="index.html">index.html</a> - winner home page</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/monge/monge.c">monge.c</a>
|
||||
- winning source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/monge/Makefile">Makefile</a>
|
||||
- winner 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="2006_monge.tar.bz2">2006_monge.tar.bz2</a> - download
|
||||
winning source</li>
|
||||
</ul>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<ul>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/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/.winner.json">.winner.json</a>
|
||||
- description of winner in JSON</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/gen-inventory.sh -->
|
||||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||||
|
||||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-row.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/footer.default.html -->
|
||||
|
||||
<div class="footer">
|
||||
<hr>
|
||||
<h2>Coda</h2>
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fmonge%2Findex.html">Nu HTML check this web page</a></p>
|
||||
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/footer.default.html -->
|
||||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- END: this line ends content from: inc/bottom.default.html -->
|
||||
+261
-13
@@ -1,4 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
@@ -6,27 +8,273 @@
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- -->
|
||||
<!-- file: 2006/night/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
|
||||
<html lang="en">
|
||||
<!-- END: this line ends content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
|
||||
<!-- -->
|
||||
<!-- START: this line starts content from: inc/head.default.html -->
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>2006 night</title>
|
||||
<meta name="description" content="IOCCC year: 2006 IOCCC winner: night winner index page">
|
||||
<meta name="keywords" content="IOCCC,2006,night,winner index page">
|
||||
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>2006/night</title>
|
||||
<meta name="description" content="2006 IOCCC winner night">
|
||||
<meta name="keywords" content="IOCCC, 2006, IOCCC 2006, IOCCC winner, night">
|
||||
</head>
|
||||
|
||||
<!-- END: this line ends content from: inc/head.default.html -->
|
||||
<!-- START: this line starts content from: inc/body.default.html -->
|
||||
|
||||
<body>
|
||||
|
||||
<h1>2006 night</h1>
|
||||
<!-- END: this line ends content from: inc/body.default.html -->
|
||||
<!-- START: this line starts content from: inc/header.default.html -->
|
||||
|
||||
<p>XXX - fake content until readme2index is working - XXX</p>
|
||||
<div class="header">
|
||||
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
|
||||
<h1>The International Obfuscated C Code Contest</h1>
|
||||
<h2>2006/night</h2>
|
||||
</div>
|
||||
|
||||
<hr style="width:50%;text-align:left;margin-left:0">
|
||||
<!-- END: this line ends content from: inc/header.default.html -->
|
||||
<!-- START: this line starts content from: inc/topnav.mid.html -->
|
||||
|
||||
<!-- Start Nu Html Checker -->
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fnight%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/night/index.html</a></p>
|
||||
<!-- End Nu Html Checker -->
|
||||
<div class="topnav">
|
||||
<a class="Left" href="../monge/index.html">← monge</a>
|
||||
<a class="Left" href="../index.html">↑ 2006 ↑</a>
|
||||
<a class="Left" href="../sloane/index.html">sloane →</a>
|
||||
<a class="Right" href="#inventory">Inventory</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/topnav.mid.html -->
|
||||
<!-- START: this line starts content from: inc/begin-row.default.html -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
|
||||
|
||||
<div class="leftcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/sidenav.default.html -->
|
||||
|
||||
<div class="sidenav">
|
||||
<a href="#content">Jump to contents</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
|
||||
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
|
||||
<a href="/temp-test-ioccc/winners.html">People who have won</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
|
||||
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
|
||||
<a href="/temp-test-ioccc/faq.html">FAQ</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/bugs.html">Bugs & (mis)features</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
|
||||
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
|
||||
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="#top">Jump to top</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/sidenav.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
|
||||
|
||||
<div class="rightcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||||
|
||||
<a name="content"></a>
|
||||
|
||||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||||
<!-- START: this line starts content generated by: bin/gen-author.sh -->
|
||||
|
||||
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
|
||||
href="/temp-test-ioccc/winners.html#Christopher_Night">Christopher
|
||||
Night</a><br> Location: <a
|
||||
href="/temp-test-ioccc/location.html#US">US</a></p>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/gen-author.sh -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
|
||||
<p>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>
|
||||
<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>
|
||||
<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>
|
||||
<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
|
||||
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>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>
|
||||
<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>
|
||||
<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>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>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">&</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">&</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>
|
||||
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
|
||||
<p>For more information, see:
|
||||
https://creativecommons.org/licenses/by-sa/4.0/</p>
|
||||
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
|
||||
|
||||
<h1 id="inventory-for-2006night"><a name="inventory"></a>Inventory for
|
||||
2006/night</h1>
|
||||
<h2 id="primary-files">Primary files</h2>
|
||||
<ul>
|
||||
<li><a href="index.html">index.html</a> - winner home page</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/night/night.c">night.c</a>
|
||||
- winning source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/night/Makefile">Makefile</a>
|
||||
- winner 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
|
||||
winning source</li>
|
||||
</ul>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<ul>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/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/.winner.json">.winner.json</a>
|
||||
- description of winner in JSON</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/gen-inventory.sh -->
|
||||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||||
|
||||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-row.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/footer.default.html -->
|
||||
|
||||
<div class="footer">
|
||||
<hr>
|
||||
<h2>Coda</h2>
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fnight%2Findex.html">Nu HTML check this web page</a></p>
|
||||
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/footer.default.html -->
|
||||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- END: this line ends content from: inc/bottom.default.html -->
|
||||
+258
-13
@@ -1,4 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
@@ -6,27 +8,270 @@
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- -->
|
||||
<!-- file: 2006/sloane/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
|
||||
<html lang="en">
|
||||
<!-- END: this line ends content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
|
||||
<!-- -->
|
||||
<!-- START: this line starts content from: inc/head.default.html -->
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>2006 sloane</title>
|
||||
<meta name="description" content="IOCCC year: 2006 IOCCC winner: sloane winner index page">
|
||||
<meta name="keywords" content="IOCCC,2006,sloane,winner index page">
|
||||
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>2006/sloane</title>
|
||||
<meta name="description" content="2006 IOCCC winner sloane">
|
||||
<meta name="keywords" content="IOCCC, 2006, IOCCC 2006, IOCCC winner, sloane">
|
||||
</head>
|
||||
|
||||
<!-- END: this line ends content from: inc/head.default.html -->
|
||||
<!-- START: this line starts content from: inc/body.default.html -->
|
||||
|
||||
<body>
|
||||
|
||||
<h1>2006 sloane</h1>
|
||||
<!-- END: this line ends content from: inc/body.default.html -->
|
||||
<!-- START: this line starts content from: inc/header.default.html -->
|
||||
|
||||
<p>XXX - fake content until readme2index is working - XXX</p>
|
||||
<div class="header">
|
||||
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
|
||||
<h1>The International Obfuscated C Code Contest</h1>
|
||||
<h2>2006/sloane</h2>
|
||||
</div>
|
||||
|
||||
<hr style="width:50%;text-align:left;margin-left:0">
|
||||
<!-- END: this line ends content from: inc/header.default.html -->
|
||||
<!-- START: this line starts content from: inc/topnav.mid.html -->
|
||||
|
||||
<!-- Start Nu Html Checker -->
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fsloane%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/sloane/index.html</a></p>
|
||||
<!-- End Nu Html Checker -->
|
||||
<div class="topnav">
|
||||
<a class="Left" href="../night/index.html">← night</a>
|
||||
<a class="Left" href="../index.html">↑ 2006 ↑</a>
|
||||
<a class="Left" href="../stewart/index.html">stewart →</a>
|
||||
<a class="Right" href="#inventory">Inventory</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/topnav.mid.html -->
|
||||
<!-- START: this line starts content from: inc/begin-row.default.html -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
|
||||
|
||||
<div class="leftcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/sidenav.default.html -->
|
||||
|
||||
<div class="sidenav">
|
||||
<a href="#content">Jump to contents</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
|
||||
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
|
||||
<a href="/temp-test-ioccc/winners.html">People who have won</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
|
||||
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
|
||||
<a href="/temp-test-ioccc/faq.html">FAQ</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/bugs.html">Bugs & (mis)features</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
|
||||
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
|
||||
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="#top">Jump to top</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/sidenav.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
|
||||
|
||||
<div class="rightcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||||
|
||||
<a name="content"></a>
|
||||
|
||||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||||
<!-- START: this line starts content generated by: bin/gen-author.sh -->
|
||||
|
||||
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
|
||||
href="/temp-test-ioccc/winners.html#Andy_Sloane">Andy Sloane</a><br>
|
||||
Location: <a href="/temp-test-ioccc/location.html#US">US</a></p>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/gen-author.sh -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> 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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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
|
||||
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>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>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>The logo can actually be compressed much better (ironically, by doing
|
||||
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>
|
||||
</ul>
|
||||
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
|
||||
License:</h2>
|
||||
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
|
||||
Reserved. You are free to share and adapt this file under the terms of
|
||||
this license:</p>
|
||||
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
|
||||
<p>For more information, see:
|
||||
https://creativecommons.org/licenses/by-sa/4.0/</p>
|
||||
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
|
||||
|
||||
<h1 id="inventory-for-2006sloane"><a name="inventory"></a>Inventory for
|
||||
2006/sloane</h1>
|
||||
<h2 id="primary-files">Primary files</h2>
|
||||
<ul>
|
||||
<li><a href="index.html">index.html</a> - winner home page</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sloane/sloane.c">sloane.c</a>
|
||||
- winning source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sloane/Makefile">Makefile</a>
|
||||
- winner 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
|
||||
winning source</li>
|
||||
</ul>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<ul>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/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/.winner.json">.winner.json</a>
|
||||
- description of winner in JSON</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/gen-inventory.sh -->
|
||||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||||
|
||||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-row.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/footer.default.html -->
|
||||
|
||||
<div class="footer">
|
||||
<hr>
|
||||
<h2>Coda</h2>
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fsloane%2Findex.html">Nu HTML check this web page</a></p>
|
||||
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/footer.default.html -->
|
||||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- END: this line ends content from: inc/bottom.default.html -->
|
||||
+427
-13
@@ -1,4 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
@@ -6,27 +8,439 @@
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- -->
|
||||
<!-- file: 2006/stewart/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
|
||||
<html lang="en">
|
||||
<!-- END: this line ends content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
|
||||
<!-- -->
|
||||
<!-- START: this line starts content from: inc/head.default.html -->
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>2006 stewart</title>
|
||||
<meta name="description" content="IOCCC year: 2006 IOCCC winner: stewart winner index page">
|
||||
<meta name="keywords" content="IOCCC,2006,stewart,winner index page">
|
||||
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>2006/stewart</title>
|
||||
<meta name="description" content="2006 IOCCC winner stewart">
|
||||
<meta name="keywords" content="IOCCC, 2006, IOCCC 2006, IOCCC winner, stewart">
|
||||
</head>
|
||||
|
||||
<!-- END: this line ends content from: inc/head.default.html -->
|
||||
<!-- START: this line starts content from: inc/body.default.html -->
|
||||
|
||||
<body>
|
||||
|
||||
<h1>2006 stewart</h1>
|
||||
<!-- END: this line ends content from: inc/body.default.html -->
|
||||
<!-- START: this line starts content from: inc/header.default.html -->
|
||||
|
||||
<p>XXX - fake content until readme2index is working - XXX</p>
|
||||
<div class="header">
|
||||
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
|
||||
<h1>The International Obfuscated C Code Contest</h1>
|
||||
<h2>2006/stewart</h2>
|
||||
</div>
|
||||
|
||||
<hr style="width:50%;text-align:left;margin-left:0">
|
||||
<!-- END: this line ends content from: inc/header.default.html -->
|
||||
<!-- START: this line starts content from: inc/topnav.mid.html -->
|
||||
|
||||
<!-- Start Nu Html Checker -->
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fstewart%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/stewart/index.html</a></p>
|
||||
<!-- End Nu Html Checker -->
|
||||
<div class="topnav">
|
||||
<a class="Left" href="../sloane/index.html">← sloane</a>
|
||||
<a class="Left" href="../index.html">↑ 2006 ↑</a>
|
||||
<a class="Left" href="../sykes1/index.html">sykes1 →</a>
|
||||
<a class="Right" href="#inventory">Inventory</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/topnav.mid.html -->
|
||||
<!-- START: this line starts content from: inc/begin-row.default.html -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
|
||||
|
||||
<div class="leftcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/sidenav.default.html -->
|
||||
|
||||
<div class="sidenav">
|
||||
<a href="#content">Jump to contents</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
|
||||
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
|
||||
<a href="/temp-test-ioccc/winners.html">People who have won</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
|
||||
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
|
||||
<a href="/temp-test-ioccc/faq.html">FAQ</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/bugs.html">Bugs & (mis)features</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
|
||||
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
|
||||
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="#top">Jump to top</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/sidenav.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
|
||||
|
||||
<div class="rightcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||||
|
||||
<a name="content"></a>
|
||||
|
||||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||||
<!-- START: this line starts content generated by: bin/gen-author.sh -->
|
||||
|
||||
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
|
||||
href="/temp-test-ioccc/winners.html#Thomas_Stewart">Thomas
|
||||
Stewart</a><br> Location: <a
|
||||
href="/temp-test-ioccc/location.html#US">US</a></p>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/gen-author.sh -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./stewart</span> width_and_height iterations file <span class="op">></span> file.xbm</span>
|
||||
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="ex">convert</span> file.xbm file.png</span></code></pre></div>
|
||||
<p>where <code>file</code> is one of:</p>
|
||||
<pre><code>altar box box2 box3 build carpet circles cross cross2 cross3
|
||||
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>
|
||||
<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">./stewart</span> 400 1000000 maze <span class="op">></span> maze.xbm</span>
|
||||
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="ex">convert</span> maze.xbm maze.png</span>
|
||||
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a><span class="ex">./stewart</span> 1024 1000000 gasket <span class="op">></span> gasket.xbm</span>
|
||||
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a><span class="ex">convert</span> gasket.xbm gasket.png</span>
|
||||
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a><span class="ex">./stewart</span> 1024 1500000 dragon3 <span class="op">></span> dragon3.xbm</span>
|
||||
<span id="cb4-8"><a href="#cb4-8" aria-hidden="true" tabindex="-1"></a><span class="ex">convert</span> dragon3.xbm dragon3.png</span></code></pre></div>
|
||||
<p>Now open the images in your favourite graphics viewer or a web
|
||||
browser.</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>
|
||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||
<h3 id="execution">Execution</h3>
|
||||
<p>The program should be run with the following</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">./stewart</span> <span class="op"><</span>m<span class="op">></span> <span class="op"><</span>n<span class="op">></span> <span class="op"><</span>ifs<span class="op">></span></span></code></pre></div>
|
||||
<p>where:</p>
|
||||
<pre><code>m = The size of the picture (picture will be m X m in size).
|
||||
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>
|
||||
<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">></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>
|
||||
<h3 id="entry-originality">Entry originality</h3>
|
||||
<p>In looking through past winners, 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>
|
||||
<h3 id="input-file">Input File</h3>
|
||||
<p>The format of the input file is as follows:</p>
|
||||
<pre><code><num ifs> <x min> <y min> <x max> <y max>
|
||||
<a> <b> <c> <d> <e> <f> <p>
|
||||
<a> <b> <c> <d> <e> <f> <p>
|
||||
<a> <b> <c> <d> <e> <f> <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>
|
||||
<pre><code>3 0 0 1 1
|
||||
.5 0 0 .5 0 0 .33
|
||||
.5 0 0 .5 .5 0 .33
|
||||
.5 0 0 .5 .25 .433 .34</code></pre>
|
||||
<p>or the <a href="fern">fern</a>:</p>
|
||||
<pre><code>4 -5.5 0 5.5 11
|
||||
0 0 0 .16 0 0 .01
|
||||
.85 .04 -.04 .85 0 1.6 .85
|
||||
.2 -.26 .23 .22 0 1.6 .07
|
||||
-.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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
|
||||
<p>For more information, see:
|
||||
https://creativecommons.org/licenses/by-sa/4.0/</p>
|
||||
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
|
||||
|
||||
<h1 id="inventory-for-2006stewart"><a name="inventory"></a>Inventory for
|
||||
2006/stewart</h1>
|
||||
<h2 id="primary-files">Primary files</h2>
|
||||
<ul>
|
||||
<li><a href="index.html">index.html</a> - winner home page</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/stewart.c">stewart.c</a>
|
||||
- winning source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/stewart/Makefile">Makefile</a>
|
||||
- winner 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/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
|
||||
winning source</li>
|
||||
</ul>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<ul>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/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/.winner.json">.winner.json</a>
|
||||
- description of winner in JSON</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/gen-inventory.sh -->
|
||||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||||
|
||||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-row.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/footer.default.html -->
|
||||
|
||||
<div class="footer">
|
||||
<hr>
|
||||
<h2>Coda</h2>
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fstewart%2Findex.html">Nu HTML check this web page</a></p>
|
||||
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/footer.default.html -->
|
||||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- END: this line ends content from: inc/bottom.default.html -->
|
||||
+344
-13
@@ -1,4 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
@@ -6,27 +8,356 @@
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- -->
|
||||
<!-- file: 2006/sykes1/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
|
||||
<html lang="en">
|
||||
<!-- END: this line ends content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
|
||||
<!-- -->
|
||||
<!-- START: this line starts content from: inc/head.default.html -->
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>2006 sykes1</title>
|
||||
<meta name="description" content="IOCCC year: 2006 IOCCC winner: sykes1 winner index page">
|
||||
<meta name="keywords" content="IOCCC,2006,sykes1,winner index page">
|
||||
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>2006/sykes1</title>
|
||||
<meta name="description" content="2006 IOCCC winner sykes1">
|
||||
<meta name="keywords" content="IOCCC, 2006, IOCCC 2006, IOCCC winner, sykes1">
|
||||
</head>
|
||||
|
||||
<!-- END: this line ends content from: inc/head.default.html -->
|
||||
<!-- START: this line starts content from: inc/body.default.html -->
|
||||
|
||||
<body>
|
||||
|
||||
<h1>2006 sykes1</h1>
|
||||
<!-- END: this line ends content from: inc/body.default.html -->
|
||||
<!-- START: this line starts content from: inc/header.default.html -->
|
||||
|
||||
<p>XXX - fake content until readme2index is working - XXX</p>
|
||||
<div class="header">
|
||||
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
|
||||
<h1>The International Obfuscated C Code Contest</h1>
|
||||
<h2>2006/sykes1</h2>
|
||||
</div>
|
||||
|
||||
<hr style="width:50%;text-align:left;margin-left:0">
|
||||
<!-- END: this line ends content from: inc/header.default.html -->
|
||||
<!-- START: this line starts content from: inc/topnav.mid.html -->
|
||||
|
||||
<!-- Start Nu Html Checker -->
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fsykes1%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/sykes1/index.html</a></p>
|
||||
<!-- End Nu Html Checker -->
|
||||
<div class="topnav">
|
||||
<a class="Left" href="../stewart/index.html">← stewart</a>
|
||||
<a class="Left" href="../index.html">↑ 2006 ↑</a>
|
||||
<a class="Left" href="../sykes2/index.html">sykes2 →</a>
|
||||
<a class="Right" href="#inventory">Inventory</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/topnav.mid.html -->
|
||||
<!-- START: this line starts content from: inc/begin-row.default.html -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
|
||||
|
||||
<div class="leftcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/sidenav.default.html -->
|
||||
|
||||
<div class="sidenav">
|
||||
<a href="#content">Jump to contents</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
|
||||
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
|
||||
<a href="/temp-test-ioccc/winners.html">People who have won</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
|
||||
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
|
||||
<a href="/temp-test-ioccc/faq.html">FAQ</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/bugs.html">Bugs & (mis)features</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
|
||||
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
|
||||
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="#top">Jump to top</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/sidenav.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
|
||||
|
||||
<div class="rightcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||||
|
||||
<a name="content"></a>
|
||||
|
||||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||||
<!-- START: this line starts content generated by: bin/gen-author.sh -->
|
||||
|
||||
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
|
||||
href="/temp-test-ioccc/winners.html#Stephen_Sykes">Stephen Sykes</a><br>
|
||||
Location: <a href="/temp-test-ioccc/location.html#FI">FI</a></p>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/gen-author.sh -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
|
||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||
<p>The current status of this entry is:</p>
|
||||
<pre><code>STATUS: INABIAF - please **DO NOT** fix</code></pre>
|
||||
<p>For more detailed information see <a href="/bugs.md#2006-sykes1">2006
|
||||
sykes1 in bugs.md</a>.</p>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./sykes1</span></span></code></pre></div>
|
||||
<p>Next point your browser to the file: <code>sykes1.html</code>.</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">./sykes1</span> 10</span></code></pre></div>
|
||||
<p>Refresh your browser.</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>
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="bu">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>
|
||||
<pre><code>real 6m35.524s
|
||||
user 6m35.159s
|
||||
sys 0m0.002s</code></pre>
|
||||
<p>and done with macOS Sonoma with the Max M1 chip:</p>
|
||||
<pre><code>real 7m10.786s
|
||||
user 7m8.322s
|
||||
sys 0m0.110s</code></pre>
|
||||
<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="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="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
|
||||
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 at <a
|
||||
href="https://www.youtube.com/watch?v=a8s1AcYMLBc"
|
||||
class="uri">https://www.youtube.com/watch?v=a8s1AcYMLBc</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="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">./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>
|
||||
<p>Want to see another solution? Try:</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">./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="cb11"><pre
|
||||
class="sourceCode sh"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./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>
|
||||
<div class="sourceCode" id="cb12"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb12-1"><a href="#cb12-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="cb12-2"><a href="#cb12-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="cb12-3"><a href="#cb12-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>
|
||||
<pre><code>010
|
||||
111
|
||||
010</code></pre>
|
||||
<p>The other pieces are defined similarly. Most of the rest require more
|
||||
than one layer, such as piece 3 (<code>1426</code>):</p>
|
||||
<pre><code>000
|
||||
000
|
||||
010
|
||||
|
||||
110
|
||||
010
|
||||
010</code></pre>
|
||||
<p>Imagine the two layers on top of each other, and you should see this
|
||||
shape:</p>
|
||||
<pre><code> +---------+
|
||||
/ +----+ /|
|
||||
+-/ /| / |
|
||||
|+----+ |/ +
|
||||
|| | + /
|
||||
+| | /
|
||||
| | /
|
||||
| | /
|
||||
| |/
|
||||
+----+</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>
|
||||
<div class="sourceCode" id="cb16"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb16-1"><a href="#cb16-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>
|
||||
<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
|
||||
any branches that cannot result in a solution. This is done by checking
|
||||
after each placing if all the remaining pieces can be placed somewhere,
|
||||
and that all the free space in the cube can be filled by at least one
|
||||
viable placing. Also if a piece is found to only have one possible
|
||||
placing, it is placed immediately without invoking a recursive function
|
||||
call.</p>
|
||||
<p>Once the solution is found, the ASCII and GIF representations are
|
||||
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>
|
||||
<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>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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
|
||||
<p>For more information, see:
|
||||
https://creativecommons.org/licenses/by-sa/4.0/</p>
|
||||
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
|
||||
|
||||
<h1 id="inventory-for-2006sykes1"><a name="inventory"></a>Inventory for
|
||||
2006/sykes1</h1>
|
||||
<h2 id="primary-files">Primary files</h2>
|
||||
<ul>
|
||||
<li><a href="index.html">index.html</a> - winner home page</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes1/sykes1.c">sykes1.c</a>
|
||||
- winning source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes1/Makefile">Makefile</a>
|
||||
- winner 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
|
||||
winning source</li>
|
||||
</ul>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<ul>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/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/.winner.json">.winner.json</a>
|
||||
- description of winner in JSON</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/gen-inventory.sh -->
|
||||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||||
|
||||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-row.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/footer.default.html -->
|
||||
|
||||
<div class="footer">
|
||||
<hr>
|
||||
<h2>Coda</h2>
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fsykes1%2Findex.html">Nu HTML check this web page</a></p>
|
||||
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/footer.default.html -->
|
||||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- END: this line ends content from: inc/bottom.default.html -->
|
||||
+204
-13
@@ -1,4 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
@@ -6,27 +8,216 @@
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- -->
|
||||
<!-- file: 2006/sykes2/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
|
||||
<html lang="en">
|
||||
<!-- END: this line ends content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
|
||||
<!-- -->
|
||||
<!-- START: this line starts content from: inc/head.default.html -->
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>2006 sykes2</title>
|
||||
<meta name="description" content="IOCCC year: 2006 IOCCC winner: sykes2 winner index page">
|
||||
<meta name="keywords" content="IOCCC,2006,sykes2,winner index page">
|
||||
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>2006/sykes2</title>
|
||||
<meta name="description" content="2006 IOCCC winner sykes2">
|
||||
<meta name="keywords" content="IOCCC, 2006, IOCCC 2006, IOCCC winner, sykes2">
|
||||
</head>
|
||||
|
||||
<!-- END: this line ends content from: inc/head.default.html -->
|
||||
<!-- START: this line starts content from: inc/body.default.html -->
|
||||
|
||||
<body>
|
||||
|
||||
<h1>2006 sykes2</h1>
|
||||
<!-- END: this line ends content from: inc/body.default.html -->
|
||||
<!-- START: this line starts content from: inc/header.default.html -->
|
||||
|
||||
<p>XXX - fake content until readme2index is working - XXX</p>
|
||||
<div class="header">
|
||||
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
|
||||
<h1>The International Obfuscated C Code Contest</h1>
|
||||
<h2>2006/sykes2</h2>
|
||||
</div>
|
||||
|
||||
<hr style="width:50%;text-align:left;margin-left:0">
|
||||
<!-- END: this line ends content from: inc/header.default.html -->
|
||||
<!-- START: this line starts content from: inc/topnav.mid.html -->
|
||||
|
||||
<!-- Start Nu Html Checker -->
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fsykes2%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/sykes2/index.html</a></p>
|
||||
<!-- End Nu Html Checker -->
|
||||
<div class="topnav">
|
||||
<a class="Left" href="../sykes1/index.html">← sykes1</a>
|
||||
<a class="Left" href="../index.html">↑ 2006 ↑</a>
|
||||
<a class="Left" href="../toledo1/index.html">toledo1 →</a>
|
||||
<a class="Right" href="#inventory">Inventory</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/topnav.mid.html -->
|
||||
<!-- START: this line starts content from: inc/begin-row.default.html -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
|
||||
|
||||
<div class="leftcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/sidenav.default.html -->
|
||||
|
||||
<div class="sidenav">
|
||||
<a href="#content">Jump to contents</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
|
||||
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
|
||||
<a href="/temp-test-ioccc/winners.html">People who have won</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
|
||||
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
|
||||
<a href="/temp-test-ioccc/faq.html">FAQ</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/bugs.html">Bugs & (mis)features</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
|
||||
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
|
||||
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="#top">Jump to top</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/sidenav.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
|
||||
|
||||
<div class="rightcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||||
|
||||
<a name="content"></a>
|
||||
|
||||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||||
<!-- START: this line starts content generated by: bin/gen-author.sh -->
|
||||
|
||||
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
|
||||
href="/temp-test-ioccc/winners.html#Stephen_Sykes">Stephen Sykes</a><br>
|
||||
Location: <a href="/temp-test-ioccc/location.html#FI">FI</a></p>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/gen-author.sh -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
|
||||
<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">./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>
|
||||
<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>
|
||||
<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>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>
|
||||
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
|
||||
<p>For more information, see:
|
||||
https://creativecommons.org/licenses/by-sa/4.0/</p>
|
||||
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
|
||||
|
||||
<h1 id="inventory-for-2006sykes2"><a name="inventory"></a>Inventory for
|
||||
2006/sykes2</h1>
|
||||
<h2 id="primary-files">Primary files</h2>
|
||||
<ul>
|
||||
<li><a href="index.html">index.html</a> - winner home page</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes2/sykes2.c">sykes2.c</a>
|
||||
- winning source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/sykes2/Makefile">Makefile</a>
|
||||
- winner 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
|
||||
winning source</li>
|
||||
</ul>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<ul>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/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/.winner.json">.winner.json</a>
|
||||
- description of winner in JSON</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/gen-inventory.sh -->
|
||||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||||
|
||||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-row.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/footer.default.html -->
|
||||
|
||||
<div class="footer">
|
||||
<hr>
|
||||
<h2>Coda</h2>
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Fsykes2%2Findex.html">Nu HTML check this web page</a></p>
|
||||
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/footer.default.html -->
|
||||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- END: this line ends content from: inc/bottom.default.html -->
|
||||
+200
-13
@@ -1,4 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
@@ -6,27 +8,212 @@
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- -->
|
||||
<!-- file: 2006/toledo1/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
|
||||
<html lang="en">
|
||||
<!-- END: this line ends content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
|
||||
<!-- -->
|
||||
<!-- START: this line starts content from: inc/head.default.html -->
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>2006 toledo1</title>
|
||||
<meta name="description" content="IOCCC year: 2006 IOCCC winner: toledo1 winner index page">
|
||||
<meta name="keywords" content="IOCCC,2006,toledo1,winner index page">
|
||||
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>2006/toledo1</title>
|
||||
<meta name="description" content="2006 IOCCC winner toledo1">
|
||||
<meta name="keywords" content="IOCCC, 2006, IOCCC 2006, IOCCC winner, toledo1">
|
||||
</head>
|
||||
|
||||
<!-- END: this line ends content from: inc/head.default.html -->
|
||||
<!-- START: this line starts content from: inc/body.default.html -->
|
||||
|
||||
<body>
|
||||
|
||||
<h1>2006 toledo1</h1>
|
||||
<!-- END: this line ends content from: inc/body.default.html -->
|
||||
<!-- START: this line starts content from: inc/header.default.html -->
|
||||
|
||||
<p>XXX - fake content until readme2index is working - XXX</p>
|
||||
<div class="header">
|
||||
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
|
||||
<h1>The International Obfuscated C Code Contest</h1>
|
||||
<h2>2006/toledo1</h2>
|
||||
</div>
|
||||
|
||||
<hr style="width:50%;text-align:left;margin-left:0">
|
||||
<!-- END: this line ends content from: inc/header.default.html -->
|
||||
<!-- START: this line starts content from: inc/topnav.mid.html -->
|
||||
|
||||
<!-- Start Nu Html Checker -->
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Ftoledo1%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/toledo1/index.html</a></p>
|
||||
<!-- End Nu Html Checker -->
|
||||
<div class="topnav">
|
||||
<a class="Left" href="../sykes2/index.html">← sykes2</a>
|
||||
<a class="Left" href="../index.html">↑ 2006 ↑</a>
|
||||
<a class="Left" href="../toledo2/index.html">toledo2 →</a>
|
||||
<a class="Right" href="#inventory">Inventory</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/topnav.mid.html -->
|
||||
<!-- START: this line starts content from: inc/begin-row.default.html -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
|
||||
|
||||
<div class="leftcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/sidenav.default.html -->
|
||||
|
||||
<div class="sidenav">
|
||||
<a href="#content">Jump to contents</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
|
||||
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
|
||||
<a href="/temp-test-ioccc/winners.html">People who have won</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
|
||||
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
|
||||
<a href="/temp-test-ioccc/faq.html">FAQ</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/bugs.html">Bugs & (mis)features</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
|
||||
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
|
||||
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="#top">Jump to top</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/sidenav.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
|
||||
|
||||
<div class="rightcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||||
|
||||
<a name="content"></a>
|
||||
|
||||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||||
<!-- START: this line starts content generated by: bin/gen-author.sh -->
|
||||
|
||||
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
|
||||
href="/temp-test-ioccc/winners.html#Oscar_Toledo">Oscar Toledo
|
||||
G.</a><br> Location: <a
|
||||
href="/temp-test-ioccc/location.html#MX">MX</a></p>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/gen-author.sh -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./toledo1</span> <span class="pp">[</span><span class="ss">0</span><span class="pp">-</span><span class="ss">9</span><span class="pp">][</span><span class="ss">0</span><span class="pp">-</span><span class="ss">9</span><span class="pp">]</span></span></code></pre></div>
|
||||
<p>where <code>[0-9][0-9]</code> is a two digit number.</p>
|
||||
<h2 id="try">Try:</h2>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./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>
|
||||
<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>
|
||||
<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.
|
||||
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>
|
||||
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
|
||||
<p>For more information, see:
|
||||
https://creativecommons.org/licenses/by-sa/4.0/</p>
|
||||
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
|
||||
|
||||
<h1 id="inventory-for-2006toledo1"><a name="inventory"></a>Inventory for
|
||||
2006/toledo1</h1>
|
||||
<h2 id="primary-files">Primary files</h2>
|
||||
<ul>
|
||||
<li><a href="index.html">index.html</a> - winner home page</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo1/toledo1.c">toledo1.c</a>
|
||||
- winning source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo1/Makefile">Makefile</a>
|
||||
- winner 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
|
||||
winning source</li>
|
||||
</ul>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<ul>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/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/.winner.json">.winner.json</a>
|
||||
- description of winner in JSON</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/gen-inventory.sh -->
|
||||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||||
|
||||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-row.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/footer.default.html -->
|
||||
|
||||
<div class="footer">
|
||||
<hr>
|
||||
<h2>Coda</h2>
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Ftoledo1%2Findex.html">Nu HTML check this web page</a></p>
|
||||
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/footer.default.html -->
|
||||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- END: this line ends content from: inc/bottom.default.html -->
|
||||
+383
-13
@@ -1,4 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
@@ -6,27 +8,395 @@
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- -->
|
||||
<!-- file: 2006/toledo2/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
|
||||
<html lang="en">
|
||||
<!-- END: this line ends content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
|
||||
<!-- -->
|
||||
<!-- START: this line starts content from: inc/head.default.html -->
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>2006 toledo2</title>
|
||||
<meta name="description" content="IOCCC year: 2006 IOCCC winner: toledo2 winner index page">
|
||||
<meta name="keywords" content="IOCCC,2006,toledo2,winner index page">
|
||||
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>2006/toledo2</title>
|
||||
<meta name="description" content="2006 IOCCC winner toledo2">
|
||||
<meta name="keywords" content="IOCCC, 2006, IOCCC 2006, IOCCC winner, toledo2">
|
||||
</head>
|
||||
|
||||
<!-- END: this line ends content from: inc/head.default.html -->
|
||||
<!-- START: this line starts content from: inc/body.default.html -->
|
||||
|
||||
<body>
|
||||
|
||||
<h1>2006 toledo2</h1>
|
||||
<!-- END: this line ends content from: inc/body.default.html -->
|
||||
<!-- START: this line starts content from: inc/header.default.html -->
|
||||
|
||||
<p>XXX - fake content until readme2index is working - XXX</p>
|
||||
<div class="header">
|
||||
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
|
||||
<h1>The International Obfuscated C Code Contest</h1>
|
||||
<h2>2006/toledo2</h2>
|
||||
</div>
|
||||
|
||||
<hr style="width:50%;text-align:left;margin-left:0">
|
||||
<!-- END: this line ends content from: inc/header.default.html -->
|
||||
<!-- START: this line starts content from: inc/topnav.mid.html -->
|
||||
|
||||
<!-- Start Nu Html Checker -->
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Ftoledo2%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/toledo2/index.html</a></p>
|
||||
<!-- End Nu Html Checker -->
|
||||
<div class="topnav">
|
||||
<a class="Left" href="../toledo1/index.html">← toledo1</a>
|
||||
<a class="Left" href="../index.html">↑ 2006 ↑</a>
|
||||
<a class="Left" href="../toledo3/index.html">toledo3 →</a>
|
||||
<a class="Right" href="#inventory">Inventory</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/topnav.mid.html -->
|
||||
<!-- START: this line starts content from: inc/begin-row.default.html -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
|
||||
|
||||
<div class="leftcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/sidenav.default.html -->
|
||||
|
||||
<div class="sidenav">
|
||||
<a href="#content">Jump to contents</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
|
||||
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
|
||||
<a href="/temp-test-ioccc/winners.html">People who have won</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
|
||||
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
|
||||
<a href="/temp-test-ioccc/faq.html">FAQ</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/bugs.html">Bugs & (mis)features</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
|
||||
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
|
||||
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="#top">Jump to top</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/sidenav.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
|
||||
|
||||
<div class="rightcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||||
|
||||
<a name="content"></a>
|
||||
|
||||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||||
<!-- START: this line starts content generated by: bin/gen-author.sh -->
|
||||
|
||||
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
|
||||
href="/temp-test-ioccc/winners.html#Oscar_Toledo">Oscar Toledo
|
||||
G.</a><br> Location: <a
|
||||
href="/temp-test-ioccc/location.html#MX">MX</a></p>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/gen-author.sh -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
|
||||
<p>There is <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.md#2006-toledo2">2006 toledo2 in bugs.md</a>.</p>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./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>
|
||||
<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>
|
||||
<pre><code>10 PRINT "HELLO WORLD!"
|
||||
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>
|
||||
<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>
|
||||
<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>
|
||||
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>
|
||||
<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
|
||||
Journal</a>.</p>
|
||||
<p>Type using uppercase letters. Here are three example programs. Press
|
||||
Enter after each line:</p>
|
||||
<pre class="basic"><code>10 PRINT "Hello, world!"
|
||||
LIST
|
||||
RUN
|
||||
|
||||
10 FOR A=1 TO 10
|
||||
20 PRINT A\
|
||||
30 NEXT A\
|
||||
LIST\
|
||||
RUN
|
||||
|
||||
10 INPUT A
|
||||
20 INPUT B
|
||||
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
|
||||
<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>
|
||||
<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
|
||||
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>></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>
|
||||
<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>
|
||||
</ul>
|
||||
<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>
|
||||
<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>
|
||||
<pre><code>read --> Z=kbhit()?getch():0
|
||||
write --> putchar(7[o])
|
||||
system --> nothing</code></pre>
|
||||
<p>Notice that you’ll have to do <code>#include <conio.h></code>
|
||||
as well.</p>
|
||||
<p>Also add the following to trap Ctrl-C:</p>
|
||||
<pre><code> #include <signal.h>
|
||||
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>
|
||||
<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
|
||||
the instruction.</p>
|
||||
<pre><code>o[0] = B register o[1] = C register
|
||||
o[2] = D register o[3] = E register
|
||||
o[4] = H register o[5] = L register
|
||||
o[6] = Flags o[7] = A or accumulator</code></pre>
|
||||
<p>The following instructions do peripheral operation:</p>
|
||||
<pre><code>76 Quits emulator
|
||||
DB 00 Reads key pressed status
|
||||
DB 01 Reads key
|
||||
DB 02 Reads byte from file (Carry=EOF)
|
||||
D3 xx Writes byte from acc. to console
|
||||
ED ED 02 Reads sector
|
||||
ED ED 03 Writes sector</code></pre>
|
||||
<p>Memory addresses:</p>
|
||||
<pre><code>FBFA = Low source/target direction
|
||||
FBFB - High source/target direction
|
||||
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>
|
||||
<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,
|
||||
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>
|
||||
</ul>
|
||||
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
|
||||
License:</h2>
|
||||
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
|
||||
Reserved. You are free to share and adapt this file under the terms of
|
||||
this license:</p>
|
||||
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
|
||||
<p>For more information, see:
|
||||
https://creativecommons.org/licenses/by-sa/4.0/</p>
|
||||
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
|
||||
|
||||
<h1 id="inventory-for-2006toledo2"><a name="inventory"></a>Inventory for
|
||||
2006/toledo2</h1>
|
||||
<h2 id="primary-files">Primary files</h2>
|
||||
<ul>
|
||||
<li><a href="index.html">index.html</a> - winner home page</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo2/toledo2.c">toledo2.c</a>
|
||||
- winning source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo2/Makefile">Makefile</a>
|
||||
- winner 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
|
||||
winning source</li>
|
||||
</ul>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<ul>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/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="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo2/.winner.json">.winner.json</a>
|
||||
- description of winner in JSON</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>
|
||||
</ul>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
|
||||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||||
|
||||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-row.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/footer.default.html -->
|
||||
|
||||
<div class="footer">
|
||||
<hr>
|
||||
<h2>Coda</h2>
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Ftoledo2%2Findex.html">Nu HTML check this web page</a></p>
|
||||
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/footer.default.html -->
|
||||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- END: this line ends content from: inc/bottom.default.html -->
|
||||
+278
-13
@@ -1,4 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
@@ -6,27 +8,290 @@
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- -->
|
||||
<!-- file: 2006/toledo3/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
|
||||
<html lang="en">
|
||||
<!-- END: this line ends content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
|
||||
<!-- -->
|
||||
<!-- START: this line starts content from: inc/head.default.html -->
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>2006 toledo3</title>
|
||||
<meta name="description" content="IOCCC year: 2006 IOCCC winner: toledo3 winner index page">
|
||||
<meta name="keywords" content="IOCCC,2006,toledo3,winner index page">
|
||||
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>2006/toledo3</title>
|
||||
<meta name="description" content="2006 IOCCC winner toledo3">
|
||||
<meta name="keywords" content="IOCCC, 2006, IOCCC 2006, IOCCC winner, toledo3">
|
||||
</head>
|
||||
|
||||
<!-- END: this line ends content from: inc/head.default.html -->
|
||||
<!-- START: this line starts content from: inc/body.default.html -->
|
||||
|
||||
<body>
|
||||
|
||||
<h1>2006 toledo3</h1>
|
||||
<!-- END: this line ends content from: inc/body.default.html -->
|
||||
<!-- START: this line starts content from: inc/header.default.html -->
|
||||
|
||||
<p>XXX - fake content until readme2index is working - XXX</p>
|
||||
<div class="header">
|
||||
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
|
||||
<h1>The International Obfuscated C Code Contest</h1>
|
||||
<h2>2006/toledo3</h2>
|
||||
</div>
|
||||
|
||||
<hr style="width:50%;text-align:left;margin-left:0">
|
||||
<!-- END: this line ends content from: inc/header.default.html -->
|
||||
<!-- START: this line starts content from: inc/topnav.last.html -->
|
||||
|
||||
<!-- Start Nu Html Checker -->
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Ftoledo3%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2006/toledo3/index.html</a></p>
|
||||
<!-- End Nu Html Checker -->
|
||||
<div class="topnav">
|
||||
<a class="Left" href="../toledo2/index.html">← toledo2</a>
|
||||
<a class="Left" href="../index.html">↑ 2006 ↑</a>
|
||||
<a class="Left Disabled" href="#">last entry</a>
|
||||
<a class="Right" href="#inventory">Inventory</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/topnav.last.html -->
|
||||
<!-- START: this line starts content from: inc/begin-row.default.html -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
|
||||
|
||||
<div class="leftcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/sidenav.default.html -->
|
||||
|
||||
<div class="sidenav">
|
||||
<a href="#content">Jump to contents</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
|
||||
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
|
||||
<a href="/temp-test-ioccc/winners.html">People who have won</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
|
||||
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
|
||||
<a href="/temp-test-ioccc/faq.html">FAQ</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/bugs.html">Bugs & (mis)features</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
|
||||
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
|
||||
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="#top">Jump to top</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/sidenav.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
|
||||
|
||||
<div class="rightcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||||
|
||||
<a name="content"></a>
|
||||
|
||||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||||
<!-- START: this line starts content generated by: bin/gen-author.sh -->
|
||||
|
||||
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
|
||||
href="/temp-test-ioccc/winners.html#Oscar_Toledo">Oscar Toledo
|
||||
G.</a><br> Location: <a
|
||||
href="/temp-test-ioccc/location.html#MX">MX</a></p>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/gen-author.sh -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
|
||||
<p>The 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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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'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>
|
||||
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a><span class="ex">./toledo3</span> 3 <span class="co"># Human white - Computer black, level 3 (slow)</span></span>
|
||||
<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>
|
||||
<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
|
||||
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
|
||||
optimizations use valuable IOCCC characters.</p>
|
||||
<p>It plays a different game every time, using the C library random
|
||||
number generator.</p>
|
||||
<p>Because it is resource-hungry, I strongly recommend to compile it
|
||||
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>It is portable to Windows (using the supplied layer.c file)
|
||||
Change <code>#include <X11/Xlib.h> 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>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>
|
||||
<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>
|
||||
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
|
||||
<p>For more information, see:
|
||||
https://creativecommons.org/licenses/by-sa/4.0/</p>
|
||||
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
|
||||
|
||||
<h1 id="inventory-for-2006toledo3"><a name="inventory"></a>Inventory for
|
||||
2006/toledo3</h1>
|
||||
<h2 id="primary-files">Primary files</h2>
|
||||
<ul>
|
||||
<li><a href="index.html">index.html</a> - winner home page</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo3/toledo3.c">toledo3.c</a>
|
||||
- winning source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2006/toledo3/Makefile">Makefile</a>
|
||||
- winner 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
|
||||
winning source</li>
|
||||
</ul>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<ul>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/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/.winner.json">.winner.json</a>
|
||||
- description of winner in JSON</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/gen-inventory.sh -->
|
||||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||||
|
||||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-row.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/footer.default.html -->
|
||||
|
||||
<div class="footer">
|
||||
<hr>
|
||||
<h2>Coda</h2>
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2006%2Ftoledo3%2Findex.html">Nu HTML check this web page</a></p>
|
||||
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/footer.default.html -->
|
||||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- END: this line ends content from: inc/bottom.default.html -->
|
||||
Reference in new issue
Block a user