force use of pandoc version >= 3.1.12.2

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

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

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

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

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

No files matched your search

+33 -56
View File
@@ -130,8 +130,8 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Jay_Vosburgh">Jay Vosburgh</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of
America</em> (<em>United States</em>) <br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -144,8 +144,7 @@ America</em> (<em>United States</em>) <br><br></li>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code>STATUS: known bug - please help us fix</code></pre>
<p>For more detailed information see <a
href="../../bugs.html#1989_fubar">1989 fubar bugs</a>.</p>
<p>For more detailed information see <a href="../../bugs.html#1989_fubar">1989 fubar bugs</a>.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./fubar</span> <span class="op">&lt;</span>number<span class="op">&gt;</span></span></code></pre></div>
<h2 id="try">Try:</h2>
@@ -154,74 +153,52 @@ href="../../bugs.html#1989_fubar">1989 fubar bugs</a>.</p>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./fubar.sh</span> 2 <span class="co"># run via script</span></span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a><span class="ex">./fubar</span> 2 <span class="co"># run directly</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Run this with a single digit argument (or wait a long time and risk
an infinite loop as described in the <a
href="../../bugs.html#1989_fubar">1989 fubar bugs</a> file).</p>
<p>The blank line at the beginning of the source is mandatory. Do you
know why?</p>
<p>NOTE: the file <code>ouroboros.c</code> is created by the program
itself so this is why it is not in the repository.</p>
<p>Run this with a single digit argument (or wait a long time and risk an infinite
loop as described in the <a href="../../bugs.html#1989_fubar">1989 fubar bugs</a> file).</p>
<p>The blank line at the beginning of the source is mandatory.
Do you know why?</p>
<p>NOTE: the file <code>ouroboros.c</code> is created by the program itself so this is why it
is not in the repository.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>In a nutshell, this is probably the slowest and most obnoxious
factorial program ever written. Unfortunately, the name of the C source
must be <code>ouroboros.c</code>; the name is hard-coded into the
program.</p>
<p>The source is a legal shell script and a legal C program. The shell
script compiles itself, and then executes the resulting binary, giving
the source as input. The program works by successively modifying #define
lines each pass through.</p>
<p>Both <code>indent</code> and <code>cb</code> will damage the program,
<code>indent</code> much more so.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<p>In a nutshell, this is probably the slowest and most
obnoxious factorial program ever written. Unfortunately,
the name of the C source must be <code>ouroboros.c</code>; the name is
hard-coded into the program.</p>
<p>The source is a legal shell script and a legal C program.
The shell script compiles itself, and then executes the
resulting binary, giving the source as input. The program
works by successively modifying #define lines each pass through.</p>
<p>Both <code>indent</code> and <code>cb</code> will damage the program, <code>indent</code>
much more so.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1989fubar"><a name="inventory"></a>Inventory for
1989/fubar</h1>
<h1 id="inventory-for-1989fubar"><a name="inventory"></a>Inventory for 1989/fubar</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/fubar/fubar.c">fubar.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/fubar/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/fubar/fubar.orig.c">fubar.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/fubar/fubar.sh">fubar.sh</a>
- how to run fubar</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/fubar/try.sh">try.sh</a>
- how to run</li>
<li><a href="1989_fubar.tar.bz2">1989_fubar.tar.bz2</a> - download entry
source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/fubar/fubar.c">fubar.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/fubar/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/fubar/fubar.orig.c">fubar.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/fubar/fubar.sh">fubar.sh</a> - how to run fubar</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/fubar/try.sh">try.sh</a> - how to run</li>
<li><a href="1989_fubar.tar.bz2">1989_fubar.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/fubar/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/fubar/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/fubar/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/fubar/.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/1989/fubar/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/fubar/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+35 -53
View File
@@ -123,74 +123,56 @@
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h1 id="sixth-international-obfuscated-c-code-contest">Sixth
International Obfuscated C Code Contest</h1>
<p>View the <code>index.html</code> web page for the given winning entry
for information on how on how to compile it and how to run the winning
program. Look at the winning source and try to figure how it does what
it does! You may then wish to look at the Author’s remarks for even more
details.</p>
<p>Instructions for use: Run <code>make</code> to compile entries (it is
possible that on System V or non-Unix systems the Makefile needs to be
changed).</p>
<h1 id="sixth-international-obfuscated-c-code-contest">Sixth International Obfuscated C Code Contest</h1>
<p>View the <code>index.html</code> web page for the given winning entry for information on how
on how to compile it and how to run the winning program.
Look at the winning source and try to figure how it does what it does!
You may then wish to look at the Author’s remarks for even more details.</p>
<p>Instructions for use: Run <code>make</code> to compile entries (it is possible that on
System V or non-Unix systems the Makefile needs to be changed).</p>
<p>This year, the Grand Prize was given to the most useful program.</p>
<p>The <a href="jar.1/indx.html">“Strangest abuse of the rules”</a>
award was given this year to stress the fact that starting in 1990,
compiling entries must result a regular executable file.</p>
<p>The Makefile always uses the portable version of the <a
href="fubar/indx.html">“Best self modifying program”</a> because there
is no loss of functionality in using it. In the case of the <a
href="tromp/README">“Best game”</a> entry, however, some functionality
is lost in the portable version and so the Makefile uses the original
program.</p>
<p><a href="rules.txt">Rules</a> and results were posted to comp.lang.c,
comp.sources.unix, and alt.sources. They have been made available on a
wide number of USENET archive sites such as uunet. The 1989 winning
entries will be published in the <a
href="https://www.vintage-computer.com/publications.php?microsystemsjournal">Micro/Systems
<p>The <a href="jar.1/indx.html">“Strangest abuse of the rules”</a> award was given this year
to stress the fact that starting in 1990, compiling entries must result a
regular executable file.</p>
<p>The Makefile always uses the portable version of the <a href="fubar/indx.html">“Best
self modifying program”</a> because there is no loss of functionality in
using it. In the case of the <a href="tromp/README">“Best game”</a> entry, however, some
functionality is lost in the portable version and so the Makefile uses
the original program.</p>
<p><a href="rules.txt">Rules</a> and results were posted to comp.lang.c, comp.sources.unix, and
alt.sources. They have been made available on a wide number of USENET
archive sites such as uunet. The 1989 winning entries will be published in the
<a href="https://www.vintage-computer.com/publications.php?microsystemsjournal">Micro/Systems
Journal</a>.</p>
<h2 id="final-comments">Final Comments</h2>
<p><strong>IMPORTANT NOTE</strong>: See <a
href="../contact.html">contact.html</a> for up to date contact details
as well as details on how to provide fixes to any of the entries. See
also <a href="../faq.html">the IOCCC FAQ</a> for addition information on
the IOCCC.</p>
<p><strong>IMPORTANT NOTE</strong>: See <a href="../contact.html">contact.html</a> for up to date contact details
as well as details on how to provide fixes to any of the entries.
See also <a href="../faq.html">the IOCCC FAQ</a> for addition information on the IOCCC.</p>
<h1 id="copyright-and-license">Copyright and License</h1>
<p>Copyright (c) 1989,2023, Landon Curt Noll and Larry Bassel. All
Rights Reserved. This work is licensed under a <a
href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons
CC BY-SA 4.0 DEED Attribution-ShareAlike 4.0 International</a> license.
If you do use this work in some form, the <a href="../judges.html">IOCCC
judges</a> would appreciate (but does not require) if you were to <a
href="../contact.html">send us a note about your use</a>.</p>
<p>Copyright (c) 1989,2023, Landon Curt Noll and Larry Bassel. All Rights Reserved.
This work is licensed under a <a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons CC BY-SA 4.0 DEED Attribution-ShareAlike
4.0 International</a> license.
If you do use this work in some form, the <a href="../judges.html">IOCCC judges</a> would appreciate
(but does not require) if you were to <a href="../contact.html">send us a note about your use</a>.</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-year-index.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-year-index.sh -->
<h1
id="winning-entries-of-1989---the-6th-ioccc"><a name=inventory></a><a name=1989></a>Winning
Entries of 1989 - The 6th IOCCC</h1>
<p><strong>Download IOCCC</strong> <a
href="1989/ioccc.1989.tar.bz2">1989 entry source</a></p>
<h1 id="winning-entries-of-1989---the-6th-ioccc"><a name=inventory></a><a name=1989></a>Winning Entries of 1989 - The 6th IOCCC</h1>
<p><strong>Download IOCCC</strong> <a href="1989/ioccc.1989.tar.bz2">1989 entry source</a></p>
<ul>
<li><a href="fubar/index.html">1989/fubar</a> - Best self-modifying
program</li>
<li><a href="jar.1/index.html">1989/jar.1</a> - Strangest abuse of the
rules</li>
<li><a href="fubar/index.html">1989/fubar</a> - Best self-modifying program</li>
<li><a href="jar.1/index.html">1989/jar.1</a> - Strangest abuse of the rules</li>
<li><a href="jar.2/index.html">1989/jar.2</a> - Best of show</li>
<li><a href="ovdluhe/index.html">1989/ovdluhe</a> - Most humorous
output</li>
<li><a href="paul/index.html">1989/paul</a> - Most complex
algorithm</li>
<li><a href="robison/index.html">1989/robison</a> - Best minimal use of
C</li>
<li><a href="ovdluhe/index.html">1989/ovdluhe</a> - Most humorous output</li>
<li><a href="paul/index.html">1989/paul</a> - Most complex algorithm</li>
<li><a href="robison/index.html">1989/robison</a> - Best minimal use of C</li>
<li><a href="roemer/index.html">1989/roemer</a> - Best layout</li>
<li><a href="tromp/index.html">1989/tromp</a> - Best game</li>
<li><a href="vanb/index.html">1989/vanb</a> - Best one liner</li>
<li><a href="westley/index.html">1989/westley</a> - Most algorithms in
one program</li>
<li><a href="westley/index.html">1989/westley</a> - Most algorithms in one program</li>
</ul>
<p> <strong>Jump to:</strong> <a href="#">top</a></p>
+39 -65
View File
@@ -130,8 +130,8 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Jari_Arkko">Jari Arkko</a><br>
Location: <a href="../../location.html#SE">SE</a> - <em>Kingdom of
Sweden</em> (<em>Sweden</em>) <br><br></li>
Location: <a href="../../location.html#SE">SE</a> - <em>Kingdom of Sweden</em> (<em>Sweden</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,30 +142,27 @@ Sweden</em> (<em>Sweden</em>) <br><br></li>
<h2 id="to-build">To build:</h2>
<p>NOTE: this will run the program itself.</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> clobber all</span></code></pre></div>
<p>There is an alternate version with a slight difference that you may
wish to try. See the <a href="#alternate-code">Alternate code</a>
section below for more details.</p>
<p>There is an alternate version with a slight difference that you may wish to try.
See the <a href="#alternate-code">Alternate code</a> section below for more details.</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">./jar.1</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>This alternate code, which prints something slightly different, is
provided as well.</p>
<p>This alternate code, which prints something slightly different, is provided as well.</p>
<h3 id="alternate-build">Alternate build:</h3>
<p>NOTE: this will run the program itself.</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 alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3>
<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">./jar.1.alt</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>On many systems the compiler will not allow you to send the object
file to <code>/dev/tty</code>. The author suggested:</p>
<p>On many systems the compiler will not allow you to send the object file to
<code>/dev/tty</code>. The author suggested:</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">cc</span> <span class="at">-c</span> <span class="at">-o</span> /dev/tty jar.1.c</span></code></pre></div>
<p>As a last resort the <code>jar.1.sh</code> script provided simulates
writing the raw binary of the .o file to the terminal.</p>
<p>Abuse of the rules winning entry usually result in a change of the
rules. Starting in 1990, compiling entries must result an regular file
<p>Abuse of the rules winning entry usually result in a change of the rules.
Starting in 1990, compiling entries must result an regular file
which can be executed.</p>
<p>Under certain conditions that are dependent on such diverse things
such as:</p>
<p>Under certain conditions that are dependent on such diverse things such as:</p>
<ul>
<li>compiler type</li>
<li>compiler version</li>
@@ -177,75 +174,52 @@ such as:</p>
<li>various bugs and misfeatures :-)</li>
</ul>
<p>the output of raw binary to a terminal can produce various effects
from the mildly annoying beeps to missing seeing the important output,
to various “ill effects” such as the crashing of the terminal
application. Instead we have opted to pipe raw binary thru the strings
utility before writing to standard output instead of
from the mildly annoying beeps to missing seeing the important
output, to various “ill effects” such as the crashing of the terminal
application. Instead we have opted to pipe raw binary thru the
strings utility before writing to standard output instead of
<code>/dev/tty</code>.</p>
<p>As a historical note, the Makefile does echo the original command to
standard output, the original shell command that once wrote raw binary
to the <code>/dev/tty</code> special file.</p>
<p>The use of piping raw binary thru stings makes the original 1989
output more apparent, as was the case when using dumb CRT terminals
(some do dumb that they couldn’t even process simple ANSI escape
sequences) were more common.</p>
<p>As a historical note, the Makefile does echo the original command
to standard output, the original shell command that once wrote raw
binary to the <code>/dev/tty</code> special file.</p>
<p>The use of piping raw binary thru stings makes the original 1989 output
more apparent, as was the case when using dumb CRT terminals (some
do dumb that they couldn’t even process simple ANSI escape sequences)
were more common.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This program is (supposedly) the smallest C program able to print
“Hello world.”. The compilation itself produces the desired printout and
the program need not be actually run.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<p>This program is (supposedly) the smallest C program able to print “Hello
world.”. The compilation itself produces the desired printout and the program
need not be actually run.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1989jar.1"><a name="inventory"></a>Inventory for
1989/jar.1</h1>
<h1 id="inventory-for-1989jar.1"><a name="inventory"></a>Inventory for 1989/jar.1</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.1/jar.1.c">jar.1.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.1/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.1/jar.1.alt.c">jar.1.alt.c</a>
- alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.1/jar.1.orig.c">jar.1.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.1/jar.1.alt.sh">jar.1.alt.sh</a>
- a method to compile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.1/jar.1.sh">jar.1.sh</a>
- a method to compile the alternative source</li>
<li><a href="1989_jar.1.tar.bz2">1989_jar.1.tar.bz2</a> - download entry
source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.1/jar.1.c">jar.1.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.1/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.1/jar.1.alt.c">jar.1.alt.c</a> - alternative source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.1/jar.1.orig.c">jar.1.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.1/jar.1.alt.sh">jar.1.alt.sh</a> - a method to compile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.1/jar.1.sh">jar.1.sh</a> - a method to compile the alternative source</li>
<li><a href="1989_jar.1.tar.bz2">1989_jar.1.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.1/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.1/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.1/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.1/.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/1989/jar.1/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.1/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+36 -62
View File
@@ -130,14 +130,14 @@
<h2 id="authors"><a name="author"></a>Authors:</h2>
<ul>
<li>Name: <a href="../../authors.html#Esko_Nuutila">Esko Nuutila</a><br>
Location: <a href="../../location.html#FI">FI</a> - <em>Republic of
Finland </em> (<em>Finland</em>) <br><br></li>
Location: <a href="../../location.html#FI">FI</a> - <em>Republic of Finland </em> (<em>Finland</em>)
<br><br></li>
<li>Name: <a href="../../authors.html#Jari_Arkko">Jari Arkko</a><br>
Location: <a href="../../location.html#SE">SE</a> - <em>Kingdom of
Sweden</em> (<em>Sweden</em>) <br><br></li>
Location: <a href="../../location.html#SE">SE</a> - <em>Kingdom of Sweden</em> (<em>Sweden</em>)
<br><br></li>
<li>Name: <a href="../../authors.html#Ora_Lassila">Ora Lassila</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of
America</em> (<em>United States</em>) <br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -160,11 +160,11 @@ America</em> (<em>United States</em>) <br><br></li>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span> try.txt</span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This is the most useful program submitted this year. It is a rather
large subset of lisp. It has no error recovery, and performs rather
poorly in a number of cases. Even so, placing all this functionality in
such a small, densely packed program, is impressive enough to win the
Best of show award.</p>
<p>This is the most useful program submitted this year. It is a
rather large subset of lisp. It has no error recovery, and
performs rather poorly in a number of cases. Even so, placing
all this functionality in such a small, densely packed program,
is impressive enough to win the Best of show award.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This program implements a Lisp interpreter in 1465 bytes of source.
Some sophisticated features supported, e.g. functionals and recursion.
@@ -188,11 +188,10 @@ The special-forms/functions/variables implemented are:</p>
</ul>
<p>Below are sample lisp expressions you might choose to try as input.
The program implements a conventional lisp listener, i.e. you type in
lisp expressions (followed by CR), the program evaluates them and prints
out the return values. End execution by typing an end-of-file
lisp expressions (followed by CR), the program evaluates them and
prints out the return values. End execution by typing an end-of-file
character.</p>
<div class="sourceCode" id="cb4"><pre
class="sourceCode lisp"><code class="sourceCode commonlisp"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>(<span class="op">+</span> <span class="fl">2.5</span> <span class="fl">3.1</span>)</span>
<div class="sourceCode" id="cb4"><pre class="sourceCode lisp"><code class="sourceCode commonlisp"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>(<span class="op">+</span> <span class="fl">2.5</span> <span class="fl">3.1</span>)</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a>(<span class="kw">defun</span><span class="fu"> fib </span>(n)</span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> (<span class="kw">if</span> (<span class="op">&lt;</span> n <span class="dv">2</span>)</span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> <span class="dv">1</span></span>
@@ -216,68 +215,43 @@ avoid any undefined variables or functions, wrong number of arguments
etc. All these errors are likely to dump core (i.e. there are no error
checks in the program).</p>
<p>Traditional Lisp implementations use cons cells as the main data
structure. Lists are organized of pointer chains of these cells. In this
program, an alternate representation was chosen: <code>char*'</code>s.
All list operations, including the ones in the interpreter, are made
using string representations of the lists. These operations must count
parentheses and skip whitespace. This leads to extremely poor
performance!</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>
structure. Lists are organized of pointer chains of these cells.
In this program, an alternate representation was chosen: <code>char*'</code>s.
All list operations, including the ones in the interpreter, are
made using string representations of the lists. These operations
must count parentheses and skip whitespace. This leads to extremely
poor performance!</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1989jar.2"><a name="inventory"></a>Inventory for
1989/jar.2</h1>
<h1 id="inventory-for-1989jar.2"><a name="inventory"></a>Inventory for 1989/jar.2</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.2/jar.2.c">jar.2.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.2/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.2/jar.2.orig.c">jar.2.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.2/chocolate_cake.lisp">chocolate_cake.lisp</a>
- input file</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.2/fib.lisp">fib.lisp</a>
- input file</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.2/try.sh">try.sh</a>
- how to run</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.2/try.txt">try.txt</a>
- input file</li>
<li><a href="1989_jar.2.tar.bz2">1989_jar.2.tar.bz2</a> - download entry
source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.2/jar.2.c">jar.2.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.2/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.2/jar.2.orig.c">jar.2.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.2/chocolate_cake.lisp">chocolate_cake.lisp</a> - input file</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.2/fib.lisp">fib.lisp</a> - input file</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.2/try.sh">try.sh</a> - how to run</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.2/try.txt">try.txt</a> - input file</li>
<li><a href="1989_jar.2.tar.bz2">1989_jar.2.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.2/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.2/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.2/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.2/.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/1989/jar.2/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/jar.2/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+43 -69
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Oskar_von_der_Luehe">Oskar von der
Luehe</a><br> Location: <a href="../../location.html#ZZ">ZZ</a> -
<em>Unknown location</em> <br><br></li>
<li>Name: <a href="../../authors.html#Oskar_von_der_Luehe">Oskar von der Luehe</a><br>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -141,107 +141,81 @@ Luehe</a><br> Location: <a href="../../location.html#ZZ">ZZ</a> -
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> all</span></code></pre></div>
<p>To get this to compile with a modern CPP, we had to replace
<code>#D</code> with <code>#define</code>.</p>
<p>To get this to compile with a modern CPP, we had to replace <code>#D</code> with <code>#define</code>.</p>
<h2 id="to-use">To use:</h2>
<p>Run the program this way:</p>
<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">./ovdluhe</span> <span class="op">&lt;</span> textfile</span></code></pre></div>
<p>The program stops when it reaches the end of the template buffer by
chance or is killed.</p>
<p>The program stops when it reaches the end of the template buffer
by chance or is killed.</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 class="kw">;</span> <span class="fu">sleep</span> 2 <span class="kw">;</span> <span class="ex">./try.sh</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>The author suggested that one varies the definition of <code>P</code>
from 2 through 10. As it’s a <code>#define</code> it’s easy to set
up.</p>
<p>The author suggested that one varies the definition of <code>P</code> from 2 through 10. As
it’s a <code>#define</code> it’s easy to set up.</p>
<h3 id="alternate-build">Alternate build:</h3>
<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> P=9 clobber alt</span></code></pre></div>
<p>You do not have to define <code>P</code> but if you do you can
replace the value with whatever you wish, as long as it’s a positive
<code>int</code> (or evaluates to a positive <code>int</code> like the
default <code>(A&lt;&lt;AP)</code> does). Too high a value will likely
cause the program to fail and a negative value will cause a compilation
error.</p>
<p>You do not have to define <code>P</code> but if you do you can replace the value with
whatever you wish, as long as it’s a positive <code>int</code> (or evaluates to a positive
<code>int</code> like the default <code>(A&lt;&lt;AP)</code> does). Too high a value will likely cause the
program to fail and a negative value will cause a compilation error.</p>
<h3 id="alternate-use">Alternate use:</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="ex">./ovdluhe.alt</span></span></code></pre></div>
<h3 id="alternate-try">Alternate try:</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">./try.alt.sh</span></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a><span class="va">P</span><span class="op">=</span>5 <span class="ex">./try.alt.sh</span></span></code></pre></div>
<p>NOTE: if you specify too high a value for <code>P</code> the program
might fail. If you specify a value &lt; 0 it will fail to compile.</p>
<p>NOTE: if you specify too high a value for <code>P</code> the program might fail. If you
specify a value &lt; 0 it will fail to compile.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Run this program using your favorite text file as input. Files such
as mailboxes, man pages and usenet articles are especially recommended.
You will get different output each time you run it.</p>
<p>Run this program using your favorite text file as input. Files
such as mailboxes, man pages and usenet articles are especially
recommended. You will get different output each time you run it.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This program implements an “Eddington ape” - it generates random text
from a supplied template. The template text file is read through stdin.
The larger the template, the better the result. A maximum of
<code>2**12</code> chars are used. From the template, the program
calculates the statistics of chars that immediately follow a given
string (correlator string) of a certain length (currently 4 - can be
varied by changing the definition for P accordingly). A character is
randomly chosen, weighted by its probability to occur after the
correlator string. That character is printed to stdout and placed at the
end of the correlator string, whose first character is discarded.
<p>This program implements an “Eddington ape” - it generates
random text from a supplied template. The template text file
is read through stdin. The larger the template, the better the
result. A maximum of <code>2**12</code> chars are used. From the template,
the program calculates the statistics of chars that immediately
follow a given string (correlator string) of a certain length
(currently 4 - can be varied by changing the definition for P
accordingly). A character is randomly chosen, weighted by its
probability to occur after the correlator string. That
character is printed to stdout and placed at the end of the
correlator string, whose first character is discarded.
Meaningful words are therefore usually preserved, the effect on
sentences can be dramatically random.</p>
<p>You might want to vary the definition of P between 2 and 10 and
observe the result.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1989ovdluhe"><a name="inventory"></a>Inventory for
1989/ovdluhe</h1>
<h1 id="inventory-for-1989ovdluhe"><a name="inventory"></a>Inventory for 1989/ovdluhe</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/ovdluhe/ovdluhe.c">ovdluhe.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/ovdluhe/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/ovdluhe/ovdluhe.alt.c">ovdluhe.alt.c</a>
- alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/ovdluhe/ovdluhe.orig.c">ovdluhe.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/ovdluhe/try.alt.sh">try.alt.sh</a>
- how to run alternative code</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/ovdluhe/try.sh">try.sh</a>
- how to run</li>
<li><a href="1989_ovdluhe.tar.bz2">1989_ovdluhe.tar.bz2</a> - download
entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/ovdluhe/ovdluhe.c">ovdluhe.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/ovdluhe/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/ovdluhe/ovdluhe.alt.c">ovdluhe.alt.c</a> - alternative source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/ovdluhe/ovdluhe.orig.c">ovdluhe.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/ovdluhe/try.alt.sh">try.alt.sh</a> - how to run alternative code</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/ovdluhe/try.sh">try.sh</a> - how to run</li>
<li><a href="1989_ovdluhe.tar.bz2">1989_ovdluhe.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/ovdluhe/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/ovdluhe/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/ovdluhe/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/ovdluhe/.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/1989/ovdluhe/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/ovdluhe/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+96 -116
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Paul_E_Black">Paul E.
Black</a><br> Location: <a href="../../location.html#US">US</a> -
<em>United States of America</em> (<em>United States</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Paul_E_Black">Paul E. Black</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -141,153 +141,133 @@ Black</a><br> Location: <a href="../../location.html#US">US</a> -
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> all</span></code></pre></div>
<p>There is an alternate version with a trace routine that the author
had commented out. See <a href="#alternate-code">alternate code</a>
below for more details.</p>
<p>There is an alternate version with a trace routine that the author had commented
out. See <a href="#alternate-code">alternate code</a> below for more details.</p>
<h2 id="try">Try:</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">./paul</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>This version was described by the author like:</p>
<blockquote>
<p>I could have squeezed the program under 1024 bytes without the trace
subroutine, but I felt it was important for understanding the program.
Besides it is fun to watch the tape zooming back and forth as the
program runs. A much better debugger or trace could easily be added.</p>
<p>I could have squeezed the program under 1024 bytes without the
trace subroutine, but I felt it was important for understanding
the program. Besides it is fun to watch the tape zooming back
and forth as the program runs. A much better debugger or trace
could easily be added.</p>
</blockquote>
<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>
<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">./paul.alt</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>The author’s comments is a detailed program explanation and spoiler.
If you want a real challenge, don’t read any further and try to
understand the program via the source.</p>
<p>The author’s comments is a detailed program explanation and spoiler. If you
want a real challenge, don’t read any further and try to understand the program
via the source.</p>
<h3 id="historical-note">Historical note:</h3>
<p>The original source contained a long line which caused many mailers
to barf. The original file may be re-constructed by removing the
trailing <code>\</code> on line 12 and joining lines 12 and 13 together
without a space.</p>
<p>However as this is no longer a problem the trailing <code>\</code>
has been restored in all versions, both the original and the fixed for
modern systems version.</p>
<p>The original source contained a long line which caused many mailers to barf.
The original file may be re-constructed by removing the trailing <code>\</code> on line 12
and joining lines 12 and 13 together without a space.</p>
<p>However as this is no longer a problem the trailing <code>\</code> has been restored in all
versions, both the original and the fixed for modern systems version.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This programs computes and prints Fibonacci numbers by simulating a
Turing machine with the proper program. Understanding the C program,
i.e., a Turing machine simulator, is only the first and simplest step.
The Turing machine program must be understood, too! (it is trivial,
perhaps even natural to write incredibly obscure Turing programs.)</p>
<p>If the program is invoked with an operand, the operand is used as the
Turing program. It includes a “trace” facility, subroutine
<code>r</code> (commented out for obscurity), to help write and debug
Turing programs. Just the thing for some fun in a Theory of Computation
class.</p>
<p>The Turing machine tape is represented as a doubly linked list of
pointers. The forward and backward links are <code>XOR</code>ed together
and stored in one pointer. If we always keep one of the links on hand,
we can recover the other link at any time. The variable <code>q</code>
is the scan head (and a pointer at some tape cell), and <code>p</code>
is a “previous” link. The state of the tape is stored in the low order
bit of the pointer. Since we always allocate an even number of bytes,
the low order bit carries no information (see <a
href="#portability">portability</a> below.) Memory representing a tape
cell is allocated when the cell is first scanned. Thus the simulation
begins with a tape effectively the size of virtual memory set to all
zeros. Since a header can be added to any Turing program to write
initial data and position the scan head, this is little loss of
generality.</p>
<p>The simulated Turing machine has a single tape with either a
<code>1</code> or a <code>0</code> in each cell. The Turing machine
language format is a string of three bytes. The first byte is the
current state. The second byte is the next state. (The last bit of
states is ignored, i.e., <code>B</code> and <code>C</code> are the same
state, in an attempt to be able to have interesting words in the
program.) The third byte is composed of bits. Bit <code>1</code>
(<code>2&amp;byte</code>) is the symbol scanned, i.e. an instruction is
selected for state and for a match with the symbol under the scan head.
Bit <code>2</code> (<code>4&amp;byte</code>) is the new symbol to be
written to the cell. Bit <code>3</code> (<code>8&amp;byte</code>) is the
direction to move the scan head: <code>0</code> for left and
<code>1</code> for right. If bit <code>4</code>
(<code>16&amp;byte</code>) is true, the next character is sent to
<p>This programs computes and prints Fibonacci numbers by
simulating a Turing machine with the proper program.
Understanding the C program, i.e., a Turing machine simulator,
is only the first and simplest step. The Turing machine
program must be understood, too! (it is trivial, perhaps even
natural to write incredibly obscure Turing programs.)</p>
<p>If the program is invoked with an operand, the operand is used
as the Turing program. It includes a “trace” facility,
subroutine <code>r</code> (commented out for obscurity), to help write and
debug Turing programs. Just the thing for some fun in a Theory
of Computation class.</p>
<p>The Turing machine tape is represented as a doubly linked list
of pointers. The forward and backward links are <code>XOR</code>ed together
and stored in one pointer. If we always keep one of the links
on hand, we can recover the other link at any time. The
variable <code>q</code> is the scan head (and a pointer at some tape cell),
and <code>p</code> is a “previous” link. The state of the tape is stored in
the low order bit of the pointer. Since we always allocate an
even number of bytes, the low order bit carries no information
(see <a href="#portability">portability</a> below.) Memory representing a tape cell is
allocated when the cell is first scanned. Thus the simulation
begins with a tape effectively the size of virtual memory set
to all zeros. Since a header can be added to any Turing
program to write initial data and position the scan head, this
is little loss of generality.</p>
<p>The simulated Turing machine has a single tape with either a <code>1</code>
or a <code>0</code> in each cell. The Turing machine language format is a
string of three bytes. The first byte is the current state.
The second byte is the next state. (The last bit of states is
ignored, i.e., <code>B</code> and <code>C</code> are the same state, in an attempt to be
able to have interesting words in the program.) The third byte
is composed of bits. Bit <code>1</code> (<code>2&amp;byte</code>) is the symbol scanned,
i.e. an instruction is selected for state and for a match with
the symbol under the scan head. Bit <code>2</code> (<code>4&amp;byte</code>) is the new
symbol to be written to the cell. Bit <code>3</code> (<code>8&amp;byte</code>) is the
direction to move the scan head: <code>0</code> for left and <code>1</code> for right.
If bit <code>4</code> (<code>16&amp;byte</code>) is true, the next character is sent to
<code>stdout</code>. (I added this feature so programs could print
results.)</p>
<p>The Turing machine has next state <code>j</code> when it begins. The
cycle is (1) exit if the state is <code>x</code>, (2) find the next
instruction (given the state and the character under the scan head).
(The program string is searched forward for the next matching
instruction. If the end of the string is reached, the search begins
again at the first of the string. Thus states can be used as local
labels in different places.) (3) change to the next state, (4) print a
character if indicated, (5) write the tape symbol, and (6) move the scan
head. The cycle then repeats with step 1. A call to the trace routine is
just before step 2, but is commented out.</p>
<h3 id="quick-outline-of-the-turing-program">Quick outline of the Turing
program:</h3>
<p>The previous and current Fibonacci numbers are kept in base 1 form
with the current on the right. The first three steps set up the first
two numbers, <code>1</code> and <code>1</code>. Then [beginning with
<code>@ (</code>] a marker of <code>III</code> is created and the
current number is copied to the right of the marker. Then (beginning
with <code>OV</code>) the number is converted to binary by repeatedly
dividing by 2 leaving I for remainder <code>1</code>, and II for
remainder <code>0</code>. Next (beginning with <code>WV</code>) the
binary representation is printed and its symbols and the marker are
erased. Finally (beginning with <code>EEn</code>) the two numbers are
added and the current number copied to the left to become the previous.
Then the cycle repeats.</p>
instruction (given the state and the character under the scan
head). (The program string is searched forward for the next
matching instruction. If the end of the string is reached, the
search begins again at the first of the string. Thus states
can be used as local labels in different places.) (3) change to
the next state, (4) print a character if indicated, (5) write the
tape symbol, and (6) move the scan head. The cycle then repeats
with step 1. A call to the trace routine is just before step
2, but is commented out.</p>
<h3 id="quick-outline-of-the-turing-program">Quick outline of the Turing program:</h3>
<p>The previous and current Fibonacci numbers are kept in base
1 form with the current on the right. The first three
steps set up the first two numbers, <code>1</code> and <code>1</code>. Then
[beginning with <code>@ (</code>] a marker of <code>III</code> is created and
the current number is copied to the right of the
marker. Then (beginning with <code>OV</code>) the number is
converted to binary by repeatedly dividing by 2 leaving I
for remainder <code>1</code>, and II for remainder <code>0</code>. Next
(beginning with <code>WV</code>) the binary representation is
printed and its symbols and the marker are erased.
Finally (beginning with <code>EEn</code>) the two numbers are
added and the current number copied to the left to
become the previous. Then the cycle repeats.</p>
<h3 id="portability">Portability</h3>
<p>The program requires that the lowest bit of a pointer to be 0.</p>
<p>I could have squeezed the program under 1024 bytes without the trace
subroutine, but I felt it was important for understanding the program.
Besides it is fun to watch the tape zooming back and forth as the
program runs. A much better debugger or trace could easily be added.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<p>I could have squeezed the program under 1024 bytes without the
trace subroutine, but I felt it was important for understanding
the program. Besides it is fun to watch the tape zooming back
and forth as the program runs. A much better debugger or trace
could easily be added.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1989paul"><a name="inventory"></a>Inventory for
1989/paul</h1>
<h1 id="inventory-for-1989paul"><a name="inventory"></a>Inventory for 1989/paul</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/paul/paul.c">paul.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/paul/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/paul/paul.alt.c">paul.alt.c</a>
- alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/paul/paul.orig.c">paul.orig.c</a>
- original source</li>
<li><a href="1989_paul.tar.bz2">1989_paul.tar.bz2</a> - download entry
source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/paul/paul.c">paul.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/paul/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/paul/paul.alt.c">paul.alt.c</a> - alternative source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/paul/paul.orig.c">paul.orig.c</a> - original source</li>
<li><a href="1989_paul.tar.bz2">1989_paul.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/paul/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/paul/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/paul/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/paul/.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/1989/paul/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/paul/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+44 -69
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Arch_D_Robison">Arch D.
Robison</a><br> Location: <a href="../../location.html#US">US</a> -
<em>United States of America</em> (<em>United States</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Arch_D_Robison">Arch D. Robison</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -144,8 +144,7 @@ Robison</a><br> Location: <a href="../../location.html#US">US</a> -
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code>STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a
href="../../bugs.html#1989_robison">1989 robison bugs</a>.</p>
<p>For more detailed information see <a href="../../bugs.html#1989_robison">1989 robison bugs</a>.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./robison</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="co"># enter valid expressions</span></span></code></pre></div>
@@ -157,91 +156,67 @@ href="../../bugs.html#1989_robison">1989 robison bugs</a>.</p>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></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="bu">echo</span> 100 / 100 <span class="kw">|</span> <span class="ex">./robison</span> <span class="co"># &lt;-- what happens here ?</span></span></code></pre></div>
<p>NOTE: This program will very likely crash or break into tiny bits :-)
if you feed it numbers with non-binary digits. This, as you might notice
if you try one of the above commands, can happen with other input as
well. If you wish to understand why this happens check the source
code.</p>
<p>NOTE: This program will very likely crash or break into tiny bits :-) if you
feed it numbers with non-binary digits. This, as you might notice if you try one
of the above commands, can happen with other input as well. If you wish to
understand why this happens check the source code.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Sites with punch card facilities will be happy to note that the
source deck can be re-collated with an ASCII sort.</p>
<p>Note that this program uses only a small subset of the constructs
that the C language supports.</p>
<p>For an interesting document on APL, see <a
href="https://computerhistory.org/blog/the-apl-programming-language-source-code/"
class="uri">https://computerhistory.org/blog/the-apl-programming-language-source-code/</a>.</p>
<p>Sites with punch card facilities will be happy to note that
the source deck can be re-collated with an ASCII sort.</p>
<p>Note that this program uses only a small subset of the
constructs that the C language supports.</p>
<p>For an interesting document on APL, see
<a href="https://computerhistory.org/blog/the-apl-programming-language-source-code/" class="uri">https://computerhistory.org/blog/the-apl-programming-language-source-code/</a>.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This program is a handy picoAPL interpreter written in
<code>C--</code>. It outputs the evaluation of an <a
href="https://en.wikipedia.org/wiki/APL_(programming_language)">APL</a>
expression from standard input. Functions are limited to dyadic
<code>+</code>,<code>-</code>,<code>x</code>, and unary <code>-</code>;
numerals must be binary. Parentheses may be used for grouping. For
example:</p>
<p>This program is a handy picoAPL interpreter written in <code>C--</code>. It
outputs the evaluation of an
<a href="https://en.wikipedia.org/wiki/APL_(programming_language)">APL</a> expression from standard
input. Functions are limited to dyadic <code>+</code>,<code>-</code>,<code>x</code>, and unary <code>-</code>;
numerals must be binary. Parentheses may be used for
grouping. For example:</p>
<pre><code>101x111-100</code></pre>
<p>prints:</p>
<pre><code>1111</code></pre>
<p>That is <code>5x(7-4)</code> is <code>15</code>. (APL groups from
right to left.) Extending it to the full APL language should be
trivial.</p>
<p>The <code>C--</code> language improves the C language by removing
superfluous and confusing features: arithmetic, logical operations,
shifts, relational operators, address-of, and flow control. In fact, the
only expressions retained are function calls, indirection, array
<p>That is <code>5x(7-4)</code> is <code>15</code>. (APL groups from right to left.)
Extending it to the full APL language should be trivial.</p>
<p>The <code>C--</code> language improves the C language by removing superfluous
and confusing features: arithmetic, logical operations, shifts,
relational operators, address-of, and flow control. In fact, the only
expressions retained are function calls, indirection, array
assignments, the ‘,’ operator, and <code>sizeof</code>. Despite these
restrictions, the <code>C--</code> program does arithmetic on
arbitrarily large binary numbers.</p>
<p>To obtain a <code>C--</code> reference, simply rip out the irrelevant
pages from your K&amp;R C manual. To obtain a <code>C--</code> compiler,
simply rip out the irrelevant bytes from your <code>cc</code>
compiler.</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>
restrictions, the <code>C--</code> program does arithmetic on arbitrarily
large binary numbers.</p>
<p>To obtain a <code>C--</code> reference, simply rip out the irrelevant pages
from your K&amp;R C manual. To obtain a <code>C--</code> compiler, simply rip
out the irrelevant bytes from your <code>cc</code> compiler.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1989robison"><a name="inventory"></a>Inventory for
1989/robison</h1>
<h1 id="inventory-for-1989robison"><a name="inventory"></a>Inventory for 1989/robison</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/robison/robison.c">robison.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/robison/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/robison/robison.orig.c">robison.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/robison/try.sh">try.sh</a>
- how to run</li>
<li><a href="1989_robison.tar.bz2">1989_robison.tar.bz2</a> - download
entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/robison/robison.c">robison.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/robison/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/robison/robison.orig.c">robison.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/robison/try.sh">try.sh</a> - how to run</li>
<li><a href="1989_robison.tar.bz2">1989_robison.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/robison/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/robison/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/robison/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/robison/.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/1989/robison/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/robison/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+22 -40
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Roemer_B_Lievaart">Roemer B.
Lievaart</a><br> Location: <a href="../../location.html#NL">NL</a> -
<em>Kingdom of the Netherlands</em> (<em>Netherlands</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Roemer_B_Lievaart">Roemer B. Lievaart</a><br>
Location: <a href="../../location.html#NL">NL</a> - <em>Kingdom of the Netherlands</em> (<em>Netherlands</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -144,60 +144,42 @@ Lievaart</a><br> Location: <a href="../../location.html#NL">NL</a> -
<h2 id="try">Try:</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">./roemer</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Do you know what this program does? If you do, look again, there is
more here than meets the PI.</p>
<p>Do you know what this program does? If you do, look again, there is more here
than meets the PI.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>Passes lint, but not with the strictest options, for it contains some
“null-statements”, as well two identifiers which are, if compilers only
take 6 characters, the same. It also uses <code>write(2)</code>, so not
totally system independent.</p>
<p>You are very much invited to pass this program through a C-beautifier
(first strip newlines and tabs, if your <code>cb</code> can’t do
that).</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>
“null-statements”, as well two identifiers which are, if compilers only take 6
characters, the same. It also uses <code>write(2)</code>, so not totally system
independent.</p>
<p>You are very much invited to pass this program through a C-beautifier (first
strip newlines and tabs, if your <code>cb</code> can’t do that).</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1989roemer"><a name="inventory"></a>Inventory for
1989/roemer</h1>
<h1 id="inventory-for-1989roemer"><a name="inventory"></a>Inventory for 1989/roemer</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/roemer/roemer.c">roemer.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/roemer/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/roemer/roemer.orig.c">roemer.orig.c</a>
- original source</li>
<li><a href="1989_roemer.tar.bz2">1989_roemer.tar.bz2</a> - download
entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/roemer/roemer.c">roemer.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/roemer/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/roemer/roemer.orig.c">roemer.orig.c</a> - original source</li>
<li><a href="1989_roemer.tar.bz2">1989_roemer.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/roemer/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/roemer/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/roemer/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/roemer/.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/1989/roemer/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/roemer/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+59 -86
View File
@@ -130,8 +130,8 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#John_Tromp">John Tromp</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of
America</em> (<em>United States</em>) <br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -147,8 +147,8 @@ America</em> (<em>United States</em>) <br><br></li>
<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">./tromp</span> 5</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./tromp</span> 10 <span class="st">&quot;hkl jq&quot;</span></span></code></pre></div>
<p>The second command, <code>./tromp 10 "hkl jq"</code>, will set up the
keys kind of like vim:</p>
<p>The second command, <code>./tromp 10 "hkl jq"</code>, will set up the keys kind of like
vim:</p>
<ul>
<li>h - left (left)</li>
<li>k - rotate (up)</li>
@@ -157,37 +157,34 @@ keys kind of like vim:</p>
<li>space - pause (space)</li>
<li>q - quit (:q)</li>
</ul>
<p>NOTE: after the game ends a file called <code>HI</code> will be in
the directory with the high scores (up to 20 runs saved) so one can see
who has the highest score. The file might look like:</p>
<p>NOTE: after the game ends a file called <code>HI</code> will be in the directory with the
high scores (up to 20 runs saved) so one can see who has the highest score. The
file might look like:</p>
<pre><code>330 by luser
136 by loser
100 by winner</code></pre>
<p>… or so, where in this case the <a
href="https://web.archive.org/web/20181023221954/https://www.chicagotribune.com/news/ct-xpm-2002-07-31-0207310310-story.html">luser
is the winner, the loser is in second place and the winner is the
<p>… or so, where in this case the <a href="https://web.archive.org/web/20181023221954/https://www.chicagotribune.com/news/ct-xpm-2002-07-31-0207310310-story.html">luser is the winner, the loser is in second
place and the winner is the
loser</a> :-)</p>
<h2 id="alternate-code">Alternate code:</h2>
<p>The author provided an alternate version of the code with some
improvements. See the judges’ additional remarks in the author’s
remarks, for more details.</p>
<p>The author provided an alternate version of the code with some improvements. See
the judges’ additional remarks in the author’s remarks, for more details.</p>
<h3 id="alternate-build">Alternate 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> alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>tromp.alt</code> as you would <code>tromp</code> above.</p>
<p>NOTE: testing more than one user updating the high score file, one of
the benefits of the alt version, has not been done.</p>
<p>The original unmodified alternate code, which will no longer work
right if it even compiles, is provided later in the author’s
remarks.</p>
<p>NOTE: testing more than one user updating the high score file, one of the
benefits of the alt version, has not been done.</p>
<p>The original unmodified alternate code, which will no longer work right if it
even compiles, is provided later in the author’s remarks.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This is a character terminal version of the <code>TETRIS</code> game.
It runs on a VT100 compatible terminal or emulator. It is best used at
4800 baud or more.</p>
<p>By default, <code>drops_per_sec</code>, the number of times a
tetrimino will drop in a second, is 2. The default
<code>cmd_string</code> is <code>jkl pq</code>. The first 6 characters
of <code>cmd_string</code> relate to the following 6 game commands:</p>
It runs on a VT100 compatible terminal or emulator. It is
best used at 4800 baud or more.</p>
<p>By default, <code>drops_per_sec</code>, the number of times a tetrimino
will drop in a second, is 2. The default <code>cmd_string</code> is
<code>jkl pq</code>. The first 6 characters of <code>cmd_string</code> relate
to the following 6 game commands:</p>
<ul>
<li>j - left</li>
<li>k - rotate</li>
@@ -196,48 +193,43 @@ of <code>cmd_string</code> relate to the following 6 game commands:</p>
<li>p - pause</li>
<li>q - quit</li>
</ul>
<p>Specifying <code>cmd_string</code> allows one to redefine the
commands. The pause command pauses the game, clears the screen and
prints the current score. To resume, type the pause character again,
which by default is <code>p</code>.</p>
<p>Specifying <code>cmd_string</code> allows one to redefine the commands.
The pause command pauses the game, clears the screen and
prints the current score. To resume, type the pause
character again, which by default is <code>p</code>.</p>
<p>As was stated last year, we are likely to be more strict about
portability in the future. [ We mean it this time :-) ]</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This program plays the familiar game of <code>TETRIS</code> with the
following features:</p>
<ul>
<li><p>outputs vt100-like escape-sequences for cursor positioning and
normal/reverse video in curses like fashion (minimal output for screen
updates)</p></li>
<li><p>outputs vt100-like escape-sequences for cursor
positioning and normal/reverse video in curses
like fashion (minimal output for screen updates)</p></li>
<li><p>continuously increasing speed (except in pause)</p></li>
<li><p>start speed selectable by giving <code>n</code> as first
argument, where <code>n</code> is the number of drops per second
(default=2).</p></li>
<li><p>controls also selectable by giving as the second argument a
string of 6 characters. By default they are
<code>jkl pq</code>.</p></li>
<li><p>screen is blanked during the pause and the score is
shown</p></li>
<li><p>start speed selectable by giving <code>n</code> as first argument,
where <code>n</code> is the number of drops per second (default=2).</p></li>
<li><p>controls also selectable by giving as the second argument
a string of 6 characters. By default they are <code>jkl pq</code>.</p></li>
<li><p>screen is blanked during the pause and the score is shown</p></li>
<li><p>maintains a high-score table</p></li>
</ul>
<p>Giving a full path name for the table will result in a system-wide
high-score allowing a competition between users.</p>
<h3 id="additional-remarks-from-the-judges">Additional remarks from the
judges:</h3>
<p>Giving a full path name for the table will result in a
system-wide high-score allowing a competition between users.</p>
<h3 id="additional-remarks-from-the-judges">Additional remarks from the judges:</h3>
<p>The author provided us with the following notes and new version of
the program:</p>
<p>Here is a somewhat improved version of my tetris entry. All the
changes are in the <code>popen()</code> at the end. Formerly a move was
done to the HI score file which is not permitted for other users. Now
other users can change the <code>HI</code> score file. The extra option
<code>-m</code> is passed to sort, so that it knows that its input files
are already sorted. The <code>-o</code> output option of sort is used
instead of a temporary file.</p>
<p>You may also want to consider giving just the raw option to
<code>stty</code> at the start and <code>-raw</code> at the end. This
further reduces the size of the program, but has the possible
disadvantage that the program can only by stopped by ‘q’ or by the `kill
-9’ command.</p>
changes are in the <code>popen()</code> at the end. Formerly a move was done
to the HI score file which is not permitted for other users. Now
other users can change the <code>HI</code> score file. The extra option <code>-m</code> is
passed to sort, so that it knows that its input files are already
sorted. The <code>-o</code> output option of sort is used instead of a
temporary file.</p>
<p>You may also want to consider giving just the raw option to <code>stty</code>
at the start and <code>-raw</code> at the end. This further reduces the size of
the program, but has the possible disadvantage that the program
can only by stopped by ‘q’ or by the `kill -9’ command.</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="dt">long</span> h<span class="op">[</span><span class="dv">4</span><span class="op">];</span>t<span class="op">(){</span>h<span class="op">[</span><span class="dv">3</span><span class="op">]-=</span>h<span class="op">[</span><span class="dv">3</span><span class="op">]/</span><span class="dv">3000</span><span class="op">;</span>setitimer<span class="op">(</span><span class="dv">0</span><span class="op">,</span>h<span class="op">,</span><span class="dv">0</span><span class="op">);}</span>c<span class="op">,</span>d<span class="op">,</span>l<span class="op">,</span>v<span class="op">[]={(</span><span class="dt">int</span><span class="op">)</span>t<span class="op">,</span><span class="dv">0</span><span class="op">,</span><span class="dv">2</span><span class="op">},</span>w<span class="op">,</span>s<span class="op">,</span>I<span class="op">,</span>K</span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a> <span class="op">=</span><span class="dv">0</span><span class="op">,</span>i<span class="op">=</span><span class="dv">276</span><span class="op">,</span>j<span class="op">,</span>k<span class="op">,</span>q<span class="op">[</span><span class="dv">276</span><span class="op">],</span>Q<span class="op">[</span><span class="dv">276</span><span class="op">],*</span>n<span class="op">=</span>q<span class="op">,*</span>m<span class="op">,</span>x<span class="op">=</span><span class="dv">17</span><span class="op">,</span>f<span class="op">[]={</span><span class="dv">7</span><span class="op">,-</span><span class="dv">13</span><span class="op">,-</span><span class="dv">12</span><span class="op">,</span><span class="dv">1</span><span class="op">,</span><span class="dv">8</span><span class="op">,-</span><span class="dv">11</span><span class="op">,-</span><span class="dv">12</span><span class="op">,-</span><span class="dv">1</span><span class="op">,</span><span class="dv">9</span><span class="op">,-</span><span class="dv">1</span><span class="op">,</span><span class="dv">1</span><span class="op">,</span></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a> <span class="dv">12</span><span class="op">,</span><span class="dv">3</span><span class="op">,-</span><span class="dv">13</span><span class="op">,-</span><span class="dv">12</span><span class="op">,-</span><span class="dv">1</span><span class="op">,</span><span class="dv">12</span><span class="op">,-</span><span class="dv">1</span><span class="op">,</span><span class="dv">11</span><span class="op">,</span><span class="dv">1</span><span class="op">,</span><span class="dv">15</span><span class="op">,-</span><span class="dv">1</span><span class="op">,</span><span class="dv">13</span><span class="op">,</span><span class="dv">1</span><span class="op">,</span><span class="dv">18</span><span class="op">,-</span><span class="dv">1</span><span class="op">,</span><span class="dv">1</span><span class="op">,</span><span class="dv">2</span><span class="op">,</span><span class="dv">0</span><span class="op">,-</span><span class="dv">12</span><span class="op">,-</span><span class="dv">1</span><span class="op">,</span><span class="dv">11</span><span class="op">,</span><span class="dv">1</span><span class="op">,-</span><span class="dv">12</span><span class="op">,</span><span class="dv">1</span><span class="op">,</span><span class="dv">13</span><span class="op">,</span><span class="dv">10</span><span class="op">,-</span><span class="dv">12</span><span class="op">,</span></span>
@@ -258,53 +250,34 @@ disadvantage that the program can only by stopped by ‘q’ or by the `kill
<span id="cb6-18"><a href="#cb6-18" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;stty -cbreak echo stop </span><span class="sc">\023</span><span class="st">;sort -mnr -o HI - HI;cat HI&quot;</span><span class="op">,</span><span class="st">&quot;w&quot;</span><span class="op">);</span>fprintf<span class="op">(</span>d<span class="op">,</span></span>
<span id="cb6-19"><a href="#cb6-19" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;</span><span class="sc">%4d</span><span class="st"> from level </span><span class="sc">%1d</span><span class="st"> by </span><span class="sc">%s\n</span><span class="st">&quot;</span><span class="op">,</span>w<span class="op">,</span>l<span class="op">,</span>getlogin<span class="op">());</span>pclose<span class="op">(</span>d<span class="op">);}</span></span></code></pre></div>
<p>NOTE: the alternate version was fixed for modern systems in 2023.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1989tromp"><a name="inventory"></a>Inventory for
1989/tromp</h1>
<h1 id="inventory-for-1989tromp"><a name="inventory"></a>Inventory for 1989/tromp</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/tromp/tromp.c">tromp.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/tromp/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/tromp/tromp.alt.c">tromp.alt.c</a>
- alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/tromp/tromp.orig.c">tromp.orig.c</a>
- original source</li>
<li><a href="1989_tromp.tar.bz2">1989_tromp.tar.bz2</a> - download entry
source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/tromp/tromp.c">tromp.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/tromp/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/tromp/tromp.alt.c">tromp.alt.c</a> - alternative source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/tromp/tromp.orig.c">tromp.orig.c</a> - original source</li>
<li><a href="1989_tromp.tar.bz2">1989_tromp.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/tromp/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/tromp/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/tromp/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/tromp/.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/1989/tromp/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/tromp/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+24 -44
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#David_Van_Brackle">David Van
Brackle</a><br> Location: <a href="../../location.html#ZZ">ZZ</a> -
<em>Unknown location</em> <br><br></li>
<li>Name: <a href="../../authors.html#David_Van_Brackle">David Van Brackle</a><br>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -144,67 +144,47 @@ Brackle</a><br> Location: <a href="../../location.html#ZZ">ZZ</a> -
<h2 id="try">Try:</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">./try.sh</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This program computes all proper subsets of the set of arguments
passed to it. Each subset is printed with one element on each line,
followed by a line of ten dashes.</p>
<p>This program computes all proper subsets of the set of
arguments passed to it. Each subset is printed with one
element on each line, followed by a line of ten dashes.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>The program has the following charming and possibly non-portable
features:</p>
<p>The program has the following charming and possibly
non-portable features:</p>
<ul>
<li><p>It has no local or global variables, only the command-line
parameters.</p></li>
<li><p>It has no local or global variables, only the command-line parameters.</p></li>
<li><p>It calls <code>main()</code> recursively.</p></li>
<li><p>It alters the command-line parameters.</p></li>
<li><p>It uses the fact that if the high bit is set in a character
variable, the value is negative.</p></li>
<li><p>It uses the fact that if the high bit is set in a character variable, the
value is negative.</p></li>
</ul>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1989vanb"><a name="inventory"></a>Inventory for
1989/vanb</h1>
<h1 id="inventory-for-1989vanb"><a name="inventory"></a>Inventory for 1989/vanb</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/vanb/vanb.c">vanb.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/vanb/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/vanb/vanb.orig.c">vanb.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/vanb/try.sh">try.sh</a>
- how to run</li>
<li><a href="1989_vanb.tar.bz2">1989_vanb.tar.bz2</a> - download entry
source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/vanb/vanb.c">vanb.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/vanb/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/vanb/vanb.orig.c">vanb.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/vanb/try.sh">try.sh</a> - how to run</li>
<li><a href="1989_vanb.tar.bz2">1989_vanb.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/vanb/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/vanb/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/vanb/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/vanb/.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/1989/vanb/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/vanb/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
+79 -114
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Brian_Westley">Brian
Westley</a><br> Location: <a href="../../location.html#US">US</a> -
<em>United States of America</em> (<em>United States</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Brian_Westley">Brian Westley</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -144,17 +144,14 @@ Westley</a><br> Location: <a href="../../location.html#US">US</a> -
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code>STATUS: known bug - please help us fix</code></pre>
<p>For more detailed information see <a
href="../../bugs.html#1989_westley">1989 westley bugs</a>.</p>
<p>For more detailed information see <a href="../../bugs.html#1989_westley">1989 westley bugs</a>.</p>
<h2 id="try">Try:</h2>
<p>Try compiling and running the 4 resulting programs like:</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./compile.sh</span></span></code></pre></div>
<p>If you need to specify an alternate compiler path, say because your
default compiler is clang (or in the case of macOS gcc is clang) you can
do so like:</p>
<p>If you need to specify an alternate compiler path, say because your default
compiler is clang (or in the case of macOS gcc is clang) you can do so like:</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="va">CC</span><span class="op">=</span>/opt/local/bin/gcc-mp-12 <span class="ex">./compile.sh</span></span></code></pre></div>
<p>If you wish to delay the script or remove the delay you can do so
like:</p>
<p>If you wish to delay the script or remove the delay you can do so like:</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="va">DELAY</span><span class="op">=</span>2 <span class="ex">./compile.sh</span></span></code></pre></div>
<p>Finally try:</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">./westley</span></span>
@@ -166,141 +163,109 @@ like:</p>
“<code>Hello, world!\n</code>”. Can you find how to do it?</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This is a filter. If it is run with no arguments, it copies
<code>stdin</code> to <code>stdout</code>. With one argument, it ROT13’s
<code>stdin</code> to <code>stdout</code>. With two arguments, it
reverses <code>stdin</code> to <code>stdout</code>. With three
arguments, it does both. It requires the ASCII character set, with all
characters being in <code>0..255</code>, and <code>EOF</code> must be
<code>-1</code>. Also requires two’s complement (I think).</p>
<code>stdin</code> to <code>stdout</code>. With one argument, it ROT13’s <code>stdin</code> to
<code>stdout</code>. With two arguments, it reverses <code>stdin</code> to <code>stdout</code>. With
three arguments, it does both. It requires the ASCII character
set, with all characters being in <code>0..255</code>, and <code>EOF</code> must be <code>-1</code>.
Also requires two’s complement (I think).</p>
<p>The source code will run if ROT13’ed and/or reversed, using a
different algorithm for each version (hereafter referred to as
<code>ver0</code> (original), <code>ver1</code> (ROT13),
<code>ver2</code> (reversed), and <code>ver3</code> (ROT13 and
reversed)).</p>
<p>When compiling these versions, one needs to define
<code>trgpune</code> in the compile line (which the Makefile now has).
Example:</p>
<code>ver0</code> (original), <code>ver1</code> (ROT13), <code>ver2</code> (reversed), and <code>ver3</code>
(ROT13 and reversed)).</p>
<p>When compiling these versions, one needs to define <code>trgpune</code>
in the compile line (which the Makefile now has). Example:</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">cc</span> <span class="at">-Dtrgpune</span><span class="op">=</span>putchar ver3.c <span class="at">-o</span> ver3</span></code></pre></div>
<p><code>trgpune</code> is the ROT13 of <code>getchar()</code>, so
<code>getchar()</code> and <code>putchar()</code> are exchanged in the
ROT13 counterpart. It is easy to see that this is unavoidable. I must
have a <code>#define</code> for a library function; otherwise I would
have an unidentified extern for the ROT13 version. If I then define this
function, it won’t link in the library version for the ORIGINAL code,
since my definition will supersede the library function. Hence, the
<p><code>trgpune</code> is the ROT13 of <code>getchar()</code>, so <code>getchar()</code> and <code>putchar()</code>
are exchanged in the ROT13 counterpart. It is easy to see that
this is unavoidable. I must have a <code>#define</code> for a library
function; otherwise I would have an unidentified extern for the
ROT13 version. If I then define this function, it won’t link
in the library version for the ORIGINAL code, since my
definition will supersede the library function. Hence, the
compiler option gives me <code>putchar()</code>, and allows me to use
<code>getchar()</code>. I pass a dummy argument to
<code>getchar()</code> to eliminate “variable number of args” from lint
(unless it checks against the library). Otherwise, all versions of lint
complain that <code>main()</code> returns random value &amp; constant in
conditional context (when I check for ROT13 version).</p>
<p><code>ver0</code> and <code>ver1</code> use a range check and a
calculation to do ROT13, while <code>ver2</code> and <code>ver3</code>
use table lookup. All versions contain <code>main()</code> and its ROT13
function, <code>znva()</code>. <code>ver0</code>/<code>ver1</code>
(<code>ver2</code>/<code>ver3</code>) are (of course) syntactically
identical, since the syntax is in the non-alphabetic characters.
However, since one program starts at <code>main()</code> while it’s
ROT13 counterpart starts at <code>znva()</code>, <code>znva()</code>
<code>getchar()</code>. I pass a dummy argument to <code>getchar()</code> to eliminate
“variable number of args” from lint (unless it checks against
the library). Otherwise, all versions of lint complain that <code>main()</code>
returns random value &amp; constant in conditional context (when I
check for ROT13 version).</p>
<p><code>ver0</code> and <code>ver1</code> use a range check and a calculation to do ROT13,
while <code>ver2</code> and <code>ver3</code> use table lookup. All versions contain
<code>main()</code> and its ROT13 function, <code>znva()</code>. <code>ver0</code>/<code>ver1</code> (<code>ver2</code>/<code>ver3</code>) are
(of course) syntactically identical, since the syntax is in the
non-alphabetic characters. However, since one program starts
at <code>main()</code> while it’s ROT13 counterpart starts at <code>znva()</code>, <code>znva()</code>
calls main (<code>znva()</code> is also used for output).</p>
<p>All versions use recursion to work. If the program is NOT reversing
it’s output, it prints out the (possibly ROT13’d) character before
recursing, otherwise it prints it out afterward (or doesn’t recurse at
all when <code>EOF</code> is reached). Since most of this code is
identical, it is put into <code>znva()</code> and called with a first
parameter of 0 as a flag (as <code>main()</code>, it’s first argument
(argc) must be at least one).</p>
<p>I can’t use any flow control. If I used <code>if()</code>, I would
have a function <code>vs()</code> to define in the ROT13 version. But a
function called <code>vs()</code> turns into a function called
<code>if()</code> in the original, so it can’t be done. Therefore, I
do:</p>
<p>All versions use recursion to work. If the program is NOT
reversing it’s output, it prints out the (possibly ROT13’d)
character before recursing, otherwise it prints it out
afterward (or doesn’t recurse at all when <code>EOF</code> is reached).
Since most of this code is identical, it is put into <code>znva()</code> and
called with a first parameter of 0 as a flag (as <code>main()</code>, it’s
first argument (argc) must be at least one).</p>
<p>I can’t use any flow control. If I used <code>if()</code>, I would have a
function <code>vs()</code> to define in the ROT13 version. But a function
called <code>vs()</code> turns into a function called <code>if()</code> in the original,
so it can’t be done. Therefore, I do:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a>expr1 <span class="op">&amp;&amp;</span> expr2 <span class="op">&amp;&amp;</span> <span class="op">(</span>expr3<span class="op">=</span>etc<span class="op">);</span></span></code></pre></div>
<p>which is the same as:</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="op">(</span>expr1 <span class="op">&amp;&amp;</span> expr2<span class="op">)</span> expr3<span class="op">=</span>etc<span class="op">;</span></span></code></pre></div>
<p>A/UX on the Macintosh doesn’t get this right; it evaluates ALL
expressions if they aren’t in an assignment or conditional statement.
This might warrant a warning, since other compilers may do this. I found
MANY compilers botched:</p>
expressions if they aren’t in an assignment or conditional
statement. This might warrant a warning, since other compilers
may do this. I found MANY compilers botched:</p>
<div class="sourceCode" id="cb10"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a>expr1 <span class="op">&amp;&amp;</span> <span class="op">(</span>expr2<span class="op">,</span>expr3<span class="op">);</span></span></code></pre></div>
<p><code>expr2</code> was OFTEN evaluated even if <code>expr1</code> was
false. I removed such statements to make it more portable.</p>
<p><code>expr2</code> was OFTEN evaluated even if <code>expr1</code> was false. I removed
such statements to make it more portable.</p>
<h3 id="variable-names-worth-noting">Variable names worth noting</h3>
<p><code>irk</code> and <code>vex</code> are ROT13 pairs and are
synonyms.</p>
<p><code>Near</code> and <code>Arne</code> are ROT13 pairs and are
anagrams.</p>
<p><code>NOON</code> and <code>ABBA</code> are ROT13 pairs and are
palindromes.</p>
<p><code>tang</code> and <code>gnat</code> are both ROT13 and palindrome
pairs!</p>
<p><code>irk</code> and <code>vex</code> are ROT13 pairs and are synonyms.</p>
<p><code>Near</code> and <code>Arne</code> are ROT13 pairs and are anagrams.</p>
<p><code>NOON</code> and <code>ABBA</code> are ROT13 pairs and are palindromes.</p>
<p><code>tang</code> and <code>gnat</code> are both ROT13 and palindrome pairs!</p>
<p>–</p>
<p>Normally (!), a reversible C program is done thus:</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="co">/**/</span> forward code <span class="co">/*/ edoc drawkcab /**/</span></span></code></pre></div>
<p>If your compiler nests comments, it will get this wrong. However, I
have made some bits of the code palindromic, (or different, but
reversible) so it is more like:</p>
<p>If your compiler nests comments, it will get this wrong.
However, I have made some bits of the code palindromic,
(or different, but reversible) so it is more like:</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="co">/**/</span>forward<span class="co">/*//**/</span> palindromic <span class="co">/**//*/drawkcab/**/</span></span></code></pre></div>
<p>The code can therefore be interlaced. There are eight such
palindromic bits. You can find them within the
<p>The code can therefore be interlaced. There are eight
such palindromic bits. You can find them within the
<code>/*//**/ /**//*/</code> pairs.</p>
<p>The body of the code of <code>ver0</code> and <code>ver1</code> is a
large lumpy <code>K</code> (for Kernighan); the code of
<code>ver2</code> and <code>ver3</code> is a flat-topped and lumpier
<code>R</code> (for Ritchie). Judicious use of spaces and tabs helped
here. It barely fits on an 80x24 screen. Squint. Note that the code must
start with a blank line, or the reversed version will lack a terminating
newline.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<p>The body of the code of <code>ver0</code> and <code>ver1</code> is a large lumpy <code>K</code> (for
Kernighan); the code of <code>ver2</code> and <code>ver3</code> is a flat-topped and
lumpier <code>R</code> (for Ritchie). Judicious use of spaces and tabs
helped here. It barely fits on an 80x24 screen. Squint. Note
that the code must start with a blank line, or the reversed version
will lack a terminating newline.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1989westley"><a name="inventory"></a>Inventory for
1989/westley</h1>
<h1 id="inventory-for-1989westley"><a name="inventory"></a>Inventory for 1989/westley</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/westley.c">westley.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/westley.orig.c">westley.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/compile.sh">compile.sh</a>
- generate and compile versions</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/try.sh">try.sh</a>
- how to run</li>
<li><a href="1989_westley.tar.bz2">1989_westley.tar.bz2</a> - download
entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/westley.c">westley.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/westley.orig.c">westley.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/compile.sh">compile.sh</a> - generate and compile versions</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/try.sh">try.sh</a> - how to run</li>
<li><a href="1989_westley.tar.bz2">1989_westley.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/.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/1989/westley/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->