We rename `bin/gen-top-md2html.sh` to `bin/gen-top-html.sh`. Modified the `bin/gen-top-html.sh` tool to build `archive/historic/index.html` from `archive/historic/README.md`. In `bin/gen-top-html.sh` changed VERSION from "1.1 2024-02-28" to "1.2 2024-02-29". Renamed `make gen_top_md2html` to `gen_top_html` in the top level `Makefile`. Improved `archive/historic/README.md`. Updated `robots.txt` to include the Sitemap directive. Moved unused `valid-html401.png` to `png/valid-html401.png`. This png image may be used later. Performed `make gen_top_html` which rebuilt all top level HTML files as well as `bin/index.html` and `inc/index.html`.
4910 lines
313 KiB
HTML
4910 lines
313 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||
<!-- -->
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
<!-- -->
|
||
<!-- END: this line ends content from: inc/top.default.html -->
|
||
<!-- -->
|
||
<!-- The original markdown content was formed by the tool: bin/gen-top-html.sh -->
|
||
<!-- The HTML was converted from markdown by the tool: bin/md2html.sh -->
|
||
<!-- -->
|
||
<!-- START: this line starts content from: inc/head.default.html -->
|
||
|
||
<head>
|
||
<link rel="stylesheet" href="./ioccc.css">
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||
<title>The International Obfuscated C Code Contest</title>
|
||
<meta name="description" content="Thanks for all the fixes of IOCCC winning entries">
|
||
<meta name="keywords" content="IOCCC, thanks, thanx, thank you">
|
||
</head>
|
||
|
||
<!-- END: this line ends content from: inc/head.default.html -->
|
||
<!-- START: this line starts content from: inc/body.default.html -->
|
||
|
||
<body>
|
||
|
||
<!-- END: this line ends content from: inc/body.default.html -->
|
||
<!-- START: this line starts content from: inc/header.default.html -->
|
||
|
||
<div class="header">
|
||
<img src="./png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
|
||
<h1>The International Obfuscated C Code Contest</h1>
|
||
<h2>Thanking people for their fixes to IOCCC winning entries</h2>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/header.default.html -->
|
||
<!-- START: this line starts content from: inc/begin-row.default.html -->
|
||
|
||
<div class="row">
|
||
|
||
<!-- END: this line ends content from: inc/begin-row.default.html -->
|
||
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
|
||
|
||
<div class="leftcolumn">
|
||
|
||
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
|
||
<!-- START: this line starts content from: inc/sidenav.default.html -->
|
||
|
||
<div class="sidenav">
|
||
<a href="#content">Jump to contents</a>
|
||
</div>
|
||
<hr>
|
||
<div class="sidenav">
|
||
<a href="./index.html">IOCCC Home</a>
|
||
<a href="./years.html">Winning Entries</a>
|
||
<a href="./authors.html">People who have won</a>
|
||
</div>
|
||
<hr>
|
||
<div class="sidenav">
|
||
<a href="./news.html">IOCCC News</a>
|
||
<a href="./faq.html#submit">How to enter the IOCCC</a>
|
||
<a href="./faq.html">FAQ</a>
|
||
</div>
|
||
<hr>
|
||
<div class="sidenav">
|
||
<a href="./bugs.html">Bugs & (mis)features</a>
|
||
<a href="./faq.html#fix_an_entry">Fixing IOCCC entries</a>
|
||
<a href="./faq.html#fix_web_site">Fixing the web site</a>
|
||
<a href="./faq.html#fix_author">Fixing author info</a>
|
||
<a href="./thanks-for-help.html">Thanks for the help</a>
|
||
</div>
|
||
<hr>
|
||
<div class="sidenav">
|
||
<a href="./judges.html">The IOCCC Judges</a>
|
||
<a href="./contact.html">Contacting the IOCCC</a>
|
||
</div>
|
||
<hr>
|
||
<div class="sidenav">
|
||
<a href="#top">Jump to top</a>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/sidenav.default.html -->
|
||
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
|
||
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
|
||
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
|
||
|
||
<div class="rightcolumn">
|
||
|
||
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
|
||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||
|
||
<a name="content"></a>
|
||
|
||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||
|
||
<h1 id="thanks-for-all-the-fixes">Thanks for all the fixes</h1>
|
||
<h2 id="and-thanks-for-all-the-fish.--">.. and thanks for all the fish.
|
||
:-)</h2>
|
||
<p>To avoid having to change numerous “<em>README.md</em>” files to add
|
||
thank you notes, we centralize them below.</p>
|
||
<p>The <a href="https://www.ioccc.org/judges.html">IOCCC judges</a> wish
|
||
to recognize the many important contributions to the IOCCC presentation
|
||
of past IOCCC entries. We are pleased to note the many contributions,
|
||
<strong>made since 2021 Jan 01</strong>, on a IOCCC entry by entry
|
||
basis.</p>
|
||
<h2 id="ioccc-thank-you-table-of-contents">IOCCC thank you table of
|
||
contents</h2>
|
||
<ul>
|
||
<li><a href="#1984">1984 entries</a> | <a href="#1985">1985 entries</a>
|
||
| <a href="#1986">1986 entries</a> | <a href="#1987">1987
|
||
entries</a></li>
|
||
<li><a href="#1988">1988 entries</a> | <a href="#1989">1989 entries</a>
|
||
| <a href="#1990">1990 entries</a> | <a href="#1991">1991
|
||
entries</a></li>
|
||
<li><a href="#1992">1992 entries</a> | <a href="#1993">1993 entries</a>
|
||
| <a href="#1994">1994 entries</a> | <a href="#1995">1995
|
||
entries</a></li>
|
||
<li><a href="#1996">1996 entries</a> | <a href="#1998">1998 entries</a>
|
||
| <a href="#2000">2000 entries</a> | <a href="#2001">2001
|
||
entries</a></li>
|
||
<li><a href="#2004">2004 entries</a> | <a href="#2005">2005 entries</a>
|
||
| <a href="#2006">2006 entries</a> | <a href="#2011">2011
|
||
entries</a></li>
|
||
<li><a href="#2012">2012 entries</a> | <a href="#2013">2013 entries</a>
|
||
| <a href="#2014">2014 entries</a> | <a href="#2015">2015
|
||
entries</a></li>
|
||
<li><a href="#2018">2018 entries</a> | <a href="#2019">2019 entries</a>
|
||
| <a href="#2020">2020 entries</a></li>
|
||
<li><a href="#general_thanks">General thanks</a></li>
|
||
<li><a href="#makefiles_fixes_improvements">Makefiles fixes and
|
||
improvements</a></li>
|
||
<li><a href="#consistency_improvements">Consistency
|
||
improvements</a></li>
|
||
<li><a href="#thank_you_honor_roll">Thank you honor roll</a></li>
|
||
<li><a href="#neglect">Did we neglect to credit you?</a></li>
|
||
</ul>
|
||
<h1 id="section"><a name="1984"></a>1984</h1>
|
||
<h2 id="anonymous-readme.md"><a name="1984_anonymous"></a><a
|
||
href="/1984/anonymous/anonymous.c">1984/anonymous</a> (<a
|
||
href="/1984/anonymous/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to work for macOS.</p>
|
||
<p>The problem was to do with the way that the <code>read(2)</code>
|
||
function was redefined. With macOS the second arg needs to be a
|
||
<code>void *</code> and this also necessitated some casts to
|
||
<code>int</code> (on the second arg) in the call to
|
||
<code>write(2)</code> (in <code>read()</code>).</p>
|
||
<p>Later Cody corrected the mistake where the
|
||
<code>"hello, world!"</code> string was on one line rather than two
|
||
lines which the author told us (Landon) that they liked. Thus now it is
|
||
like the original where the first line ends with <code>"hell\</code> and
|
||
the second line starts with <code>o, world!\n"</code>.</p>
|
||
<p>By request, the original code is provided as <a
|
||
href="/1984/anonymous/anonymous.alt.c">anonymous.alt.c</a> so that one
|
||
can look at it and the famous tattoo which we also include here:</p>
|
||
<figure>
|
||
<img src="/1984/anonymous/1984-anonymous-tattoo.jpg"
|
||
alt="1984-anonymous-tattoo.jpg" />
|
||
<figcaption aria-hidden="true">1984-anonymous-tattoo.jpg</figcaption>
|
||
</figure>
|
||
<p>…which was done in 2005 by <a
|
||
href="https://web.archive.org/web/20070120220721/https://thomasscovell.com/tattoo.php">Thomas
|
||
Scovell</a>.</p>
|
||
<h2 id="decot-readme.md"><a name="1984_decot"></a><a
|
||
href="/1984/decot/decot.c">1984/decot</a> (<a
|
||
href="/1984/decot/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to not require
|
||
<code>-traditional-cpp</code> which some compilers like clang do not
|
||
support. Fixing <code>-traditional-cpp</code> is, as noted later on,
|
||
very complicated, but we encourage you to look at the alternate code
|
||
(which is the original code with a minor modification made by the
|
||
judges) and the fixed code, to see what had to be done.</p>
|
||
<p>Clang is also more strict about the type of args in
|
||
<code>main()</code> and this was also a problem that Cody fixed, making
|
||
it work with both clang and gcc.</p>
|
||
<p>These fixes worked fine in macOS but it turned out that in some cases
|
||
with clang in Linux it did not work so this had to be further fixed
|
||
which Cody also did. It is no longer clear what the problem was as in
|
||
fedora 38 with clang 16.0.6 the only difference is it causes additional
|
||
warnings but it seems to work just fine. It seems unlikely that a fix
|
||
was made just for warnings so it is presumed that there was another
|
||
problem so the change is kept in place.</p>
|
||
<p>A note about the fix is that the <code>#define</code>d macros that
|
||
were used still exist but most are not used; they are left in just to
|
||
make it look more like the original entry. Nevertheless those cannot be
|
||
used.</p>
|
||
<p>Later on Cody improved the fix to make it look rather more like the
|
||
original by bringing back an extern declaration (slightly changing it to
|
||
match the symbol that it is
|
||
i.e. <code>extern double floor(double);</code> instead of
|
||
<code>extern int floor;</code>) and also bringing back
|
||
<code>double (x1, y1) b;</code> and even this funny code that could be
|
||
kept in:</p>
|
||
<div class="sourceCode" id="cb1"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#define char k</span><span class="op">[</span><span class="ch">'a'</span><span class="op">]</span></span>
|
||
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="dt">char</span> x <span class="op">{</span><span class="kw">sizeof</span><span class="op">(</span></span>
|
||
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a> <span class="dt">double</span><span class="op">(%</span>s<span class="op">,%</span>D<span class="op">)(*)())</span></span></code></pre></div>
|
||
<p>This does mean that there cannot be a second arg to
|
||
<code>main()</code> as clang requires that to be a <code>char **</code>
|
||
and the <code>char</code> redefined would not allow this. Some versions
|
||
of clang say that <code>main()</code> must have either 0, 2 or 3 args
|
||
but these versions do not object to 1 arg. However as the
|
||
<code>char</code> macro seems more obscure and it is possible that a new
|
||
version of clang will be even more strict the <code>int i</code>
|
||
parameter in <code>main()</code> was moved to be inside
|
||
<code>main()</code>, set to non-zero (setting <code>i</code> to 0 will
|
||
not work). This way <code>main()</code> has zero args.</p>
|
||
<p>Observe how on line 29 there is a call to <code>main()</code> which
|
||
does pass in a parameter. It has never been observed to be an error to
|
||
pass in too many parameters to a function (<code>main()</code> or
|
||
otherwise - it warns with other functions but does not appear to with
|
||
<code>main()</code>) but only that <code>main()</code> itself has a
|
||
certain number of args (in some versions) and that the first arg is an
|
||
<code>int</code> and the others are <code>char **</code>s. This is why
|
||
the arg was removed and the call to <code>main()</code> was not updated
|
||
beyond what had to be done to fix it for compilers that do not support
|
||
<code>-traditional-cpp</code>.</p>
|
||
<p>If the ANSI C committee or a new version of clang messes this up
|
||
(both of which seems possible) it is easy to fix but it is hoped that
|
||
this won’t happen.</p>
|
||
<p>Originally <a href="#yusuke">Yusuke</a> supplied a patch so that this
|
||
entry would compile with gcc - but not clang - or at least some
|
||
versions.</p>
|
||
<p>To see the difference from start to fixed:</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="bu">cd</span> 1984/decot <span class="kw">;</span> <span class="fu">make</span> diff_orig_prog</span></code></pre></div>
|
||
<h2 id="laman-readme.md"><a name="1984_laman"></a><a
|
||
href="/1984/laman/laman.c">1984/laman</a> (<a
|
||
href="/1984/laman/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="1984/laman/try.sh">try.sh</a> script.</p>
|
||
<p>Cody also fixed this to not crash when no arg is specified. Note that
|
||
if the arg is not a positive number it will not do anything useful or
|
||
anything at all. This was fixed on 30 October 2023 after the bug status
|
||
was changed from INABIAF (it’s not a bug it’s a feature) to bug.</p>
|
||
<h2 id="mullender-readme.md"><a name="1984_mullender"></a><a
|
||
href="/1984/mullender/mullender.c">1984/mullender</a> (<a
|
||
href="/1984/mullender/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> provided an <a
|
||
href="/1984/mullender/mullender.alt.c">alternate version</a>, an
|
||
improved version of the judges, so that everyone can enjoy it with
|
||
systems that are not VAX/PDP. It moves at approximately the same speed
|
||
as the original did. We also refer you to the <a href="faq.md">FAQ</a>
|
||
as there are some winning entries that also let one enjoy it (which
|
||
through trial and error was how the right speed was discovered) - with
|
||
more to them of course! The difference between the original is that it
|
||
will start over after it times out but that might not happen with the
|
||
original (might need you to press a key though this is not known for
|
||
sure).</p>
|
||
<p>Cody also added the <a href="/1984/mullender/gentab.c">gentab.c</a>
|
||
file, fixed to compile (and work, though see <a
|
||
href="#1984mullender-readmemd">bugs.md</a>) with modern systems and so
|
||
that it would create the proper array (it had unbalanced ’}’s), which
|
||
the author noted in their remarks (which Cody also found). As this file
|
||
uses the old header file <code>a.out.h</code> that is not available in
|
||
all modern systems, Cody found a copy of it as to what it should have
|
||
been at the time, in the fabulous <a
|
||
href="https://github.com/dspinellis/unix-history-repo/tree/Research-Release">Unix
|
||
History Repo</a>.</p>
|
||
<h1 id="section-1"><a name="1985"></a>1985</h1>
|
||
<h2 id="applin-readme.md"><a name="1985_applin"></a><a
|
||
href="/1985/applin/applin.c">1985/applin</a> (<a
|
||
href="/1985/applin/README.md%5D">README.md</a>)</h2>
|
||
<p>Both <a href="#cody">Cody</a> and <a href="#yusuke">Yusuke</a> fixed
|
||
this; Yusuke got this to not crash and Cody fixed it to work with
|
||
macOS.</p>
|
||
<p>The crash was because it destructively rewrites string literals.
|
||
However with <code>strdup()</code> it’s safe.</p>
|
||
<p>The problem with macOS is that although it didn’t crash, it printed
|
||
<code>H????</code> in a seemingly infinite loop, each time printing
|
||
another <code>?</code>, and it probably would have until it runs out of
|
||
memory.</p>
|
||
<p>The fix for macOS is that there was no prototype for
|
||
<code>execlp()</code> and macOS has problems with missing prototypes for
|
||
some functions (this was also seen when Cody fixed <a
|
||
href="/1984/anonymous/anonymous.c">1984/anonymous</a> for macOS as
|
||
well). As this is a one-liner the include of <code>unistd.h</code> was
|
||
done in the Makefile. Ironically this fix was discovered through
|
||
Linux!</p>
|
||
<p>NOTE: originally this entry did not print a newline prior to
|
||
returning to the shell, after the output (despite having <code>\n</code>
|
||
in the string - can you figure out why?) but to make it more friendly to
|
||
users Cody made it print a <code>\n</code> prior to returning to the
|
||
shell. The original version does not have this change.</p>
|
||
<h2 id="august-readme.md"><a name="1985_august"></a><a
|
||
href="/1985/august/august.c">1985/august</a> (<a
|
||
href="/1985/august/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a>, out of abundance of caution, added a second
|
||
arg to <code>main()</code> because some versions of clang object to the
|
||
number of args of <code>main()</code>, saying that it must be 0, 2 or 3.
|
||
The version this has been observed in does not actually object to 1 arg
|
||
but it is entirely possible that this changes so a second arg (that’s
|
||
not needed and is unused) has been added just in case.</p>
|
||
<p>Cody also added the script <a
|
||
href="/1985/august/primes.sh">primes.sh</a> which allows one to check
|
||
the output for the first N prime numbers of the output, where N is
|
||
either the default or user specified. The inspiration was the previous
|
||
‘try’ command he gave to have fun with finding primes that might seem
|
||
unusual in a way.</p>
|
||
<p>Cody also added the <a href="/1985/august/try.sh">try.sh</a> script
|
||
(which calls <code>primes.sh</code> whether <code>primes(6)</code> is
|
||
installed or not but it only does it once with the default value).</p>
|
||
<h2 id="lycklama-readme.md"><a name="1985_lycklama"></a><a
|
||
href="/1985/lycklama/lycklama.c">1985/lycklama</a> (<a
|
||
href="/1985/lycklama/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to compile with modern compilers.
|
||
In the past one could get away with defining some macro to
|
||
<code>#define</code> and then use <code>#foo</code> to have the same
|
||
effect as using <code>#define</code> but this does not work in modern
|
||
systems so Cody changed the <code>#o</code> lines to
|
||
<code>#define</code>. Also <code>unistd.h</code> had to be
|
||
<code>#include</code>d.</p>
|
||
<p><a href="#yusuke">Yusuke</a> provided some useful information that
|
||
amounts to an alternate version that Cody added. See the README.md for
|
||
details.</p>
|
||
<p>Cody also provided the <a
|
||
href="/1985/lycklama/try.alt.sh">try.alt.sh</a> script.</p>
|
||
<h2 id="shapiro-readme.md"><a name="1985_shapiro"></a><a
|
||
href="/1985/shapiro/shapiro.c">1985/shapiro</a> (<a
|
||
href="/1985/shapiro/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the alt code which allows one to
|
||
resize the maze and he also added the <a
|
||
href="/1985/shapiro/try.alt.sh">try.alt.sh</a> script that randomly
|
||
selects sizes (five times) and compiles and runs it. After the five runs
|
||
it prompts you to enter a number, in an infinite loop, exiting if any
|
||
non-digits are in input (this includes negative numbers which in the
|
||
code actually sets it back to 39, the default).</p>
|
||
<h2 id="sicherman-readme.md"><a name="1985_sicherman"></a><a
|
||
href="/1985/sicherman/sicherman.c">1985/sicherman</a> (<a
|
||
href="/1985/sicherman/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this <em>very twisted entry</em> to
|
||
not require <code>-traditional-cpp</code>. Fixing
|
||
<code>-traditional-cpp</code> is, as noted later on, very complicated,
|
||
but Cody would like to refer you to the original file <a
|
||
href="/1985/sicherman/sicherman.orig.c">sicherman.orig.c</a> and he
|
||
suggests that you then compare it to <a
|
||
href="/1985/sicherman/sicherman.c">sicherman.c</a> for some good old
|
||
C-fashioned fun (alternatively, see below explanation)!</p>
|
||
<p>Later on Cody improved the fix so that it looks much more like the <a
|
||
href="/1985/sicherman/sicherman.c">original entry</a>. He did this
|
||
several more times and it’s as close to the original as one can get
|
||
without causing compiler errors.</p>
|
||
<p>To get this to all work the following changes were made. If you
|
||
really want to understand this Cody provides the following. First run
|
||
the following command from the directory:</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> diff_orig_prog</span></code></pre></div>
|
||
<p>and then read the following (you might also wish to look at the code
|
||
in an editor with syntax highlighting):</p>
|
||
<ul>
|
||
<li><p>Because of the macros <code>C</code> and <code>V</code> in the
|
||
original code, the args to <code>main()</code> were actually not what
|
||
they appear: the only arg that existed in <code>main()</code> was
|
||
<code>Manual</code>. Thus it now looks like:</p>
|
||
<div class="sourceCode" id="cb4"><pre
|
||
class="sourceCode c"><code class="sourceCode c"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>main<span class="op">(</span></span>
|
||
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="co">/* C program. (If you don't</span></span>
|
||
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="co"> * understand it look it</span></span>
|
||
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a><span class="co"> * up.) (In the C*/</span> Manual<span class="op">)</span></span>
|
||
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span></code></pre></div></li>
|
||
<li><p>The macros <code>C</code> and <code>V</code> were changed to
|
||
lower case. This is because it felt like the <code>C=" ..</code>’ part
|
||
in <code>subr()</code> would be better to be upper case as it talks
|
||
about the language. Also in the second <a
|
||
href="/1985/sicherman/sicherman.alt2.c">alternate version</a> (the first
|
||
being the original code) which is in case a new version of clang ever
|
||
objects to only one arg in <code>main()</code> (which is not out of the
|
||
realm of possibility), <code>main()</code> can have <code>C</code> as
|
||
<code>argc</code> to <code>main()</code> so it would read like it once
|
||
did: <code>C manual</code> albeit with a <code>,</code> separating the
|
||
two. The <a href="/1985/sicherman/sicherman.alt2.c">second alternate</a>
|
||
version is compiled in case the first does not. Originally the macros
|
||
were kept the same and the <code>C</code> in <code>subr()</code> was
|
||
<code>c</code>. It feels better (in some ways) to make it so that the
|
||
<code>C</code> for the language is upper case though, and since it
|
||
actually translated to <code>/**/</code> it can just be <code>c</code>,
|
||
not <code>C</code>. The <code>V</code> was changed to <code>v</code> to
|
||
be the same case as <code>c</code>.</p></li>
|
||
<li><p>The code:</p>
|
||
<div class="sourceCode" id="cb5"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>C<span class="op">=</span><span class="st">"Lint says "</span>argument Manual isn<span class="ch">'t</span><span class="er"> used." What</span><span class="ch">'</span>s that</span>
|
||
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a>mean<span class="op">?</span><span class="st">"; while (write((read(C_C('"</span><span class="ch">'-'</span><span class="co">/*"'/*"*/</span><span class="op">))?</span>__<span class="op">:</span>__<span class="op">-</span>_<span class="op">+</span></span>
|
||
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a><span class="ch">'</span><span class="sc">\b</span><span class="ch">'</span>b<span class="ch">'</span><span class="sc">\b</span><span class="ch">'</span><span class="op">|((</span>_<span class="op">-</span><span class="dv">52</span><span class="op">)%(</span><span class="ch">'</span><span class="sc">\b</span><span class="ch">'</span>b<span class="ch">'</span><span class="sc">\b</span><span class="ch">'</span><span class="op">+</span>C_C_<span class="op">(</span><span class="ch">'</span><span class="sc">\t</span><span class="ch">'</span>b<span class="ch">'</span><span class="sc">\n</span><span class="ch">'</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="op">,</span><span class="dv">1</span><span class="op">));</span></span></code></pre></div>
|
||
<p>had to be changed to:</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>C<span class="op">=</span><span class="st">"Lint says </span><span class="sc">\"</span><span class="st">argument Manual isn't used.</span><span class="sc">\"</span><span class="st"> What's that</span><span class="op">\</span></span>
|
||
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="st">mean?"</span><span class="op">;</span> <span class="cf">while</span> <span class="op">(</span>write<span class="op">((</span>read<span class="op">((</span><span class="ch">'"'</span><span class="op">-</span><span class="ch">'/</span><span class="er">*"</span><span class="ch">'</span><span class="op">))?</span>__<span class="op">:</span>__<span class="op">-</span>_<span class="op">+</span></span>
|
||
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a><span class="ch">'</span><span class="sc">\b</span><span class="ch">'</span>b<span class="ch">'</span><span class="sc">\b</span><span class="ch">'</span><span class="op">|((</span>_<span class="op">-</span><span class="dv">52</span><span class="op">)%(</span><span class="ch">'</span><span class="sc">\b</span><span class="ch">'</span>b<span class="ch">'</span><span class="sc">\b</span><span class="ch">'</span><span class="op">+</span>C_C_<span class="op">(</span><span class="ch">'</span><span class="sc">\t</span><span class="ch">'</span>b<span class="ch">'</span><span class="sc">\n</span><span class="ch">'</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="op">,</span><span class="dv">1</span><span class="op">));</span></span></code></pre></div>
|
||
<p>because of the missing <code>"</code> at the end of the line and
|
||
because <code>_|_</code> is not a function call.</p>
|
||
<p>The <code>\"</code> had to be done to keep the <code>"</code>s there
|
||
though the string could be broken up into multiple <code>"</code> pairs
|
||
instead; that seemed less authentic, however. Notice how the last line
|
||
of code in that function is the same as before and actually that there
|
||
aren’t that many changes in the function at all!</p>
|
||
<p>Notice also that the parameter <code>C</code> remained the same due
|
||
to the macro <code>C</code> rename to <code>c</code>.</p>
|
||
<p>The <code>char</code>s <code>_</code> and <code>__</code> in
|
||
<code>main()</code> were copied to file scope so that
|
||
<code>subr()</code> could actually compile but this does not affect the
|
||
ones in <code>main()</code>. Why is this? You tell us!</p></li>
|
||
<li><p>The code in <code>main()</code> is where there are significant
|
||
changes, changing from:</p>
|
||
<div class="sourceCode" id="cb7"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="cf">while</span> <span class="op">(</span>read<span class="op">(</span><span class="dv">0</span><span class="op">,&</span>__<span class="op">,</span><span class="dv">1</span><span class="op">)</span> <span class="op">&</span> write<span class="op">((</span>_<span class="op">=(</span>_<span class="op">=</span>C_C_<span class="op">(</span>__<span class="op">),</span>C<span class="op">)),</span></span>
|
||
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a>_C_<span class="op">,</span><span class="dv">1</span><span class="op">))</span> _<span class="op">=</span>C<span class="op">-</span>V<span class="op">+</span>subr<span class="op">(&</span>V<span class="op">);</span></span></code></pre></div>
|
||
<p>to:</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><span class="cf">while</span> <span class="op">(</span>read<span class="op">(</span><span class="dv">0</span><span class="op">,&</span>__<span class="op">,</span><span class="dv">1</span><span class="op">)</span> <span class="op">&</span> write<span class="op">((</span>_<span class="op">=(</span>_<span class="op">=</span>C_C_<span class="op">(</span>__<span class="op">),</span></span>
|
||
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a>V<span class="op">))?</span>__<span class="op">:</span>__<span class="op">-</span>_<span class="op">+</span><span class="ch">'</span><span class="sc">\b</span><span class="ch">'</span>b<span class="ch">'</span><span class="sc">\b</span><span class="ch">'</span><span class="op">|((</span>_<span class="op">-</span><span class="dv">52</span><span class="op">)%(</span><span class="ch">'</span><span class="sc">\b</span><span class="ch">'</span>b<span class="ch">'</span><span class="sc">\b</span><span class="ch">'</span><span class="op">+~</span></span>
|
||
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a><span class="ch">' '</span><span class="op">&</span><span class="ch">'</span><span class="sc">\t</span><span class="ch">'</span>b<span class="ch">'</span><span class="sc">\n</span><span class="ch">'</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="op">,</span><span class="dv">1</span><span class="op">))</span>_<span class="op">=</span>c<span class="op">-</span>v<span class="op">+</span>subr<span class="op">(&</span>v<span class="op">));</span></span></code></pre></div>
|
||
<p>Note how numerous of the macros (though two changed in case) can
|
||
still be used but some cannot be. Can you figure out why? Why too is it
|
||
that the <code>subr()</code> function is called but it appears that some
|
||
of the code in that function is also in <code>main()</code> in the
|
||
<code>while</code> condition? What happens if you remove it from
|
||
<code>main()</code>? What happens if you remove it from
|
||
<code>subr()</code> or don’t even bother calling
|
||
<code>subr()</code>?</p></li>
|
||
</ul>
|
||
<p>Additional code was added in case the fix cannot be compiled by some
|
||
compilers should they object to <code>main()</code> having only one arg.
|
||
This version will automatically be compiled if the entry fails to
|
||
compile for some reason but one can compile it manually as
|
||
<code>make alt</code> in which case it’ll be compiled as
|
||
<code>sicherman.alt</code> (if it’s done because <a
|
||
href="/1985/sicherman/sicherman.c">sicherman.c</a> fails to compile it
|
||
will be built as <code>sicherman</code> as part of the
|
||
<code>sicherman</code> rule).</p>
|
||
<p>Cody also added the <a href="/1985/sicherman/try.sh">try.sh</a> and
|
||
<a href="/1985/sicherman/try.alt.sh">try.alt.sh</a> scripts.</p>
|
||
<h1 id="section-2"><a name="1986"></a>1986</h1>
|
||
<h2 id="applin-readme.md-1"><a name="1986_applin"></a><a
|
||
href="/1986/applin/applin.c">1986/applin</a> (<a
|
||
href="/1986/applin/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> made the C file executable so one does not
|
||
have to do <code>sh ./applin.c</code> or <code>./applin</code>; they can
|
||
do either <code>./applin.c</code> or <code>./applin</code>.</p>
|
||
<h2 id="bright-readme.md"><a name="1986_bright"></a><a
|
||
href="/1986/bright/bright.c">1986/bright</a> (<a
|
||
href="/1986/bright/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="1986/bright/try.sh">try.sh</a> script.</p>
|
||
<h2 id="hague-readme.md"><a name="1986_hague"></a><a
|
||
href="/1986/hague/hague.c">1986/hague</a> (<a
|
||
href="/1986/hague/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> made this use <code>fgets()</code>.</p>
|
||
<p>Cody also added the <a href="1986/hague/try.sh">try.sh</a> script
|
||
which also feeds to the program the added <code>input.txt</code>
|
||
file.</p>
|
||
<h2 id="holloway-readme.md"><a name="1986_holloway"></a><a
|
||
href="/1986/holloway/holloway.c">1986/holloway</a> (<a
|
||
href="/1986/holloway/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to compile and work with clang
|
||
(it already worked with gcc). The problem was that clang is more strict
|
||
about the type of second arg to <code>main()</code>. However simply
|
||
changing it to a <code>char **</code> and updating the <code>*s</code>
|
||
to <code>**s</code> caused a segfault. By adding a new variable,
|
||
<code>char *t</code>, initialising it to <code>s</code> and then using
|
||
<code>t</code> instead of <code>s</code> it compiles and runs
|
||
successfully under clang and gcc.</p>
|
||
<h2 id="marshall-readme.md"><a name="1986_marshall"></a><a
|
||
href="/1986/marshall/marshall.c">1986/marshall</a> (<a
|
||
href="/1986/marshall/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> got this to compile and work with clang and
|
||
gcc. He noted that he tried to keep the ASCII art as close to the
|
||
original as possible. The line lengths are the same but some spaces had
|
||
to be changed to non-spaces.</p>
|
||
<p>This fix was very interesting and quite amusing, showing up problems
|
||
with two different compilers. This is a brief summary but much more is
|
||
explained in the <a href="/1986/marshall/compilers.md">compilers.md</a>
|
||
file, giving which compilers had which problems in which systems: the
|
||
optimiser being enabled in one compiler let it work but broke it in the
|
||
other; and disabling it would let it work in the one that didn’t work
|
||
but suddenly the one that worked wouldn’t work. And by ‘not working’ it
|
||
did not work in more than one way and for different platforms it had
|
||
other problems as well.</p>
|
||
<p>This problem was only after getting clang to compile, of course. It
|
||
did not compile it because it is more strict about the second and third
|
||
args to <code>main()</code> and the third arg was an
|
||
<code>int</code>.</p>
|
||
<p>We encourage you to read the <a
|
||
href="/1986/marshall/compilers.md">compilers.md</a> file to see how odd
|
||
this problem was and what Cody did to fix it, if nothing else but for
|
||
entertainment!</p>
|
||
<h2 id="pawka-readme.md"><a name="1986_pawka"></a><a
|
||
href="/1986/pawka/pawka.c">1986/pawka</a> (<a
|
||
href="/1986/pawka/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> noticed and fixed a funny mistake in the
|
||
Makefile where a <code>-Wno-strict-prototypes</code> was in the wrong
|
||
location, suggesting that there is a <code>-D</code> needed to compile
|
||
the entry.</p>
|
||
<h2 id="stein-readme.md"><a name="1986_stein"></a><a
|
||
href="/1986/stein/stein.c">1986/stein</a> (<a
|
||
href="/1986/stein/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> restored the original entry which was a
|
||
single line. The code being longer (in 1986 a one liner could be longer)
|
||
was split to three lines to avoid problems with news and mail but as it
|
||
was the ‘Best one liner’ it is now one line.</p>
|
||
<p>Cody also added the <a href="/1986/stein/stein.sh">stein.sh</a>
|
||
script which runs the two commands that we suggest in order to get it to
|
||
show clean output.</p>
|
||
<h2 id="wall-readme.md"><a name="1986_wall"></a><a
|
||
href="/1986/wall/wall.c">1986/wall</a> (<a
|
||
href="/1986/wall/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this so that it does not require
|
||
<code>-traditional-cpp</code>. This took a fair bit of tinkering as this
|
||
entry <em>very twisted</em>; fixing <code>-traditional-cpp</code> is, as
|
||
noted earlier, very complicated, but we encourage you to look at <a
|
||
href="/1986/wall/wall.orig.c">original code</a> to see how different C
|
||
was in 1986, as well as below.</p>
|
||
<p><a href="#yusuke">Yusuke</a> originally patched this to use
|
||
<code>strdup()</code> on two strings and this let it work with gcc but
|
||
it still required <code>-traditional-cpp</code>.</p>
|
||
<p>If you’d like to see the difference between the version that requires
|
||
<code>-traditional-cpp</code> and the fixed version, try:</p>
|
||
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="bu">cd</span> 1986/wall <span class="kw">;</span> <span class="fu">make</span> diff_orig_prog</span></code></pre></div>
|
||
<p>Some of the changes required:</p>
|
||
<ul>
|
||
<li><p>Instead of using the <code>c_</code>, defined as
|
||
<code>c_(cc)c cc=</code>, like:</p>
|
||
<pre><code> c_(+)o
|
||
|
||
/* ... */
|
||
|
||
:c_(+)' '-1;
|
||
}}c_(&)'z'+5;</code></pre>
|
||
<p>use:</p>
|
||
<pre><code> :c +=o[c&__LINE__-007];
|
||
|
||
/* ... */
|
||
|
||
:c+=' '-1;
|
||
}}c&='z'+5;</code></pre>
|
||
<p>Observe however that this macro is still used in the code like:</p>
|
||
<pre><code> main(;c_(=(*cc);*cc++)c,for);</code></pre></li>
|
||
<li><p>Instead of code like:</p>
|
||
<pre><code> main(0xb+(c>>5),C_(s))
|
||
_'\v'
|
||
:__ _'\f':
|
||
main(c,C_(s));</code></pre>
|
||
<p>use instead:</p>
|
||
<pre><code> main(;c_(=(*cc);*cc++)c,for);
|
||
#define _O(s)s
|
||
switch(0xb+(c>>5)){
|
||
_'\v'
|
||
:__ _'\f':
|
||
switch(c){;</code></pre></li>
|
||
<li><p>The macro:</p>
|
||
<pre><code> #define C_(sand)_O(sand)witch</code></pre>
|
||
<p>could not be used like:</p>
|
||
<pre><code> C_(s));_</code></pre>
|
||
<p>to create:</p>
|
||
<pre><code> switch);_</code></pre>
|
||
<p>and neither could the macro:</p>
|
||
<pre><code> #define O_(O)_O(O)stem(ccc(</code></pre>
|
||
<p>be used like:</p>
|
||
<pre><code> :O_(sy)";kkt -oa, dijszdijs QQ"))_C</code></pre>
|
||
<p>to create:</p>
|
||
<pre><code> :system(ccc(";kkt -oa, dijszdijs QQ"));return</code></pre></li>
|
||
<li><p>And of course as noted two strings had to be
|
||
<code>strdup()</code>d.</p></li>
|
||
</ul>
|
||
<p>There might have been other changes as well.</p>
|
||
<h1 id="section-3"><a name="1987"></a>1987</h1>
|
||
<h2 id="biggar-readme.md"><a name="1987_biggar"></a><a
|
||
href="/1987/biggar/biggar.c">1987/biggar</a> (<a
|
||
href="/1987/biggar/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="1987/biggar/try.sh">try.sh</a> script.</p>
|
||
<h2 id="heckbert-readme.md"><a name="1987_heckbert"></a><a
|
||
href="/1987/heckbert/heckbert.c">1987/heckbert</a> (<a
|
||
href="/1987/heckbert/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> made this look more like the original entry
|
||
by restoring the <code>#define</code> of <code>define</code>. It’s not
|
||
used but it now looks closer to the original.</p>
|
||
<p>Cody also added the <a href="1987/heckbert/try.sh">try.sh</a> script
|
||
which shows how the program works but also how the folded code can
|
||
recreate the original.</p>
|
||
<p>Also because <code>index(3)</code> is deprecated and in some systems
|
||
requires the inclusion of <code>strings.h</code> and because it’s
|
||
identical in use to <code>strchr(3)</code> (and we noted that for System
|
||
V we had to do this) Cody added to the Makefile
|
||
<code>-Dindex=strchr</code>.</p>
|
||
<h2 id="hines-readme.md"><a name="1987_hines"></a><a
|
||
href="/1987/hines/hines.c">1987/hines</a> (<a
|
||
href="/1987/hines/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="1987/hines/try.sh">try.sh</a> script and the C file <a
|
||
href="1987/hines/goto.c">goto.c</a> and the text file <a
|
||
href="1987/hines/goto.txt">goto.txt</a> for demonstration purposes.
|
||
Notice that the program is case sensitive which running the program on
|
||
the text file demonstrates.</p>
|
||
<h2 id="lievaart-readme.md"><a name="1987_lievaart"></a><a
|
||
href="/1987/lievaart/lievaart.c">1987/lievaart</a> (<a
|
||
href="/1987/lievaart/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added back the documented checks for invalid
|
||
input which no longer worked and instead resulted in either accepting
|
||
the level, whether or not it was a number or out of range (see below on
|
||
range). For the move it entered an infinite loop, prompting the player
|
||
with <code>"You:"</code> but not letting the player input anything so
|
||
that the screen was flooded and the game could not be played.</p>
|
||
<p>For both the level and move it did a <code>scanf()</code> with a
|
||
<code>%d</code> specifier but this resulted in, if invalid input, either
|
||
proceeding (for the level), presumably incorrectly done as it might not
|
||
even be a number (see below) or printing <code>"You:"</code> in an
|
||
infinite loop, expecting input again but not letting the player input
|
||
anything, both as noted above.</p>
|
||
<p>The fix is that now the specifier is a <code>%2s</code> for a
|
||
<code>char A[100]</code> (yes 100 is overkill; there’s no good reason
|
||
for it here: it was just arbitrarily selected).</p>
|
||
<p>For the level if <code>atoi(A)>10||<0</code> (see next part) or
|
||
<code>!isdigit(*A)</code> it goes back and prompts again. The level is
|
||
checked for <code>>=0||<=10</code>, perhaps incorrectly or perhaps
|
||
not, because in the code that variable is checked for
|
||
<code><10</code> and if that is the case it is incremented by 2. I do
|
||
not know the rules of the game and neither do I know what the author had
|
||
in mind so I chosen 10 as the maximum.</p>
|
||
<p>As for the move the <code>do..while</code> loop works properly now
|
||
that it does it in two steps (<code>scanf("%2s", A); m=atoi(A);</code>)
|
||
so there’s no need to check the value explicitly, again. Thus it will
|
||
prompt until valid input is entered, but only showing
|
||
<code>"You:"</code> once per prompting.</p>
|
||
<p>In the case of the level prior to prompting for the level it does a
|
||
<code>*A='\0';</code> and in the case of the move it does it after the
|
||
<code>m=atoi(A);</code>. This is done this way because the check for the
|
||
value of the level (<code>atoi(A)</code>) is done in the
|
||
<code>if()</code> that also checks for a digit (though it does
|
||
<code>(u=atoi(A))>10||u<0</code> first, thus checking the level,
|
||
and <code>|| !isdigit(*A)</code>). Of course since <code>-</code> is not
|
||
a digit the <code><0</code> is superfluous but it’s done anyway. If
|
||
that <code>if</code> is 1 then it immediately goes back to the prompting
|
||
of the level.</p>
|
||
<p>But for the move it can happen after due to the fact the condition of
|
||
the <code>do..while</code> loop will take care of things.</p>
|
||
<p>Cody also made this ever so slightly like the original code by adding
|
||
back the <code>#define D define</code> even though it’s unused. This was
|
||
done for both versions as well (the one with the board and the one
|
||
without, the entry itself with the size constraints of the contest).</p>
|
||
<h2 id="wall-readme.md-1"><a name="1987_wall"></a><a
|
||
href="/1987/wall/wall.c">1987/wall</a> (<a
|
||
href="/1987/wall/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> made this use <code>fgets(3)</code>.</p>
|
||
<p>Cody also added the <a href="1987/wall/try.sh">try.sh</a> script.</p>
|
||
<h2 id="westley-readme.md"><a name="1987_westley"></a><a
|
||
href="/1987/westley/westley.c">1987/westley</a> (<a
|
||
href="/1987/westley/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this for modern systems. The problem
|
||
was
|
||
<code>'assignment to cast is illegal, lvalue casts are not supported'</code>.
|
||
For the original file see the README.md file. Unfortunately this ruins
|
||
some symmetry. To try and resolve this as much as possible at first code
|
||
was commented out but later on the commented out code was removed and
|
||
another part changed so that, although it has some code no longer there,
|
||
it has a closer match in symmetry and since the code was commented out
|
||
it’s probably not a big deal to have it removed instead as it does look
|
||
more symmetrical now.</p>
|
||
<p>Cody also added to the Makefile <code>-include stdio.h</code> in the
|
||
nowadays very unlikely(?) but nevertheless suggested case that
|
||
<code>putchar()</code> is not available.</p>
|
||
<h1 id="section-4"><a name="1988"></a>1988</h1>
|
||
<h2 id="dale-readme.md"><a name="1988_dale"></a><a
|
||
href="/1988/dale/dale.c">1988/dale</a> (<a
|
||
href="/1988/dale/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this twisted entry (as we called it
|
||
:-) ) for modern compilers, including making it no longer require
|
||
<code>-traditional-cpp</code>. Fixing <code>-traditional-cpp</code> is,
|
||
as noted later on, very complicated, but we encourage you to compare the
|
||
fix from the original entry. There was another problem to resolve as
|
||
well, however.</p>
|
||
<p>First of all, as noted above, the entry required
|
||
<code>-traditional-cpp</code> (which <strike>not all compilers
|
||
support</strike> <code>clang</code> does not support). It needed that
|
||
option in modern systems because of two things it did:</p>
|
||
<div class="sourceCode" id="cb21"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#define a</span><span class="op">(</span><span class="pp">x</span><span class="op">)</span><span class="pp">get</span><span class="co">/***/</span><span class="pp">x</span><span class="co">/***/</span><span class="pp">id</span><span class="op">())</span></span>
|
||
<span id="cb21-2"><a href="#cb21-2" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb21-3"><a href="#cb21-3" aria-hidden="true" tabindex="-1"></a><span class="co">/* ... */</span></span>
|
||
<span id="cb21-4"><a href="#cb21-4" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb21-5"><a href="#cb21-5" aria-hidden="true" tabindex="-1"></a>p Z<span class="op">=</span>chroot<span class="op">(</span><span class="st">"/"</span><span class="op">);</span>L<span class="op">(!</span>a<span class="op">(</span>u<span class="op">)</span>execv<span class="op">((</span>q<span class="op">(</span>v<span class="op">=</span><span class="st">"/ipu6ljov"</span><span class="op">),</span>v<span class="op">),</span>C<span class="op">);</span>Z<span class="op">-=</span>kill<span class="op">(</span>l<span class="op">);</span></span>
|
||
<span id="cb21-6"><a href="#cb21-6" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb21-7"><a href="#cb21-7" aria-hidden="true" tabindex="-1"></a><span class="co">/* ... */</span></span>
|
||
<span id="cb21-8"><a href="#cb21-8" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb21-9"><a href="#cb21-9" aria-hidden="true" tabindex="-1"></a>case_2<span class="op">:</span>L<span class="op">(!--</span>V<span class="op">){</span>O<span class="co">/*/*/</span>c<span class="op">*</span>c<span class="op">+</span>c<span class="op">);</span>wait<span class="op">(</span>A<span class="op">+</span>c<span class="op">*</span>c<span class="op">-</span>c<span class="op">);</span>L<span class="op">(!</span>Z<span class="op">)</span>f<span class="op">(</span>A<span class="op">,</span><span class="st">"</span><span class="sc">\n</span><span class="st">"</span><span class="op">,</span>c<span class="op">);</span><span class="cf">return</span><span class="op">(</span>A<span class="op">*</span>getgid<span class="op">());};</span>C<span class="op">++;</span></span></code></pre></div>
|
||
<p>This macro, <code>a</code>, formed the functions (the names)
|
||
<code>getuid()</code> and <code>getgid()</code>, but this no longer
|
||
works. The code still uses the macro <code>a</code> to form the names
|
||
but it’s done differently, using the C token paste operator
|
||
<code>##</code>. It’s done like thus:</p>
|
||
<div class="sourceCode" id="cb22"><pre
|
||
class="sourceCode diff"><code class="sourceCode diff"><span id="cb22-1"><a href="#cb22-1" aria-hidden="true" tabindex="-1"></a><span class="kw">--- i/1988/dale/dale.c</span></span>
|
||
<span id="cb22-2"><a href="#cb22-2" aria-hidden="true" tabindex="-1"></a><span class="dt">+++ w/1988/dale/dale.c</span></span>
|
||
<span id="cb22-3"><a href="#cb22-3" aria-hidden="true" tabindex="-1"></a><span class="dt">@@ -9,18 +9,18 @@</span></span>
|
||
<span id="cb22-4"><a href="#cb22-4" aria-hidden="true" tabindex="-1"></a> #define L if</span>
|
||
<span id="cb22-5"><a href="#cb22-5" aria-hidden="true" tabindex="-1"></a> #define I goto</span>
|
||
<span id="cb22-6"><a href="#cb22-6" aria-hidden="true" tabindex="-1"></a> #define l 1</span>
|
||
<span id="cb22-7"><a href="#cb22-7" aria-hidden="true" tabindex="-1"></a> #define f write</span>
|
||
<span id="cb22-8"><a href="#cb22-8" aria-hidden="true" tabindex="-1"></a> #define J else</span>
|
||
<span id="cb22-9"><a href="#cb22-9" aria-hidden="true" tabindex="-1"></a><span class="st">-#define a(x)get/***/x/***/id())</span></span>
|
||
<span id="cb22-10"><a href="#cb22-10" aria-hidden="true" tabindex="-1"></a><span class="va">+#define a(x)get##x##id())</span></span></code></pre></div>
|
||
<p>The second is that</p>
|
||
<div class="sourceCode" id="cb23"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb23-1"><a href="#cb23-1" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span><span class="co">/*/(;;);/*/</span>k<span class="op">()){</span>O<span class="co">/*/*/</span>c<span class="op">);</span></span></code></pre></div>
|
||
<p>cannot form <code>fork())</code> in modern C compilers. Since it was
|
||
not done through a macro it was simply changed to be
|
||
<code>fork()</code>, rather than adding a new macro.</p>
|
||
<p>The other problem that could not be resolved by the
|
||
<code>-traditional-cpp</code> was that modern compilers do not allow
|
||
directives like:</p>
|
||
<div class="sourceCode" id="cb24"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb24-1"><a href="#cb24-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#define _ define</span></span>
|
||
<span id="cb24-2"><a href="#cb24-2" aria-hidden="true" tabindex="-1"></a><span class="pp">#</span><span class="er">_ P char</span></span>
|
||
<span id="cb24-3"><a href="#cb24-3" aria-hidden="true" tabindex="-1"></a><span class="pp">#</span><span class="er">_ p int</span></span>
|
||
<span id="cb24-4"><a href="#cb24-4" aria-hidden="true" tabindex="-1"></a><span class="pp">#</span><span class="er">_ O close(</span></span>
|
||
<span id="cb24-5"><a href="#cb24-5" aria-hidden="true" tabindex="-1"></a><span class="co">/* ... */</span></span></code></pre></div>
|
||
<p>so Cody changed the lines to be in the form of:</p>
|
||
<div class="sourceCode" id="cb25"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb25-1"><a href="#cb25-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#define P </span><span class="dt">char</span></span>
|
||
<span id="cb25-2"><a href="#cb25-2" aria-hidden="true" tabindex="-1"></a><span class="pp">#define p </span><span class="dt">int</span></span>
|
||
<span id="cb25-3"><a href="#cb25-3" aria-hidden="true" tabindex="-1"></a><span class="pp">#define O close</span><span class="op">(</span></span>
|
||
<span id="cb25-4"><a href="#cb25-4" aria-hidden="true" tabindex="-1"></a><span class="co">/* ... */</span></span></code></pre></div>
|
||
<p>However, to keep the entry as close to as possible in look, Cody kept
|
||
the <code>_</code> macro in place it’s just no longer used.</p>
|
||
<p>See the README.md file for details on the original code, provided as
|
||
an alt version in case you have an older compiler or wish to try
|
||
<code>-traditional-cpp</code>.</p>
|
||
<p>Cody also provided the <a href="/1988/dale/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="isaak-readme.md"><a name="1988_isaak"></a><a
|
||
href="/1988/isaak/isaak.c">1988/isaak</a> (<a
|
||
href="/1988/isaak/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to work for modern systems. The
|
||
problem was that the important function, a redefinition of
|
||
<code>exit()</code>, was not being called in <code>main()</code>. The
|
||
original version is in <a
|
||
href="/1988/isaak/isaak.alt.c">1988/isaak/isaak.alt.c</a>. See the
|
||
README.md file for more details.</p>
|
||
<h2 id="litmaath-readme.md"><a name="1988_litmaath"></a><a
|
||
href="/1988/litmaath/litmaath.c">1988/litmaath</a> (<a
|
||
href="/1988/litmaath/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the alt code which is code that we
|
||
suggested at the time of publication, in the remarks, to help understand
|
||
the entry, and for fun.</p>
|
||
<h2 id="phillipps-readme.md"><a name="1988_phillipps"></a><a
|
||
href="/1988/phillipps/phillipps.c">1988/phillipps</a> (<a
|
||
href="/1988/phillipps/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this for modern systems. It did not
|
||
compile with clang because it requires the second and third args of
|
||
<code>main()</code> to be <code>char **</code> but even before that with
|
||
gcc it printed garbage and then crashed.</p>
|
||
<p>After fixing it for clang by changing the very <code>main()</code>
|
||
(in fact it called itself up to 12 times!) to call the new function
|
||
<code>pain()</code> (chosen because it’s a pain that clang requires
|
||
these args to be <code>char **</code> :-), which is just as recursive,
|
||
with the correct args it now works with both gcc and clang.</p>
|
||
<p>Later Cody improved the fix to make it look a bit more like the
|
||
original, using K&R style functions, and trying to match the format
|
||
as best as possible of what <code>main()</code> used to look like but
|
||
without the full body that cannot exist as it once did. The format of
|
||
<code>pain()</code> is exactly like how <code>main()</code> was as it’s
|
||
the same code. Additionally, <code>main()</code> returns
|
||
<code>!pain(...)</code> like <code>main()</code> used to do to itself
|
||
and <code>pain()</code> does now.</p>
|
||
<h2 id="reddy-readme.md"><a name="1988_reddy"></a><a
|
||
href="/1988/reddy/reddy.c">1988/reddy</a> (<a
|
||
href="/1988/reddy/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> made this use <code>fgets(3)</code>.</p>
|
||
<h2 id="spinellis-readme.md"><a name="1988_spinellis"></a><a
|
||
href="/1988/spinellis/spinellis.c">1988/spinellis</a> (<a
|
||
href="/1988/spinellis/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> provided an <a
|
||
href="/1988/spinellis/spinellis.alt.c">alternate version</a> so that
|
||
this will work with compilers like clang. An alternate version had to be
|
||
provided because not doing so would be tampering with the entry too
|
||
much. It would work but it would not show the same creativity and
|
||
cleverness.</p>
|
||
<p>The original entry exploits a fun mis-feature that works with gcc but
|
||
not clang. This resulted in a change of rules which is another reason to
|
||
not modify the original. See the README.md file for details on the
|
||
alternate code.</p>
|
||
<p>Meanwhile Cody was twisted enough to point out (though to be fair he
|
||
felt sick doing this) that with a slight modification this entry can be
|
||
C++ instead. We don’t thank him for this ghastly point! :-)</p>
|
||
<h2 id="westley-readme.md-1"><a name="1988_westley"></a><a
|
||
href="/1988/westley/westley.c">1988/westley</a> (<a
|
||
href="/1988/westley/README.md%5D">README.md</a>)</h2>
|
||
<p>The <a href="/1988/westley/westley.alt.c">original version</a>,
|
||
provided as alternate code, was fixed by Misha Dynin, based on the
|
||
judges’ remarks, so that this would work with modern C compilers. We
|
||
encourage you to try the alternate version to see what happens with
|
||
current compilers! See the README.md files for details.</p>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/1988/westley/try.sh">try.sh</a> script to show the magic of the
|
||
entry as seeing the code with the result at once is far more
|
||
beautiful.</p>
|
||
<p>Cody also changed the <code>int</code>s to be <code>float</code> as
|
||
that’s what they are printed as: not strictly necessary but nonetheless
|
||
more correct, even if not warned against.</p>
|
||
<h1 id="section-5"><a name="1989"></a>1989</h1>
|
||
<h2 id="fubar-readme.md"><a name="1989_fubar"></a><a
|
||
href="/1989/fubar/fubar.c">1989/fubar</a> (<a
|
||
href="/1989/fubar/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> got this to work with modern systems. The
|
||
main issues were that an <code>#include</code> had to be added along
|
||
with fixing the path (due to <code>.</code> not being in
|
||
<code>$PATH</code>) to files referred to in the code. The path problem
|
||
was also fixed in <a href="/1989/fubar/fubar.sh">fubar.sh</a>.</p>
|
||
<p>A strange problem occurred where if one made modifications to the C
|
||
file it might end up failing to work even after changing it back. This
|
||
was resolved by:</p>
|
||
<div class="sourceCode" id="cb26"><pre
|
||
class="sourceCode diff"><code class="sourceCode diff"><span id="cb26-1"><a href="#cb26-1" aria-hidden="true" tabindex="-1"></a><span class="kw">--- i/1989/fubar/fubar.sh</span></span>
|
||
<span id="cb26-2"><a href="#cb26-2" aria-hidden="true" tabindex="-1"></a><span class="dt">+++ w/1989/fubar/fubar.sh</span></span>
|
||
<span id="cb26-3"><a href="#cb26-3" aria-hidden="true" tabindex="-1"></a><span class="dt">@@ -7,13 +7,12 @@ if [[ $# -ne 1 ]]; then</span></span>
|
||
<span id="cb26-4"><a href="#cb26-4" aria-hidden="true" tabindex="-1"></a> exit 1</span>
|
||
<span id="cb26-5"><a href="#cb26-5" aria-hidden="true" tabindex="-1"></a> fi</span>
|
||
<span id="cb26-6"><a href="#cb26-6" aria-hidden="true" tabindex="-1"></a> </span>
|
||
<span id="cb26-7"><a href="#cb26-7" aria-hidden="true" tabindex="-1"></a> # run/compile it</span>
|
||
<span id="cb26-8"><a href="#cb26-8" aria-hidden="true" tabindex="-1"></a> rm -f ouroboros.c x1 x</span>
|
||
<span id="cb26-9"><a href="#cb26-9" aria-hidden="true" tabindex="-1"></a><span class="st">-ex - <<EOF</span></span>
|
||
<span id="cb26-10"><a href="#cb26-10" aria-hidden="true" tabindex="-1"></a><span class="st">-r fubar.c</span></span>
|
||
<span id="cb26-11"><a href="#cb26-11" aria-hidden="true" tabindex="-1"></a><span class="va">+ex fubar.c <<EOF</span></span>
|
||
<span id="cb26-12"><a href="#cb26-12" aria-hidden="true" tabindex="-1"></a> 8,9j</span>
|
||
<span id="cb26-13"><a href="#cb26-13" aria-hidden="true" tabindex="-1"></a> w ouroboros.c</span>
|
||
<span id="cb26-14"><a href="#cb26-14" aria-hidden="true" tabindex="-1"></a> EOF</span>
|
||
<span id="cb26-15"><a href="#cb26-15" aria-hidden="true" tabindex="-1"></a> chmod +x ouroboros.c</span></code></pre></div>
|
||
<p>Cody also ‘modernised’ the script to use <code>bash</code> and fixed
|
||
for ShellCheck. The <code>if [ .. ]</code> was changed in the C code as
|
||
well as the script.</p>
|
||
<p>Cody also added the <a href="/1989/fubar/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="jar.1-readme.md"><a name="1989_jar.1"></a><a
|
||
href="/1989/jar.1/jar.1.c">1989/jar.1</a> (<a
|
||
href="/1989/jar.1/README.md%5D">README.md</a>)</h2>
|
||
<p>To prevent annoying output to <code>/dev/tty</code> we changed the
|
||
code to simulate the output via <code>strings(1)</code> but <a
|
||
href="#cody">Cody</a> removed the ill-famed
|
||
<code>useless use of cat</code> to shut <a
|
||
href="https://github.com/koalaman/shellcheck">ShellCheck</a> up. Why is
|
||
it ill-famed? Because there is no such thing as a useless cat, that’s
|
||
why! For instance, the fact they even exist is proof that the Earth is
|
||
<strong>NOT</strong> flat: because if it was they would have pushed
|
||
everything off it by now! :-) They’re also a great joy to all
|
||
ailurophiles and yes they most certainly do have a personality and they
|
||
can be very sociable.</p>
|
||
<p>Whilst he was at it, Cody made it so that one need not run the alt
|
||
script or alt code directly, to match that of the main entry. As we
|
||
simulate the functionality anyway, and since one may still run the code
|
||
or the script (for the original entry and the alt code) anyway, it works
|
||
out well.</p>
|
||
<h2 id="jar.2-readme.md"><a name="1989_jar.2"></a><a
|
||
href="/1989/jar.2/jar.2.c">1989/jar.2</a> (<a
|
||
href="/1989/jar.2/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to work with modern compilers.
|
||
Modern compilers do not allow code like:</p>
|
||
<div class="sourceCode" id="cb27"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb27-1"><a href="#cb27-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#define D define</span></span>
|
||
<span id="cb27-2"><a href="#cb27-2" aria-hidden="true" tabindex="-1"></a><span class="pp">#define a include</span></span>
|
||
<span id="cb27-3"><a href="#cb27-3" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb27-4"><a href="#cb27-4" aria-hidden="true" tabindex="-1"></a><span class="pp">#</span><span class="er">D foo bar</span></span>
|
||
<span id="cb27-5"><a href="#cb27-5" aria-hidden="true" tabindex="-1"></a><span class="pp">#</span><span class="er">a <stdio.h></span></span></code></pre></div>
|
||
<p>He notes that there <em>is</em> a way to get it (or something close
|
||
to it) to work. Do you know how?</p>
|
||
<p>Cody also provided the <a href="/1989/jar.2/try.sh">try.sh</a> script
|
||
and the supplementary files <a href="/1989/jar.2/try.txt">try.txt</a>,
|
||
<a href="/1989/jar.2/fib.lisp">fib.lisp</a> and <a
|
||
href="/1989/jar.2/chocolate_cake.lisp">chocolate_cake.lisp</a>. The
|
||
<code>try.txt</code> comes from the author and the <code>fib.lisp</code>
|
||
comes from <a href="#yusuke">Yusuke</a>. Cody wrote the script and
|
||
offered us some chocolate cake :-) See README.md for details on how to
|
||
use the script.</p>
|
||
<h2 id="ovdluhe-readme.md"><a name="1989_ovdluhe"></a><a
|
||
href="/1989/ovdluhe/ovdluhe.c">1989/ovdluhe</a> (<a
|
||
href="/1989/ovdluhe/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed an infinite loop where the program
|
||
would print the same thing over and over again, flooding the screen. The
|
||
problem is that there was a <code>for</code> loop that by necessity had
|
||
to not have an increment stage but the pointer only got updated in the
|
||
<code>if</code> path (in the loop itself).</p>
|
||
<p>Cody also provided the <a href="/1989/ovdluhe/try.sh">try.sh</a>
|
||
script which runs the program four times on three files to show the
|
||
different output. It doesn’t run the program on each file four times in
|
||
a row but rather does it on each file and starts over, doing it four
|
||
times, to help with hopefully allowing different output.</p>
|
||
<p>Cody also provided an <a href="/1989/ovdluhe/ovdluhe.alt.c">alternate
|
||
version</a> based on the author’s remarks and the <a
|
||
href="/1989/ovdluhe/try.alt.sh">try.alt.sh</a> script that uses the alt
|
||
code, allowing one to configure the alt build. See the README.md for
|
||
details. The fix described above was fixed in this version too, after it
|
||
was discovered and fixed.</p>
|
||
<h2 id="paul-readme.md"><a name="1989_paul"></a><a
|
||
href="/1989/paul/paul.c">1989/paul</a> (<a
|
||
href="/1989/paul/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed a segfault under macOS that prevented
|
||
it from working. The problem was that the int (from
|
||
<code>#define f</code>) should be a long. This became apparent when he
|
||
was using lldb and saw that the type of a pointer was too
|
||
<code>long</code> :-)</p>
|
||
<p>Cody also provided the <a href="/1989/paul/paul.alt.c">alternate
|
||
version</a> which has the trace function that the author included but
|
||
commented out. See the README.md for details.</p>
|
||
<h2 id="robison-readme.md"><a name="1989_robison"></a><a
|
||
href="/1989/robison/robison.c">1989/robison</a> (<a
|
||
href="/1989/robison/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#yusuke">Yusuke Endoh</a> fixed this to compile under modern
|
||
systems. To see the changes made, try:</p>
|
||
<div class="sourceCode" id="cb28"><pre
|
||
class="sourceCode sh"><code class="sourceCode bash"><span id="cb28-1"><a href="#cb28-1" aria-hidden="true" tabindex="-1"></a><span class="bu">cd</span> 1989/robison <span class="kw">;</span> <span class="fu">make</span> diff_orig_prog</span></code></pre></div>
|
||
<p>(It adds the C token pasting operator <code>##</code> instead of
|
||
<code>/**/</code>.)</p>
|
||
<p>Cody also added the <a href="/1989/robison/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="tromp-readme.md"><a name="1989_tromp"></a><a
|
||
href="/1989/tromp/tromp.c">1989/tromp</a> (<a
|
||
href="/1989/tromp/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> and <a href="#yusuke">Yusuke</a> fixed this
|
||
entry: Yusuke fixed this to compile with gcc and Cody fixed it for clang
|
||
and made some other fixes as well.</p>
|
||
<p>To get it to work with clang the variable <code>a</code> had to not
|
||
be the third argument to <code>main()</code> but instead be a variable
|
||
in <code>main()</code>.</p>
|
||
<p>Cody also fixed a segfault and made it so the that the high score
|
||
file would work (it was not even being created but it was supposed to
|
||
be). This was happening due to a file pointer being declared as a
|
||
<code>long</code> and more significantly is the command in
|
||
<code>popen(3)</code> was not correct.</p>
|
||
<p>Another problem Cody fixed was that the terminal was left in an
|
||
insane state where you could not type ‘<code>u</code>’ and echo was
|
||
completely disabled.</p>
|
||
<p>Cody later on fixed the alt version, provided by the author, so that
|
||
it would compile with clang, not abort (with an alarm), would have the
|
||
tetriminos fall, it would write to the high score file (the command to
|
||
<code>popen(3)</code> was incorrect here too but as can be seen it
|
||
differs from the submitted version), could use <code>stty</code>
|
||
properly (and thus turn on echo again - it did not work because it was
|
||
in the <code>popen(3)</code> call rather than using
|
||
<code>system(3)</code>), a couple compiler errors and various other
|
||
things, so that now the alt version, which is better, can be used.</p>
|
||
<p>Although we appreciate the help here, he cynically noted that he had
|
||
to have an IOCCC <a
|
||
href="https://en.wikipedia.org/wiki/Tetris">Tetris</a> working (this of
|
||
course was not his only reason :-) )</p>
|
||
<h2 id="vanb-readme.md"><a name="1989_vanb"></a><a
|
||
href="/1989/vanb/vanb.c">1989/vanb</a> (<a
|
||
href="/1989/vanb/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/1989/vanb/try.sh">try.sh</a> script.</p>
|
||
<h2 id="westley-readme.md-2"><a name="1989_westley"></a><a
|
||
href="/1989/westley/westley.c">1989/westley</a> (<a
|
||
href="/1989/westley/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this for clang, except that two
|
||
versions generated by the program cannot be compiled by clang due to
|
||
inherent defects in the compiler and how the entry works. This is an
|
||
<strong>incredibly hard</strong> one to fix for clang whilst still being
|
||
compilable with gcc (and gcc can compile every generated version with
|
||
the fix) and even if one fixes it to compile with clang it does not mean
|
||
that any other version will compile! It is, however, possible to get
|
||
clang to work with two versions generated, <code>ver0</code> and
|
||
<code>ver1</code>, though <code>ver0</code> is actually just the main
|
||
entry (but still generated by the program itself).</p>
|
||
<p>Unfortunately due to the way this entry works if it is even possible
|
||
to get all versions to compile with clang it will take heavy
|
||
modifications to get all versions to compile with clang. Cody almost got
|
||
it and knows how it functions but even getting it just about there
|
||
caused compilation errors in gcc so it might just not be possible.</p>
|
||
<p>The way it was fixed might be hard to see and describe but this is an
|
||
attempt. Because <code>main()</code>’s args were all <code>int</code>s,
|
||
<code>main()</code> had to call a new function which is allowed to have
|
||
args as <code>int</code> (instead of <code>main()</code>’s args being
|
||
int and the rest being <code>char **</code>) but this is not as straight
|
||
forward as it is for other entries (if you look at the code you might
|
||
see what is meant; the function called is <code>pain()</code>).</p>
|
||
<p>The args of <code>main()</code> had to be set to the right type but
|
||
only three args, <strong>not four</strong>, even though the original
|
||
program has four args. This is because not all versions of clang support
|
||
four args and that is one of the issues with version 2 and 3 as it
|
||
generates <code>main()</code> to have four args and the wrong type, all
|
||
<code>int</code>s.</p>
|
||
<p>In the call to the new function, <code>pain()</code>, from
|
||
<code>main()</code>, one of the <code>char **</code>s is used twice,
|
||
once as <code>argc</code> with bitwise AND with 2, naturally first being
|
||
cast to an <code>int</code> (<code>(int)ABBA&2</code>), and once as
|
||
a <code>char **</code>, the fourth arg to <code>pain()</code> (yes even
|
||
though <code>pain()</code> takes all <code>int</code>s).</p>
|
||
<p>The argc,, meanwhile, <code>tang</code>, is used once and the second
|
||
arg, <code>char **gnat</code> is used once (observe how
|
||
<code>tang</code> is <code>gnat</code> spelt backwards as this is one of
|
||
the things that makes this a masterpiece and very hard if not impossible
|
||
to fix completely). Fortunately it is not actually necessary to use all
|
||
four args (of <code>main()</code>) in the call which might or might not
|
||
be surprising, especially as it uses one of the args, a
|
||
<code>char **</code>, instead of an <code>int</code> (through casts),
|
||
twice rather than just passing in for the fourth arg (the fourth arg
|
||
passed in is the third arg to <code>main()</code>).</p>
|
||
<p>This program heavily uses recursion and depending on the number of
|
||
args it will print out output normally, ROT13 it, show it backwards or
|
||
both. Along with the ROT13 and reversed output of the code, it is the
|
||
<strong>comments that create the names and the rest of the
|
||
code!</strong>: sometimes it is the word backwards, other times it is
|
||
the ROT13 of it and other times it is both, both for comments and
|
||
otherwise. Trying to change comments can be very difficult though it was
|
||
done when clang could almost compile every version if not actually
|
||
compile all versions. Unfortunately when this was done it caused other
|
||
systems to have additional compilation errors so it seems highly
|
||
unlikely that version 2 and 3 can work for clang (versions 0 and 1
|
||
can).</p>
|
||
<p>Despite the risks of changing names this was done and indeed by
|
||
necessity. Comments might have been changed but it is no longer known if
|
||
that happened only in the working on version 2 and 3 or if in the fix
|
||
for clang as well as version 0 and 1.</p>
|
||
<p>To make use of this several scripts were added by Cody.</p>
|
||
<p>The <a href="/1989/westley/compile.sh">compile.sh</a> script that
|
||
removes the generated code, rebuilds the program and regenerates the
|
||
other code and then compiles it will work for compilers like gcc and one
|
||
can then use the <a href="/1989/westley/try.sh">try.sh</a> script to see
|
||
example input and output.</p>
|
||
<p>The <code>compile.sh</code> script allows one to specify the compiler
|
||
with the <code>CC</code> environmental variable; see the README.md for
|
||
details.</p>
|
||
<h1 id="section-6"><a name="1990"></a>1990</h1>
|
||
<h2 id="baruch-readme.md"><a name="1990_baruch"></a><a
|
||
href="/1990/baruch/baruch.c">1990/baruch</a> (<a
|
||
href="/1990/baruch/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/1990/baruch/try.sh">try.sh</a> script.</p>
|
||
<p>Cody also added an <a href="/1990/baruch/baruch.alt.c">alternate
|
||
version</a> which allows Turbo-C and MSC to compile this code, based on
|
||
the authors’ remarks, except that Cody did not change the
|
||
<code>" #Q"</code> string as that showed worse looking output instead of
|
||
improved output though he has no way to test the compilers in question
|
||
(i.e. it was only tested in the original entry). YMMV.</p>
|
||
<p>Although this is appreciated we agree with him that <strike>no
|
||
one</strike> <a href="https://en.wikipedia.org/wiki/0">very few</a> <a
|
||
href="https://en.wikipedia.org/wiki/Microsoft_Windows">users</a> <a
|
||
href="https://www.ioccc.org">here</a> will need it! :-)</p>
|
||
<p>Cody also made the code look more like the original, removing the
|
||
<code>int</code> from the variables, adding instead
|
||
<code>-Wno-implicit-int</code>. The newline added by the judges was
|
||
retained.</p>
|
||
<h2 id="cmills-readme.md"><a name="1990_cmills"></a><a
|
||
href="/1990/cmills/cmills.c">1990/cmills</a> (<a
|
||
href="/1990/cmills/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#yusuke">Yusuke</a> got this to work in modern systems (it
|
||
previously resulted in a bus error).</p>
|
||
<p><a href="#cody">Cody</a> made this use <code>fgets(3)</code>.</p>
|
||
<h2 id="dds-readme.md"><a name="1990_dds"></a><a
|
||
href="/1990/dds/dds.c">1990/dds</a> (<a
|
||
href="/1990/dds/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#yusuke">Yusuke</a> and <a href="#cody">Cody</a> in
|
||
conjunction fixed this for modern systems (both fixed a different
|
||
compiler error but more fixes were also made).</p>
|
||
<p>Yusuke added the comma operator for a binary expression with
|
||
<code>free(3)</code> which is is a compiler error because
|
||
<code>free()</code> returns void. Cody then made it slightly more like
|
||
the original in this way by redefining <code>free</code> to have the
|
||
comma operator itself.</p>
|
||
<p>Cody fixed another compiler error by removing the erroneous prototype
|
||
to <code>fopen()</code>. Cody also changed a <code>char *</code> used
|
||
for file I/O to be a proper <code>FILE *</code> and fixed a typo in <a
|
||
href="/1990/dds/LANDER.BAS">LANDER.BAS</a>.</p>
|
||
<p>Cody also made this use <code>fgets(3)</code>.</p>
|
||
<h2 id="dg-readme.md"><a name="1990_dg"></a><a
|
||
href="/1990/dg/dg.c">1990/dg</a> (<a
|
||
href="/1990/dg/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this for modern systems. There were
|
||
two problems to be resolved.</p>
|
||
<p>One can no longer do:</p>
|
||
<div class="sourceCode" id="cb29"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb29-1"><a href="#cb29-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#define d define</span></span>
|
||
<span id="cb29-2"><a href="#cb29-2" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb29-3"><a href="#cb29-3" aria-hidden="true" tabindex="-1"></a><span class="pp">#</span><span class="er">d b12(x) 12 x</span></span>
|
||
<span id="cb29-4"><a href="#cb29-4" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb29-5"><a href="#cb29-5" aria-hidden="true" tabindex="-1"></a><span class="co">/* etc. */</span></span></code></pre></div>
|
||
<p>so the use of <code>#d</code> is now instead <code>#define</code>
|
||
(the macro was originally deleted but later Cody added it back to make
|
||
it more like the original).</p>
|
||
<p>The second problem was suggested by the judges at the time of
|
||
judging, to do with if the C preprocessor botches single quotes in cpp
|
||
expansion.</p>
|
||
<p>Cody also added the <a href="/1990/dg/try.sh">try.sh</a> script.</p>
|
||
<h2 id="jaw-readme.md"><a name="1990_jaw"></a><a
|
||
href="/1990/jaw/jaw.c">1990/jaw</a> (<a
|
||
href="/1990/jaw/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the script to work properly in modern
|
||
environments including writing to and extracting from
|
||
<code>stdout</code> and relying on the exit code in the commands to
|
||
allow for <code>&& ...</code>.</p>
|
||
<p>He also changed the <code>perror(3)</code> call to
|
||
<code>fprintf(3)</code> because in macOS when errno is 0 it shows what
|
||
looks like an error.</p>
|
||
<p>He added the <a href="/1990/jaw/try.sh">try.sh</a> to run the
|
||
commands that we suggested at the time.</p>
|
||
<p>NOTE: as <code>btoa</code> is not common we used a ruby script from
|
||
<a href="#yusuke">Yusuke</a> but with a minor fix applied by Cody that
|
||
made the program just show <code>oops</code> twice from invalid input
|
||
but which now works.</p>
|
||
<h2 id="pjr-readme.md"><a name="1990_pjr"></a><a
|
||
href="/1990/pjr/pjr.c">1990/pjr</a> (<a
|
||
href="/1990/pjr/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a href="/1990/pjr/pjr.alt.c">alt
|
||
code</a> which was suggested by the judges in the case that your
|
||
compiler cannot compile <code>X=g()...</code> but it actually does
|
||
something else and is recommended by the author as well.</p>
|
||
<h2 id="scjones-readme.md"><a name="1990_scjones"></a><a
|
||
href="/1990/scjones/scjones.c">1990/scjones</a> (<a
|
||
href="/1990/scjones/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#yusuke">Yusuke</a> suggested <code>-ansi</code> to get the
|
||
entry to compile due to trigraphs and <a href="#cody">Cody</a> suggested
|
||
<code>-trigraphs</code>. Both work but we used Yusuke’s idea.</p>
|
||
<p>Cody added the <a href="/1990/scjones/try.sh">try.sh</a> script to
|
||
show exactly what the entry does.</p>
|
||
<h2 id="tbr-readme.md"><a name="1990_tbr"></a><a
|
||
href="/1990/tbr/tbr.c">1990/tbr</a> (<a
|
||
href="/1990/tbr/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to work with modern compilers;
|
||
<code>exit(3)</code> returns void but the function was used in a binary
|
||
expression so this wouldn’t even compile.</p>
|
||
<p>Cody also changed the code to use <code>fgets()</code> instead of
|
||
<code>gets()</code> so one would not get a warning about the use of
|
||
<code>gets(3)</code> at linking time or execution, the latter of which
|
||
was causing confusing output due to the warning being interspersed with
|
||
the program’s interactive output.</p>
|
||
<p>Additionally, Cody fixed the shortened version provided by the author
|
||
in the same way as the original entry, first the compile fix and then
|
||
later on making it look more like the original by redefining
|
||
<code>exit</code> and also redefining <code>gets()</code> to be
|
||
<code>fgets()</code> in the same way that the original entry is. This
|
||
way the <a href="/1990/tbr/README.md#alternate-code">alt version</a> is
|
||
equivalent in function, like the author intended, but more compact.</p>
|
||
<h2 id="theorem-readme.md"><a name="1990_theorem"></a><a
|
||
href="/1990/theorem/theorem.c">1990/theorem</a> (<a
|
||
href="/1990/theorem/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to compile with modern
|
||
systems.</p>
|
||
<p>He also fixed some bugs that impacted the usability of this program
|
||
including some segfaults under modern systems (and possibly in some
|
||
cases earlier systems) with this entry. Originally we noted that the 4
|
||
trailing args ‘0 0 0 0’ were required on systems that dump core when
|
||
NULL is dereferenced but this problem showed itself in modern systems
|
||
even with the 4 ‘0 0 0 0’. He also fixed a segfault if not enough args
|
||
are specified and fixed the code so that the generated
|
||
<code>fibonacci.c</code> actually works; before it just printed
|
||
<code>0</code> over and over again (since it did not work anyway a
|
||
segfault prevention was added here). He also fixed some array addressing
|
||
(some of which might not be strictly necessary but as he was testing the
|
||
<code>fibonacci.c</code> bug he ended up changing it anyway).</p>
|
||
<p>BTW: why can’t the fix:</p>
|
||
<div class="sourceCode" id="cb30"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb30-1"><a href="#cb30-1" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="op">(</span>a<span class="op">[</span><span class="dv">1</span><span class="op">]==</span>NULL<span class="op">||</span>a<span class="op">[</span><span class="dv">2</span><span class="op">]==</span>NULL<span class="op">||</span>a<span class="op">[</span><span class="dv">3</span><span class="op">]==</span>NULL<span class="op">||</span>a<span class="op">[</span><span class="dv">4</span><span class="op">]==</span>NULL<span class="op">||</span>a<span class="op">[</span><span class="dv">5</span><span class="op">]==</span>NULL<span class="op">)</span> <span class="cf">return</span> <span class="dv">1</span><span class="op">;</span></span></code></pre></div>
|
||
<p>be changed to just test the value of <code>A</code> when
|
||
<code>a</code> is argv and <code>A</code> is argc?</p>
|
||
<p>Cody also changed the code to use <code>fgets(3)</code>.</p>
|
||
<p>Since this program is so incredible the extra fixes were deemed worth
|
||
having and this is why it was done.</p>
|
||
<p>Cody later disabled a warning in the Makefile that proved to be a
|
||
problem only with clang in Linux but which was defaulting to an error.
|
||
This way was the simplest way to deal with the problem in question due
|
||
to the way the entry works.</p>
|
||
<p>Cody also added the <a href="/1990/theorem/try.sh">try.sh</a> script
|
||
which shows the original program and some of the programs it
|
||
generates.</p>
|
||
<p><a href="#yusuke">Yusuke</a> pointed out that <code>atof</code>
|
||
nowadays needs <code>#include <stdlib.h></code> which was used in
|
||
order to get this to work initially (prior to this output was there but
|
||
incomplete).</p>
|
||
<h2 id="stig-readme.md"><a name="1990_stig"></a><a
|
||
href="/1990/stig/stig.c">1990/stig</a> (<a
|
||
href="/1990/stig/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the paths in the Makefile so that this
|
||
would build in Linux (it worked fine in macOS).</p>
|
||
<p>He also changed the Makefile to use <code>bash</code> not
|
||
<code>zsh</code> as not all systems have <code>zsh</code> and the
|
||
Makefile actually sets <code>SHELL</code> to <code>bash</code>.</p>
|
||
<h2 id="westley-readme.md-3"><a name="1990_westley"></a><a
|
||
href="/1990/westley/westley.c">1990/westley</a> (<a
|
||
href="/1990/westley/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this for modern systems. It had
|
||
<code>1s</code> in places for a <code>short int</code> which was changed
|
||
to just <code>1</code>. Since it’s instructional to see the differences
|
||
he has provided an alternate version, <a
|
||
href="/1990/westley/westley.alt.c">westley.alt.c</a>, which is the
|
||
original code.</p>
|
||
<p>He also changed the <code>argc</code> to be an <code>int</code>, not
|
||
a <code>char</code>, even though it might often be the same (for the
|
||
purpose of <code>clang</code>?).</p>
|
||
<p>He also fixed the code to not enter an infinite loop if arg is a
|
||
number not > 0 and to not crash if no arg is specified.</p>
|
||
<p>Cody also added the <a href="/1990/westley/try.sh">try.sh</a>
|
||
script.</p>
|
||
<p>The alt code did NOT have arg checks added as it is actually a copy
|
||
of the original code.</p>
|
||
<h1 id="section-7"><a name="1991"></a>1991</h1>
|
||
<h2 id="ant-readme.md"><a name="1991_ant"></a><a
|
||
href="/1991/ant/ant.c">1991/ant</a> (<a
|
||
href="/1991/ant/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added <a href="/1991/ant/ant.alt.c">alt
|
||
code</a> that will be a bit easier to use for those familiar with vim in
|
||
the following ways:</p>
|
||
<ul>
|
||
<li>Use <code>0</code> to go to first column.</li>
|
||
<li>Use <code>$</code> to go to last column.</li>
|
||
<li>Hit ESC to go back to command mode (instead of form-feed,
|
||
ctrl-L).</li>
|
||
<li>Use <code>w</code> to go forwards one word.</li>
|
||
<li>Use <code>b</code> to go backwards one word.</li>
|
||
<li>Use <code>q</code> to exit.</li>
|
||
</ul>
|
||
<p>The other keys were left unchanged.</p>
|
||
<h2 id="brnstnd-readme.md"><a name="1991_brnstnd"></a><a
|
||
href="/1991/brnstnd/brnstnd.c">1991/brnstnd</a> (<a
|
||
href="/1991/brnstnd/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this for modern systems. There were
|
||
two invalid operands to binary expression (<code>char *</code> and
|
||
<code>void</code> and <code>int</code> and <code>void</code>) to resolve
|
||
and additionally a mis-feature of the C pre-processor which no longer
|
||
works had to be changed as well in order to get this to compile. In
|
||
particular the macro <code>C</code>, defined as <code>C =G</code> to
|
||
make <code>+=</code> and similar operators no longer works. The invalid
|
||
operands to binary expressions were resolved with the comma
|
||
operator.</p>
|
||
<p>Later on, Cody added back the macro <code>#define D define</code> to
|
||
make it look ever so slightly more like the original, even though it’s
|
||
unused.</p>
|
||
<p>Cody also added the <a href="/1991/brnstnd/try.sh">try.sh</a> script
|
||
and <a href="/1991/brnstnd/try.txt">try.txt</a> which the script
|
||
uses.</p>
|
||
<h2 id="buzzard-readme.md"><a name="1991_buzzard"></a><a
|
||
href="/1991/buzzard/buzzard.c">1991/buzzard</a> (<a
|
||
href="/1991/buzzard/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this so that the coordinates being
|
||
specified would not crash the program. This happened because the
|
||
function that calls <code>atoi(3)</code> took an arg without any type
|
||
specified and as an implicit <code>int</code> it was not a
|
||
<code>char *</code> which crashed the program in modern systems.</p>
|
||
<p>Cody also made the file name in the code (which is the default maze
|
||
file) not hard-coded but instead be <code>__FILE__</code>.</p>
|
||
<p>Finally Cody added the <a
|
||
href="/1991/buzzard/README.md#alternate-code">alternate version</a>
|
||
which will possibly feel more at home with those familiar with vi(m) (it
|
||
certainly does feel more at home with him): <code>k</code> for forward,
|
||
<code>h</code> for left and <code>l</code> for right. This version also
|
||
has a more useful way to exit, just entering <code>q</code> followed by
|
||
enter, rather than completing or killing the program.</p>
|
||
<h2 id="davidguy-readme.md"><a name="1991_davidguy"></a><a
|
||
href="/1991/davidguy/davidguy.c">1991/davidguy</a> (<a
|
||
href="/1991/davidguy/README.md%5D">README.md</a>)</h2>
|
||
<p>As some systems like macOS can be particular about not declaring
|
||
functions <a href="#cody">Cody</a> added to the Makefile some
|
||
<code>-include</code> options. These appear to not be strictly necessary
|
||
but it was done due to other syscalls being a problem not being declared
|
||
first.</p>
|
||
<h2 id="dds-readme.md-1"><a name="1991_dds"></a><a
|
||
href="/1991/dds/dds.c">1991/dds</a> (<a
|
||
href="/1991/dds/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed a segfault that prevented this entry
|
||
from working in any condition and he also made it work for clang. He
|
||
also added checks for NULL <code>FILE *</code>s. Furthermore he changed
|
||
it so that the C from the BASIC uses <code>fgets()</code>, not
|
||
<code>gets()</code>. For the magic of clang and <code>fgets()</code> see
|
||
below.</p>
|
||
<p>Clang (at least in some systems?) defaults to having
|
||
<code>-Werror</code> and the code that the entry generates had some
|
||
warnings that were causing compilation to fail if <code>cc</code> is
|
||
clang as it just ran <code>cc a.c</code>. It ran it by what was once
|
||
<code>system(q-6);</code> but if <code>cc</code> is clang like in macOS
|
||
this is not enough.</p>
|
||
<p>(Cody said he stupidly did the below manually until he thought to
|
||
write a simple program to do the conversions which he used for
|
||
<code>gets()</code> to <code>fgets()</code> and for making the generated
|
||
code return a value from <code>main()</code> rather than just
|
||
<code>return;</code>).</p>
|
||
<p>The following had to be added to the string <code>s</code> (which to
|
||
fix the segfault was changed from <code>char*s</code> to
|
||
<code>char s[]</code>):</p>
|
||
<pre><code>!.Xop.fssps!.Xop.sfuvso.uzqf!.Xop.jnqmjdju.gvodujpo.efdmbsbujpo</code></pre>
|
||
<p>and then the call to <code>system()</code> had to be changed to:</p>
|
||
<div class="sourceCode" id="cb32"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb32-1"><a href="#cb32-1" aria-hidden="true" tabindex="-1"></a>system<span class="op">(</span>q<span class="op">-</span><span class="dv">69</span><span class="op">);</span></span></code></pre></div>
|
||
<p>An important point is that the placement of this string in the
|
||
<code>s</code> array does matter. This is because of the code:</p>
|
||
<div class="sourceCode" id="cb33"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb33-1"><a href="#cb33-1" aria-hidden="true" tabindex="-1"></a><span class="op">*</span>o<span class="op">=</span>fopen<span class="op">(</span>q<span class="op">-</span><span class="dv">3</span><span class="op">,</span><span class="st">"w"</span><span class="op">);</span></span></code></pre></div>
|
||
<p>which means the file name that translates to <code>a.c</code> has to
|
||
be at the end of the string. Thus the end of the string actually looks
|
||
like:</p>
|
||
<pre><code>!.Xop.fssps!.Xop.sfuvso.uzqf!.Xop.jnqmjdju.gvodujpo.efdmbsbujpo!b/d</code></pre>
|
||
<p>But then there is the matter of getting the C to use
|
||
<code>fgets(3)</code>. As can be seen above it’s not as simple as
|
||
changing <code>gets(3)</code> to <code>fgets(3)</code>. This was more
|
||
magic characters that had to be updated and some added. The C code:</p>
|
||
<div class="sourceCode" id="cb35"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb35-1"><a href="#cb35-1" aria-hidden="true" tabindex="-1"></a>atoi<span class="op">(</span>gets<span class="op">(</span>b<span class="op">))</span></span></code></pre></div>
|
||
<p>is in the string:</p>
|
||
<pre><code>bupj)hfut)c**</code></pre>
|
||
<p>which was changed to be (in C):</p>
|
||
<div class="sourceCode" id="cb37"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb37-1"><a href="#cb37-1" aria-hidden="true" tabindex="-1"></a>atoi<span class="op">(</span>fgets<span class="op">(</span>b<span class="op">,</span><span class="dv">99</span><span class="op">,</span>stdin<span class="op">))</span></span></code></pre></div>
|
||
<p>which in the program is:</p>
|
||
<pre><code>bupj)ghfut)c-::-tuejo**</code></pre>
|
||
<p>That’s fine and well but since the code does not include
|
||
<code>stdio.h</code> there obviously would be a compilation error. Thus
|
||
the compiler line had to updated to have <code>-include stdio.h</code>
|
||
which in this rotated string is:</p>
|
||
<pre><code>.jodmvef!tuejp/i</code></pre>
|
||
<p>which had to be added after:</p>
|
||
<pre><code>efdmbsbujpo!</code></pre>
|
||
<p>which is the end of the warning disabled for clang as described
|
||
above.</p>
|
||
<p>But now the <code>system(q-69);</code> had to be changed to
|
||
<code>system(q-86);</code>.</p>
|
||
<p>Then, later on, Cody discovered that in some systems, clang triggers
|
||
even more warnings so this had to be corrected too so the string was
|
||
updated again and the <code>system(q-86)</code> had to be changed to
|
||
<code>system(q-104)</code>.</p>
|
||
<p>But then to prevent the need for disabling a warning and to be more
|
||
correct code, the generated code was changed to <code>return 1;</code>
|
||
rather than just <code>return;</code>. Thus in full the string
|
||
became:</p>
|
||
<div class="sourceCode" id="cb41"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb41-1"><a href="#cb41-1" aria-hidden="true" tabindex="-1"></a><span class="dt">char</span> s<span class="op">[]=</span><span class="st">"Qjou!s</span><span class="sc">\\</span><span class="st">311^-g</span><span class="sc">\\</span><span class="st">311^-n</span><span class="sc">\\</span><span class="st">311^-c</span><span class="sc">\\</span><span class="st">::^-q-ma%mO1JBHm%BQ-aP1J[O1HB%[Q<n</span><span class="op">\</span></span>
|
||
<span id="cb41-2"><a href="#cb41-2" aria-hidden="true" tabindex="-1"></a><span class="st">bjo)*|gps)<<*txjudi)m*|aQdbtf!::::;sfuvso!2<aQefgbvmu;aQ<m,,a%CQ<csfbla</span><span class="sc">%b</span><span class="st">Q<a</span><span class="op">\</span></span>
|
||
<span id="cb41-3"><a href="#cb41-3" aria-hidden="true" tabindex="-1"></a><span class="st">N2!Q</span><span class="sc">\n</span><span class="st">dbtf!aP2Q;m>aP2Q<a%!D12J!JGJHJOJQJFJSJJJMHS%HD12D12N3!N4</span><span class="sc">\n</span><span class="st">JUJT%UQm>aP4</span><span class="op">\</span></span>
|
||
<span id="cb41-4"><a href="#cb41-4" aria-hidden="true" tabindex="-1"></a><span class="st">HC%TQs</span><span class="sc">\\</span><span class="st">q,,^>m,2<m>aP4HC%SD12N1</span><span class="sc">\n</span><span class="st">JNQm>s</span><span class="sc">\\</span><span class="st">..q^aHC%NHb</span><span class="sc">%G</span><span class="st">N1!D32P3%RN1UP1D12JPQU</span><span class="op">\</span></span>
|
||
<span id="cb41-5"><a href="#cb41-5" aria-hidden="true" tabindex="-1"></a><span class="st">aP1HR%PN4</span><span class="sc">\n</span><span class="st">Q<g</span><span class="sc">\\</span><span class="st">(aP3Q(^>aP2Q,2<n</span><span class="sc">\\</span><span class="st">(aP3Q(^>aP4Hb%OD12D12N2!N3</span><span class="sc">\n</span><span class="st">JVP3Q,,<jg)aP3</span><span class="op">\</span></span>
|
||
<span id="cb41-6"><a href="#cb41-6" aria-hidden="true" tabindex="-1"></a><span class="st">Q=>n</span><span class="sc">\\</span><span class="st">(aP3Q(^*m>g</span><span class="sc">\\</span><span class="st">(aP3Q(^<fmtf!m,,aHC%QN1!N1</span><span class="sc">\n</span><span class="st">J#Qqsjoug)#&e]o#-aP1Q*aHb%#Qq</span><span class="op">\</span></span>
|
||
<span id="cb41-7"><a href="#cb41-7" aria-hidden="true" tabindex="-1"></a><span class="st">vut)aP1Q*aHb</span><span class="sc">%F</span><span class="st">N1</span><span class="sc">\n</span><span class="st">Qm>::::aHC%VP3Q>bupj)ghfut)c-::-tuejo**aHb%JD12JON1!Qjg)a%</span><span class="op">\</span></span>
|
||
<span id="cb41-8"><a href="#cb41-8" aria-hidden="true" tabindex="-1"></a><span class="st">LN1UP1D12JIQUaP1HL%IQ*m>aN2!N2</span><span class="sc">\n</span><span class="st">P2Q<fmtf!m,,aHC%MN1!N2>P2Q>aN2</span><span class="sc">\n</span><span class="st">P2Hbdd!.Xop.</span><span class="op">\</span></span>
|
||
<span id="cb41-9"><a href="#cb41-9" aria-hidden="true" tabindex="-1"></a><span class="st">fssps!.Xop.jnqmjdju.gvodujpo.efdmbsbujpo!.Xop.jnqmjdju.jou!.jodmvef!tuejp/i!</span><span class="op">\</span></span>
|
||
<span id="cb41-10"><a href="#cb41-10" aria-hidden="true" tabindex="-1"></a><span class="st">b/d"</span><span class="op">;</span></span></code></pre></div>
|
||
<p>and it now is <code>system(q-87);</code>.</p>
|
||
<p>It is hoped that this is the last time the string has to be updated
|
||
to work with all versions of clang but if not the above is how it
|
||
works.</p>
|
||
<p>With these changes in place it will compile and work with both gcc
|
||
and clang and the C code generated will use <code>fgets(3)</code>, not
|
||
<code>gets(3)</code>, therefore removing the annoying warnings. Note
|
||
that the array passed to <code>fgets(3)</code> is an int but that was
|
||
the same for <code>gets()</code> and is not necessary to update to a
|
||
<code>char[]</code>.</p>
|
||
<p>The key to the string is that it rotates the character by
|
||
<code>+1</code>. This was not immediately clear until reading the
|
||
author’s remarks so there was an alt version that was something of a
|
||
kludge, running <code>make a</code> instead but that was removed.</p>
|
||
<p>Cody also fixed a typo in LANDER.BAS and made it so that if a file
|
||
could not be opened for reading or a file could not be opened for
|
||
writing it would not crash. The definition of whether that should be a
|
||
bug to fix or a feature to not fix was pondered and changed numerous
|
||
times and ultimately that problem with this entry was fixed. It has not
|
||
been done in all.</p>
|
||
<h2 id="fine-readme.md"><a name="1991_fine"></a><a
|
||
href="/1991/fine/fine.c">1991/fine</a> (<a
|
||
href="/1991/fine/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> made it look much more like the original
|
||
entry even after the fix that increased the count in characters from 80
|
||
to 106, getting it back down to just 85 (and later back down to 80, see
|
||
below).</p>
|
||
<p>This was done by redefining <code>main</code> at the compiler line so
|
||
that it looks like the original where one didn’t have to worry about the
|
||
type of args of main() and there were other fewer restrictions and also
|
||
by removing a cast that was not strictly necessary (this does create a
|
||
new warning:
|
||
<code>ordered comparison between pointer and integer ('char **' and 'int')</code>
|
||
but it works just <code>fine</code>).</p>
|
||
<p>That was <code>fine</code> as well but Cody decided to drop it back
|
||
down to its original 80 which also resolved the warning described above.
|
||
This was by more clever use of the Makefile which now has a
|
||
<code>-DB=(int)b</code> so that <code>B</code> can be used in place
|
||
where <code>(int)b</code> used to be necessary.</p>
|
||
<p>Cody also added the <a href="/1991/fine/try.sh">try.sh</a> script
|
||
which feeds the program some fun input for fun but mostly different
|
||
output. He added a great string from Brian Westley and Cody also added
|
||
several of his own (can you figure out exactly which ones? :-) )</p>
|
||
<h2 id="rince-readme.md"><a name="1991_rince"></a><a
|
||
href="/1991/rince/rince.c">1991/rince</a> (<a
|
||
href="/1991/rince/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed it so that the messages that show if
|
||
you won or lost will be seen after the end of the game. The reason it
|
||
did not work before is curses was ended at the end of the program which
|
||
clears the screen. To make it look most like the original entry Cody
|
||
left the message before ending curses in and printed another message of
|
||
the same kind after <code>endwin()</code> was called with the exception
|
||
that he added a newline at the end of the screen to be more user
|
||
friendly.</p>
|
||
<p>Cody also added <a href="/1991/rince/README.md#alternate-code">two
|
||
alt versions</a>, one to remove the maximum number of moves you may make
|
||
and another to let you configure the maximum number of moves, even if
|
||
that is making it harder to win. Naturally the above fix was applied to
|
||
these versions too.</p>
|
||
<h2 id="westley-readme.md-4"><a name="1991_westley"></a><a
|
||
href="/1991/westley/westley.c">1991/westley</a> (<a
|
||
href="/1991/westley/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed a segfault in this program which
|
||
prevented it from working. The problem was that the read-only char array
|
||
<code>char *z[]</code> was being written to. The fix was to change it to
|
||
<code>char z[][100]</code> in two spots (see if you can determine why
|
||
two places, not one!). Why 100 when the longest string is < 100?
|
||
Because a shorter value caused strange output and it’s easier to just
|
||
choose a larger value that works without having to find the correct
|
||
value.</p>
|
||
<p>Cody also fixed the <code>ttt.sh</code> script that prevented the
|
||
game from working and he also improved it so that warnings/errors/about
|
||
to compile messages are not shown unless the <code>-e</code> option is
|
||
used. This is because the errors being shown kind of ruins the
|
||
experience. Finally he made it pass <a
|
||
href="https://github.com/koalaman/shellcheck">ShellCheck</a>.</p>
|
||
<p>Cody also added the alt version which is based on the author’s
|
||
remarks, a version that supposedly (:-) ) always wins.</p>
|
||
<p>Cody also fixed the make clobber rule where a file was left lying
|
||
about when it should have been removed.</p>
|
||
<h1 id="section-8"><a name="1992"></a>1992</h1>
|
||
<h2 id="adrian-readme.md"><a name="1992_adrian"></a><a
|
||
href="/1992/adrian/adrian.c">1992/adrian</a> (<a
|
||
href="/1992/adrian/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the code so that it will try opening
|
||
the file the code was compiled from (<code>__FILE__</code>), not
|
||
<code>adgrep.c</code>, as the latter does not exist: <code>adgrep</code>
|
||
is simply a link to <code>adrian</code> as <code>adgrep</code> is what
|
||
the program was submitted as but the entry’s winning source file is
|
||
<code>adrian.c</code>.</p>
|
||
<p>Not fixing the above problem would have also caused the program to
|
||
crash if no arg was specified as the file doesn’t exist. In making the
|
||
above fix, at first the change to check for a <code>NULL</code> file was
|
||
added. Then it was noticed that the problem is that
|
||
<code>adgrep.c</code> was an incorrect reference that never existed and
|
||
it was never fixed in any of the files, not the code or the
|
||
documentation, and thus was entirely incorrect code. A fun fact is that
|
||
one can do:</p>
|
||
<div class="sourceCode" id="cb42"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb42-1"><a href="#cb42-1" aria-hidden="true" tabindex="-1"></a>W<span class="op">=</span> fopen<span class="op">(</span>wc<span class="op">>=</span> <span class="dv">2</span> <span class="op">?</span> V<span class="op">[</span><span class="dv">1</span><span class="op">]</span> <span class="op">:</span> __FILE__<span class="op">,</span><span class="st">"rt"</span><span class="op">);</span><span class="cf">if</span><span class="op">(!</span>W<span class="op">)</span>exit<span class="op">(</span><span class="dv">1</span><span class="op">);</span></span></code></pre></div>
|
||
<p>but one <em>CANNOT</em> do:</p>
|
||
<div class="sourceCode" id="cb43"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb43-1"><a href="#cb43-1" aria-hidden="true" tabindex="-1"></a>W<span class="op">=</span> fopen<span class="op">(</span>wc<span class="op">>=</span> <span class="dv">2</span> <span class="op">?</span> V<span class="op">[</span><span class="dv">1</span><span class="op">]</span> <span class="op">:</span> __FILE__<span class="op">,</span><span class="st">"rt"</span><span class="op">);</span><span class="cf">if</span><span class="op">(!</span>W<span class="op">)</span>exit<span class="op">(</span><span class="dv">1</span><span class="op">);</span></span>
|
||
<span id="cb43-2"><a href="#cb43-2" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="op">(</span>W<span class="op">==</span>NULL<span class="op">)</span>exit<span class="op">(</span><span class="dv">1</span><span class="op">);</span></span></code></pre></div>
|
||
<p>because <code>adwc.c</code> will be empty! The difference is it is on
|
||
a newline, the check. This is an example of how a simple change in code
|
||
can break it and this is also true of another change as further
|
||
below.</p>
|
||
<p>Cody also restored a slightly more obscure line of code that had been
|
||
changed:</p>
|
||
<div class="sourceCode" id="cb44"><pre
|
||
class="sourceCode diff"><code class="sourceCode diff"><span id="cb44-1"><a href="#cb44-1" aria-hidden="true" tabindex="-1"></a><span class="st">- putc("}|uutsrq`_^bji`[Zkediml[PO]a_M__]ISOYIRGTNR"[i]+i-9,stderr);</span></span>
|
||
<span id="cb44-2"><a href="#cb44-2" aria-hidden="true" tabindex="-1"></a><span class="va">+ putc(i["}|uutsrq`_^bji`[Zkediml[PO]a_M__]ISOYIRGTNR"]+i-9,stderr);</span></span></code></pre></div>
|
||
<p>though it’s questionable how much more (if at all) obscure that is
|
||
:-)</p>
|
||
<p>Cody also changed the location that it used <code>gets()</code> to be
|
||
<code>fgets(3)</code>. This was complicated because of how the other
|
||
source files are generated (as above); simply changing the code could
|
||
cause invalid output in the program which made other files fail to
|
||
compile (for this example specifically, see below).</p>
|
||
<p>One might think that simply changing the <code>gets(3)</code> to
|
||
<code>fgets(3)</code> (with <code>stdin</code>) would work but it did
|
||
not because <code>fgets(3)</code> stores the newline and
|
||
<code>gets(3)</code> does not. That is well known but this code was
|
||
relying on not having this newline in a different way (see also
|
||
above).</p>
|
||
<p>With <code>fgets(3)</code> the code <code>if(A(Y)) puts(Y);</code>
|
||
ended up printing an extra line which made the generation of some files
|
||
(like <code>adhead.c</code>) fail to compile. Why? There was a blank
|
||
line after a <code>\</code> at the end of the first line of a <em>macro
|
||
definition</em>! Thus the code now first trims off the last character of
|
||
the buffer read to get the same correct functionality but in a safe and
|
||
non obnoxious way.</p>
|
||
<p>In this case the macro for <code>gets</code> could not be changed to
|
||
have the macro do the removal of the extra line (as in with a comma
|
||
operator or a <code>&&</code>) as this, as might be expected
|
||
from the above, caused compilation errors with another generated file
|
||
(<code>adwc.c</code>)! Thus after the <code>gets(3)</code> call in the
|
||
line that looks like:</p>
|
||
<div class="sourceCode" id="cb45"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb45-1"><a href="#cb45-1" aria-hidden="true" tabindex="-1"></a><span class="cf">while</span><span class="op">(</span> gets<span class="op">(</span>Y<span class="op">)</span> <span class="op">){</span> Y<span class="op">[</span>strlen<span class="op">(</span>Y<span class="op">)-</span><span class="dv">1</span><span class="op">]=</span><span class="ch">'</span><span class="sc">\0</span><span class="ch">'</span><span class="op">;</span> <span class="cf">if</span><span class="op">(</span>A<span class="op">(</span>Y<span class="op">))</span> puts<span class="op">(</span>Y<span class="op">);</span> <span class="op">}</span></span></code></pre></div>
|
||
<p>one must keep the <code>Y[strlen(Y)-1]='\0';</code> part and keep it
|
||
there.</p>
|
||
<p>These fixes are complex changes due to the way the program and
|
||
Makefile generate the additional tools.</p>
|
||
<p>Cody finally added the <a href="/1992/adrian/try.sh">try.sh</a>
|
||
script that shows the entry and some of the tools this entry generates.
|
||
Unlike other scripts, it does not clear the screen after compilation so
|
||
that one can see how the other files are generated.</p>
|
||
<h2 id="albert-readme.md"><a name="1992_albert"></a><a
|
||
href="/1992/albert/albert.c">1992/albert</a> (<a
|
||
href="/1992/albert/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to compile with modern systems.
|
||
Note that in 1996 a bug fix was applied to the code, provided as the alt
|
||
code as that version is not obfuscated. Thus Cody’s fix applies to the
|
||
original entry. The problems were that <code>malloc.h</code> is not the
|
||
correct header file now (at least in some systems?) and a non-void
|
||
(implicit <code>int</code>) function returning without a value. That
|
||
function was changed to return <code>void</code>.</p>
|
||
<p>Cody also added the <a href="/1992/albert/try.sh">try.sh</a> and <a
|
||
href="/1992/albert/try.alt.sh">try.alt.sh</a> scripts that correspond to
|
||
the entry and the alt code.</p>
|
||
<h2 id="ant-readme.md-1"><a name="1992_ant"></a><a
|
||
href="/1992/ant/ant.c">1992/ant</a> (<a
|
||
href="/1992/ant/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the Makefile so that the program will
|
||
actually work with it (or at least the rule to clobber files and link
|
||
<code>am</code> to <code>ant</code>). The issue was that the variables
|
||
in the Makefile could not be evaluated in the same way as it’s not as
|
||
feature-rich as other implementations of <code>make(1)</code>. Thus the
|
||
use of <code>${RM}</code> and <code>${CP}</code> were in the respective
|
||
rules changed to <code>rm</code> and <code>cp</code>, for two examples.
|
||
A new rule had to be added as well. The variable situation might be
|
||
because they are obtained from the root variable Makefile
|
||
<code>var.mk</code> via <code>include</code> which the program might not
|
||
support (this has not been tested, however) and also because it appears
|
||
that the syntax for this program is to use <code>$()</code> rather than
|
||
<code>${}</code>.</p>
|
||
<p>Cody also fixed another problem, unrelated, in the Makefile with the
|
||
<code>.PHONY</code> rule where a line was not ended with a
|
||
<code>\</code> but should have been.</p>
|
||
<p>The author stated that in some systems like DOS with Turbo C, it
|
||
might be necessary to include <code>time.h</code> so Cody did this as
|
||
well as this exists in other systems too.</p>
|
||
<p>Cody also added the <a href="/1992/ant/try.sh">try.sh</a> script.</p>
|
||
<h2 id="buzzard.1-readme.md"><a name="1992_buzzard.1"></a><a
|
||
href="/1992/buzzard.1/buzzard.1.c">1992/buzzard.1</a> (<a
|
||
href="/1992/buzzard.1/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added a check for the right number of args,
|
||
exiting 1 if not enough (2) used. This was not originally done but at a
|
||
time it was changed to be considered a bug so it was fixed at that point
|
||
as it only took a few seconds and had to be verified that it was
|
||
consistent with the <a href="/bugs.md">bugs.md</a> file.</p>
|
||
<p>He also added the <a href="/1992/buzzard.1/try.sh">try.sh</a> script
|
||
to try out some commands that we suggested and some additional ones that
|
||
he provide for some fun.</p>
|
||
<h2 id="buzzard.2-readme.md"><a name="1992_buzzard.2"></a><a
|
||
href="/1992/buzzard.2/buzzard.2.c">1992/buzzard.2</a> (<a
|
||
href="/1992/buzzard.2/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the alt code to compile. The problem
|
||
was it assumed that <code>exit(3)</code> returns a value, not
|
||
<code>void</code>. This was fixed with a <code>,0</code>.</p>
|
||
<p>Cody also added the <a href="/1992/buzzard.2/try.sh">try.sh</a> and
|
||
<a href="/1992/buzzard.2/try.alt.sh">try.alt.sh</a> scripts that
|
||
correspond to the entry and its alt code.</p>
|
||
<h2 id="gson-readme.md"><a name="1992_gson"></a><a
|
||
href="/1992/gson/gson.c">1992/gson</a> (<a
|
||
href="/1992/gson/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed a crash that prevented this entry from
|
||
working in some cases in some systems (like macOS) by disabling the
|
||
optimiser in the Makefile.</p>
|
||
<p>Cody also added the <a href="/1992/gson/try.sh">try.sh</a>
|
||
script.</p>
|
||
<p>Cody also added the <a href="/1992/gson/mkdict.sh">mkdict.sh</a>
|
||
script that the author included in their remarks. See the README.md for
|
||
its purpose. It was NOT fixed for <a
|
||
href="https://github.com/koalaman/shellcheck">ShellCheck</a> because the
|
||
author deliberately obfuscated it so <strong>PLEASE <em>DO NOT</em> FIX
|
||
THIS OR MODERNISE IT</strong>.</p>
|
||
<p>Cody also changed the buffer size in such a way that
|
||
<code>gets(3)</code> should be safe (well, theoretically) as it comes
|
||
from the command line (though it can also read input from
|
||
<code>stdin</code> after starting the program). Ideally
|
||
<code>fgets(3)</code> would be used but this is a more problematic. See
|
||
<a href="/bugs.md#1992-gson">1992/gson in bugs.md</a> for more details
|
||
if you’re interested in trying to understand it (or fix?).</p>
|
||
<h2 id="imc-readme.md"><a name="1992_imc"></a><a
|
||
href="/1992/imc/imc.c">1992/imc</a> (<a
|
||
href="/1992/imc/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> provided the <a
|
||
href="/1992/imc/try.sh">try.sh</a> script.</p>
|
||
<p>The original code, <a href="/1992/imc/imc.orig.c">imc.orig.c</a>,
|
||
assumed that <code>exit(3)</code> returned a value but this will cause
|
||
problems where <code>exit(3)</code> returns void. The source code was
|
||
modified to avoid this problem but like Cody did with other fixes he
|
||
made this more like the original by redefining <code>exit</code> to use
|
||
the comma operator so that it could be used in binary expressions.</p>
|
||
<h2 id="kivinen-readme.md"><a name="1992_kivinen"></a><a
|
||
href="/1992/kivinen/kivinen.c">1992/kivinen</a> (<a
|
||
href="/1992/kivinen/README.md%5D">README.md</a>)</h2>
|
||
<p>It was observed that on modern systems this goes much too quick. <a
|
||
href="#yusuke">Yusuke</a> created a patch that calls
|
||
<code>usleep(3)</code> but <a href="#cody">Cody</a> thought the value
|
||
was too slow so he made it a macro in the Makefile <code>Z</code> (which
|
||
can be redefined with <code>make SLEEP=...</code>), defaulting at 15000.
|
||
This was made an <a href="/1992/kivinen/kivinen.alt.c">alt version</a>
|
||
and it is recommended one use the alt version first. See the README.md
|
||
file to see how to reconfigure it.</p>
|
||
<p>Cody also made the fixed version (the code relied on
|
||
<code>exit(3)</code> returning to use in binary expressions) (and alt
|
||
code from it) more like the original by renaming the <code>ext</code>
|
||
macro to be <code>exit</code> which uses the comma operator. He made it
|
||
so the line lengths match the original code, at least as best as
|
||
possible (if not perfectly), including start and end columns, often (if
|
||
not all) with the same start and end character.</p>
|
||
<p>Cody made <code>main()</code> have two args, not one, as some
|
||
versions of clang have a defect with the number of args to
|
||
<code>main()</code> though when it comes to 1 arg it is only in an error
|
||
message if say 4 args are used. This is out of an abundance of caution
|
||
as it’s quite possible that clang or the ANSI C committee end up further
|
||
changing this.</p>
|
||
<p>Yusuke also noted that there is a bug in the program where right
|
||
after starting it moves towards the right but if you click the mouse it
|
||
goes back.</p>
|
||
<h2 id="lush-readme.md"><a name="1992_lush"></a><a
|
||
href="/1992/lush/lush.c">1992/lush</a> (<a
|
||
href="/1992/lush/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#yusuke">Yusuke</a> supplied a patch which makes this work
|
||
with gcc. Due to how it works (see Judges’ remarks in the README.md
|
||
file) this will not work with clang.</p>
|
||
<p><a href="#cody">Cody</a> also provided the <a
|
||
href="/1992/lush/lush.sh">lush.sh</a> script to demonstrate it as using
|
||
make was problematic.</p>
|
||
<p>Cody made it use <code>fgets()</code> instead of
|
||
<code>gets()</code>.</p>
|
||
<p>NOTE: this entry cannot work with clang due to different compiler
|
||
messages (it will compile fine but it won’t work). See <a
|
||
href="/bugs.md">bugs.md</a> for details.</p>
|
||
<h2 id="marangon-readme.md"><a name="1992_marangon"></a><a
|
||
href="/1992/marangon/marangon.c">1992/marangon</a> (<a
|
||
href="/1992/marangon/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> made this more portable by changing the
|
||
<code>void main()</code> to be <code>int main()</code>.</p>
|
||
<h2 id="nathan-readme.md"><a name="1992_nathan"></a><a
|
||
href="/1992/nathan/nathan.c">1992/nathan</a> (<a
|
||
href="/1992/nathan/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the original file back as it was
|
||
deemed that the export restrictions should no longer be a cause of
|
||
concern for this entry. Doing this did require a change to Cody’s <a
|
||
href="/2020/ferguson2/README.md">2020/ferguson2</a> entry as it’s
|
||
referenced.</p>
|
||
<p>Cody cynically noted that if he goes quiet, for instance if he no
|
||
longer participates in the IOCCC, that it must be our fault! :-)</p>
|
||
<p>Cody also added the <a href="/1992/nathan/try.sh">try.sh</a> script
|
||
that runs a few commands that we suggested as well as one he
|
||
provided.</p>
|
||
<h2 id="vern-readme.md"><a name="1992_vern"></a><a
|
||
href="/1992/vern/vern.c">1992/vern</a> (<a
|
||
href="/1992/vern/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed an infinite loop if one were to input
|
||
numbers < <code>0</code> or > <code>077</code>. The problem was
|
||
that it tried to use <code>scanf(3)</code> with the format specifier
|
||
<code>"%o %o"</code> in a loop, reading again if <code>scanf(3)</code>
|
||
did not return 2 (that was not a problem in that <code>scanf(2)</code>
|
||
will not return until the number of specifiers have been processed or
|
||
some error occurs) or a function it called returned non-zero.</p>
|
||
<p>Instead the fix involves the <code>scanf(3)</code> specifiers being
|
||
<code>"%4s %4s"</code> on two new char arrays (always cleared in the
|
||
beginning of the loop) and then using <code>strtol(3)</code> with a base
|
||
of <code>8</code> (as it’s octal), checking for
|
||
<code>< 0 || > 077</code> on both numbers (using
|
||
<code>"%o %o"</code> does not solve the problem).</p>
|
||
<h2 id="westley-readme.md-5"><a name="1992_westley"></a><a
|
||
href="/1992/westley/westley.c">1992/westley</a> (<a
|
||
href="/1992/westley/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to work for clang by changing the
|
||
third and fourth arg of <code>main()</code> to be <code>char **</code>
|
||
inside <code>main()</code>; clang requires args 2 - 4 to be
|
||
<code>char **</code> and some versions do not even allow a fourth
|
||
arg.</p>
|
||
<p>He also added the alternate version that the author gave in the
|
||
remarks that is specifically for the USA rather than the world. This had
|
||
to be fixed for clang as well to make the args of <code>main()</code> be
|
||
the correct type and by moving the body of main() to another function,
|
||
<code>pain()</code>, which does the work since not all versions of clang
|
||
support four args to <code>main()</code>.</p>
|
||
<p>Cody also removed the restriction that one has to have a terminal
|
||
that wraps at 80 columns so that as long as the terminal’s columns (try
|
||
<code>echo $COLUMNS</code>) is >= 80 it should work. As most people
|
||
have wider terminals than back in 1992 this should help make it much
|
||
easier to use. Note that if the number of columns is < 80 it will not
|
||
work right. The way this was done is that every 80 iterations in the
|
||
final loop it prints another newline. This fix has another bonus in that
|
||
resizing the terminal after running it should not mess up the display
|
||
either, unless of course it becomes too small.</p>
|
||
<p>Cody added the scripts <a
|
||
href="/1992/westley/whereami.sh">whereami.sh</a> and <a
|
||
href="/1992/westley/whereami.alt.sh">whereami.alt.sh</a> which
|
||
correspond to the entry and the alt code but first check that the number
|
||
of columns is at least 80 and if not it is an error.</p>
|
||
<p>Cody added the <a href="/1992/westley/try.sh">try.sh</a> script that
|
||
shows the different cities that the author recommended one try as well
|
||
as the one recommended by the judges (approximate judging location),
|
||
labelling each city and printing a newline before the next city. The
|
||
try.sh script uses the <code>whereami.sh</code> and
|
||
<code>whereami.alt.sh</code> scripts, as long as they’re executable (if
|
||
they’re not it first tries to make it executable and if it fails to do
|
||
so it just uses <code>westley</code> or <code>westley.alt</code>. The
|
||
scripts can be deceived by <code>COLUMNS=80 ./try.sh</code> (or
|
||
<code>COLUMNS=80 ./whereami.sh</code> etc.) but this is a feature, not a
|
||
bug.</p>
|
||
<p>Cody also added an arg check because the program and the <a
|
||
href="/1992/westley/westley.alt.c">alternate version</a> might have
|
||
crashed or <a
|
||
href="https://en.wikipedia.org/wiki/Nuclear_weapon">nuked</a> the <a
|
||
href="https://en.wikipedia.org/wiki/Earth">entire world</a> or just the
|
||
<a href="https://en.wikipedia.org/wiki/United_States">USA</a>,
|
||
respectively, without enough args (2). And not that we need the help or
|
||
anything for this :-) but we encourage you to try the original without
|
||
two args :-)</p>
|
||
<h1 id="section-9"><a name="1993"></a>1993</h1>
|
||
<h2 id="ant-readme.md-2"><a name="1993_ant"></a><a
|
||
href="/1993/ant/ant.c">1993/ant</a> (<a
|
||
href="/1993/ant/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/1993/ant/try.sh">try.sh</a> script and a data file, <a
|
||
href="/1993/ant/ants.txt">ants.txt</a>, full of ants for the script.</p>
|
||
<h2 id="cmills-readme.md-1"><a name="1993_cmills"></a><a
|
||
href="/1993/cmills/cmills.c">1993/cmills</a> (<a
|
||
href="/1993/cmills/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#yusuke">Yusuke</a> suggested that with modern systems this
|
||
goes too fast so he added a call to <code>usleep(3)</code> in a patch he
|
||
made. <a href="#cody">Cody</a> made it configurable at compilation by
|
||
using a macro. This is in the alt version which is the recommended one
|
||
to try first.</p>
|
||
<h2 id="dgibson-readme.md"><a name="1993_dgibson"></a><a
|
||
href="/1993/dgibson/dgibson.c">1993/dgibson</a> (<a
|
||
href="/1993/dgibson/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the <a
|
||
href="/1993/dgibson/dgibson.sh">dgibson.sh</a> script to work which
|
||
assumed that <code>.</code> is in the path.</p>
|
||
<p>Cody also added the <a href="/1993/dgibson/try.sh">try.sh</a> script
|
||
which runs the above mentioned script on all the data files.</p>
|
||
<h2 id="ejb-readme.md"><a name="1993_ejb"></a><a
|
||
href="/1993/ejb/ejb.c">1993/ejb</a> (<a
|
||
href="/1993/ejb/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/1993/ejb/try.sh">try.sh</a> script.</p>
|
||
<h2 id="jonth-readme.md"><a name="1993_jonth"></a><a
|
||
href="/1993/jonth/jonth.c">1993/jonth</a> (<a
|
||
href="/1993/jonth/README.md%5D">README.md</a>)</h2>
|
||
<p>Both <a href="#cody">Cody</a> and <a href="#yusuke">Yusuke</a> fixed
|
||
this so that it will work with modern systems. Yusuke provided some
|
||
fixes of the X code and Cody fixed the C pre-processor directives so
|
||
that it would compile. It used to be that you could get away with code
|
||
like:</p>
|
||
<div class="sourceCode" id="cb46"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb46-1"><a href="#cb46-1" aria-hidden="true" tabindex="-1"></a>G <span class="dt">int</span> i<span class="op">,</span>j</span>
|
||
<span id="cb46-2"><a href="#cb46-2" aria-hidden="true" tabindex="-1"></a>K <span class="cf">case</span></span></code></pre></div>
|
||
<p>and expect <code>G;</code> to equate to <code>int i, j;</code>
|
||
(though it’s now a long) and <code>K</code> to mean <code>case</code>
|
||
but that’s no longer the case so the offending lines had
|
||
<code>#define</code> prepended to them.</p>
|
||
<h2 id="leo-readme.md"><a name="1993_leo"></a><a
|
||
href="/1993/leo/leo.c">1993/leo</a> (<a
|
||
href="/1993/leo/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to work with modern compilers.
|
||
This involved different header files for functions.</p>
|
||
<h2 id="lmfjyh-readme.md"><a name="1993_lmfjyh"></a><a
|
||
href="/1993/lmfjyh/lmfjyh.c">1993/lmfjyh</a> (<a
|
||
href="/1993/lmfjyh/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added an <a
|
||
href="/1993/lmfjyh/README.md#alternate-code">alternate version</a> which
|
||
does what the program did with gcc < 2.3.3. See the README.md file
|
||
for details and for why this was made the alternate version, not the
|
||
actual entry. This alternate version will compile automatically (as
|
||
<code>lmfjyh</code> itself) in the very likely case (if you don’t have
|
||
gcc < 2.3.3) that the entry fails to compile.</p>
|
||
<p>Cody also made the Makefile delete the very unsafe filename that is
|
||
compiled (or would be compiled if gcc < 2.3.3) whether or not
|
||
compilation succeeds (which is highly unlikely).</p>
|
||
<h2 id="plummer-readme.md"><a name="1993_plummer"></a><a
|
||
href="/1993/plummer/plummer.c">1993/plummer</a> (<a
|
||
href="/1993/plummer/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added check for two args.</p>
|
||
<p>Cody also added an <a href="/1993/plummer/plummer.alt.c">alternate
|
||
version</a> which uses <code>usleep(3)</code> so you can see what is
|
||
happening with faster systems. This version also checks for two args and
|
||
it is the one we recommend one try first. See the README.md files for
|
||
details.</p>
|
||
<p>Cody also added the <a href="/1993/plummer/try.sh">try.sh</a> and <a
|
||
href="/1993/plummer/try.alt.sh">try.alt.sh</a> scripts that correspond
|
||
to the original entry and the alt version, both allowing one to change
|
||
the args (and in the case of the alt one allowing one to change the
|
||
amount to sleep).</p>
|
||
<h2 id="rince-readme.md-1"><a name="1993_rince"></a><a
|
||
href="/1993/rince/rince.c">1993/rince</a> (<a
|
||
href="/1993/rince/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#yusuke">Yusuke</a> supplied a patch to get this to work in
|
||
modern systems. This fix also applies the compatibility issue of
|
||
<code>select(2)</code> described in the README.md file.</p>
|
||
<p><a href="#cody">Cody</a> added a call to <code>endwin()</code> to
|
||
help with terminal sanity after the program ends.</p>
|
||
<p>Cody provided two alternate versions to simplify slowing the game
|
||
down and, for the second one, to make movement keys (of the default
|
||
game) more familiar to vi users. The slowing down was based on our
|
||
suggestion that it might be desired to slow down but Cody did it in such
|
||
a way that makes it easy to configure at compile time. See the README.md
|
||
for details.</p>
|
||
<h2 id="schnitzi-readme.md"><a name="1993_schnitzi"></a><a
|
||
href="/1993/schnitzi/schnitzi.c">1993/schnitzi</a> (<a
|
||
href="/1993/schnitzi/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> made this use <code>fgets(3)</code> not
|
||
<code>gets(3)</code>.</p>
|
||
<h2 id="vanb-readme.md-1"><a name="1993_vanb"></a><a
|
||
href="/1993/vanb/vanb.c">1993/vanb</a> (<a
|
||
href="/1993/vanb/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to work with clang. The problem
|
||
was that the third arg to main() was not a <code>char **</code>. Instead
|
||
<code>O5()</code> (which was <code>main()</code> via
|
||
<code>-DO5=main</code>) is now its own function which main() calls with
|
||
the right parameters.</p>
|
||
<p>Later Cody fixed it again to look much more like the original where
|
||
only a single line is added, that of <code>main()</code>, which calls
|
||
<code>O5()</code>. This was done through <code>-include stdio.h</code>
|
||
at the compiler (in the Makefile) and by removing the <code>O3</code>
|
||
variable (an int) at the top of the file, instead making it a
|
||
<code>char **</code> in <code>main()</code> (<code>O5()</code> had three
|
||
args) but then passing in <code>0</code> to <code>O5()</code> for the
|
||
third arg (as it was 0 at file scope already this is perfectly fine and
|
||
it means there’s no need to cast it to an int in the function call
|
||
though that would also work).</p>
|
||
<p>Cody also added the alt code, provided by the author, which is:</p>
|
||
<pre><code>... a version of the program before it got formatted into the VIII,
|
||
augmented with comments showing where each state begins. N1 and N2 are
|
||
notes.</code></pre>
|
||
<p>but fixed to work with clang as well.</p>
|
||
<p>NOTE: the <code>N1</code> and <code>N2</code> are provided as notes
|
||
in the README.md file describing this code. Other code is also described
|
||
there.</p>
|
||
<p>Cody also added the <a href="/1993/vanb/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h1 id="section-10"><a name="1994"></a>1994</h1>
|
||
<h2 id="dodsond2-readme.md"><a name="1994_dodsond2"></a><a
|
||
href="/1994/dodsond2/dodsond2.c">1994/dodsond2</a> (<a
|
||
href="/1994/dodsond2/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed an infinite loop that could happen
|
||
when you shoot an arrow and end up having no arrows, thus making one
|
||
force quit the game. The problem was in a condition in the outer loop it
|
||
would repeatedly get input (if <code>getchar()</code> returned
|
||
<code>'\n'</code>), only if one has more than one arrow, returning after
|
||
that. But if there were 0 arrows left it did not return and so the loop
|
||
started over, doing nothing. This fix also seems to have fixed a problem
|
||
where if you shoot your last arrow it would not move you to the room you
|
||
shoot into (whereas if you had more arrows it would).</p>
|
||
<p>Cody added an alt version that allows one to cheat by specifying how
|
||
many arrows to start with (this was for fun but it turned out a good way
|
||
to debug the above infinite loop too which hanged the program).</p>
|
||
<p>As in some places it would properly say that you have ‘1 arrow’ or
|
||
else, if you have any other number of arrows (including 0), it would say
|
||
‘arrows’, Cody fixed a place where it always said ‘arrows’. A minor fix
|
||
and not that important.</p>
|
||
<p>Cody also fixed the problem where one could only get the arrows back
|
||
from the robber if the robber stole as many arrows as you ever found
|
||
rather than that minus how many you have shot. In other words if you had
|
||
three arrows and shot one and found no more you could never get the
|
||
arrows back from the robber because you could never lose all three since
|
||
you spent one. This bug manifested itself in another way too: once you
|
||
got the arrows back the counter was not reset so you could only get the
|
||
arrows back once even if the robber stole more. Now the counters are
|
||
reset. The way this bug was fixed is that there is now a counter for how
|
||
many you have found and how many you shot in addition to the two that
|
||
already existed, how many you had and how many were stolen.</p>
|
||
<h2 id="horton-readme.md"><a name="1994_horton"></a><a
|
||
href="/1994/horton/horton.c">1994/horton</a> (<a
|
||
href="/1994/horton/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to check that four args were
|
||
specified. With the use of the C pre-processor macro and inclusion of
|
||
<code>stdlib.h</code> in the Makefile the layout of the source is
|
||
exactly the same column width and no additional lines were added. This
|
||
was done during one of the times where this was changed to bug to fix
|
||
status, for better or worse.</p>
|
||
<p>Cody also fixed the Makefile which was causing alt code to be
|
||
compiled when it shouldn’t be.</p>
|
||
<p>Cody also added the scripts <a href="/1994/horton/try.sh">try.sh</a>
|
||
and <a href="/1994/horton/try.alt.sh">try.alt.sh</a>.</p>
|
||
<p>Finally he added the article (written by the entry’s author) cited in
|
||
the remarks: the full <a href="/1994/horton/login_sept92.pdf">USENIX
|
||
Association Newsletter ;login: September / October 1992 Vol. 17,
|
||
No. 5</a> and the pages cited as a shorter PDF file, <a
|
||
href="/1994/horton/login_sept92-pp28-31.pdf">login_sept92-pp28-31.pdf</a>.
|
||
The full newsletter was found on the Internet Wayback Machine and the
|
||
article was extracted as a PDF in the macOS <code>Preview.app</code>
|
||
(<code>File -> Print</code> feature).</p>
|
||
<h2 id="imc-readme.md-1"><a name="1994_imc"></a><a
|
||
href="/1994/imc/imc.c">1994/imc</a> (<a
|
||
href="/1994/imc/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/1994/imc/try.sh">try.sh</a> script.</p>
|
||
<p>Cody also added inclusion of <code>unistd.h</code> for
|
||
<code>getpid(2)</code>. While strictly speaking this was not necessary
|
||
(in multiple systems) it can sometimes be a problem and as it was
|
||
noticed it was changed (the only case this was done except in the
|
||
entries that actually did not work because of missing or incorrect
|
||
prototypes).</p>
|
||
<h2 id="ldb-readme.md"><a name="1994_ldb"></a><a
|
||
href="/1994/ldb/ldb.c">1994/ldb</a> (<a
|
||
href="/1994/ldb/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this so it would compile and work with
|
||
modern compilers. The problem was that <code>srand()</code> returns
|
||
<code>void</code> but it was used in a <code>||</code> expression. Thus
|
||
the comma operator was needed.</p>
|
||
<p>Cody also fixed it for clang under Linux which objected to
|
||
incompatible pointer type (because <code>time(2)</code> takes a
|
||
<code>time_t *</code> which in some systems is a <code>long *</code> but
|
||
what was being passed to it is an <code>int</code>).</p>
|
||
<p>Cody also changed the entry to use <code>fgets(3)</code> instead of
|
||
<code>gets(3)</code>. This one has a minor annoyance in that it now
|
||
prints a newline after the output but this seems like a worthy
|
||
compromise for preventing the interspersed output in macOS and at the
|
||
same time it’s safer and allows for parsing file with longer lines.
|
||
Fixing it it to not have the extra newline is more problematic than it’s
|
||
worth, in macOS another line of output would be shown without the change
|
||
anyway - unless <code>2>/dev/null</code> - and the difference is that
|
||
now it’s just a blank line rather than an annoying warning. A subtlety
|
||
about this fix: if a line is greater than 231 in length if the program
|
||
chooses that line it might print the first 231 characters or it might
|
||
print (up to) the next 231 characters and so on.</p>
|
||
<p>Cody also added the <a href="/1994/ldb/try.sh">try.sh</a> script.</p>
|
||
<h2 id="schnitzi-readme.md-1"><a name="1994_schnitzi"></a><a
|
||
href="/1994/schnitzi/schnitzi.c">1994/schnitzi</a> (<a
|
||
href="/1994/schnitzi/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added two alt versions, <a
|
||
href="/1994/schnitzi/schnitzi.alt.c">one which uses
|
||
<code>fgets()</code></a> but when fed its own source code cannot
|
||
generate code that compile and another <a
|
||
href="/1994/schnitzi/schnitzi.alt2.c">one with a bigger buffer size</a>
|
||
which, when fed its own source code, will generate compilable code but
|
||
not with the same buffer size but rather the original buffer size. Cody
|
||
explains this in the at <a href="/bugs.md#1994-schnitzi">1994/schnitzi
|
||
in bugs.md</a>.</p>
|
||
<p>The purpose for these versions it both demonstrate how the magic
|
||
works behind it and to help others, should they wish, get the code to
|
||
work with <code>fgets(3)</code>, with or without an increase in buffer
|
||
size. Note that without this feeding longer files, say the README.md
|
||
file, will crash the program. See <a
|
||
href="/bugs.md#1994-schnitzi">1994/schnitzi in bugs.md</a> where Cody
|
||
also explains the magic for more details. Later on, if nobody takes up
|
||
the task, Cody might resume it, but for now there is more important work
|
||
to do so that the next contest can run.</p>
|
||
<p>Cody also added the <a href="/1994/schnitzi/try.sh">try.sh</a> and <a
|
||
href="/1994/schnitzi/try.alt.sh">try.alt.sh</a> scripts.</p>
|
||
<h2 id="shapiro-readme.md-1"><a name="1994_shapiro"></a><a
|
||
href="/1994/shapiro/shapiro.c">1994/shapiro</a> (<a
|
||
href="/1994/shapiro/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed a bug on systems where
|
||
<code>EOF != -1</code>. The problem is that <code>getc()</code> and the
|
||
related functions do not return <code>-1</code> on EOF or error but
|
||
rather <code>EOF</code>. However <code>EOF</code> is not required to be
|
||
<code>-1</code> but merely an int < 0 and this program assumed that
|
||
<code>getc()</code> will return <code>-1</code> on EOF or error, not
|
||
<code>EOF</code>. On systems where <code>EOF != -1</code> it could
|
||
result in an infinite loop.</p>
|
||
<p>For an interesting problem that occurred here and what was done to
|
||
solve it, check the <a href="bugs.md">bugs.md</a> file.</p>
|
||
<h2 id="smr-readme.md"><a name="1994_smr"></a><a
|
||
href="/1994/smr/smr.c">1994/smr</a> (<a
|
||
href="/1994/smr/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/1994/smr/try.sh">try.sh</a> script.</p>
|
||
<h2 id="tvr-readme.md"><a name="1994_tvr"></a><a
|
||
href="/1994/tvr/tvr.c">1994/tvr</a> (<a
|
||
href="/1994/tvr/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the try scripts, four total, colour
|
||
and black and white pairs for the original entry and the alt code. These
|
||
scripts are <a href="/1994/tvr/try.color.sh">try.color.sh</a>, <a
|
||
href="/1994/tvr/try.bw.sh">try.bw.sh</a>, <a
|
||
href="/1994/tvr/try.alt.color.sh">try.alt.color.sh</a> and <a
|
||
href="/1994/tvr/try.alt.bw.sh">try.alt.bw.sh</a>, respectively. The
|
||
scripts go through each mode allowed with two sizes, 128 and 256,
|
||
allowing one to quit or skip each (given that there are a lot of
|
||
invocations this seemed like a good idea).</p>
|
||
<p>Cody also made this use <code>fgets(3)</code> instead of
|
||
<code>gets(3)</code>. In this case the newline had to be terminated but
|
||
it was a pretty straightforward fix. <code>gets()</code> was defined to
|
||
use <code>fgets()</code> and the inclusion of <code>stdio.h</code> had
|
||
to be added but to make it more like the original entry this was done in
|
||
the Makefile. The alt code was also changed to use
|
||
<code>fgets(3)</code>.</p>
|
||
<h2 id="weisberg-readme.md"><a name="1994_weisberg"></a><a
|
||
href="/1994/weisberg/weisberg.c">1994/weisberg</a> (<a
|
||
href="/1994/weisberg/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> changed the Makefile to make this program
|
||
more user friendly and easier to use with other tools as well by making
|
||
the program output not a space after each number but rather a
|
||
newline.</p>
|
||
<p>Cody also added the scripts <a
|
||
href="/1994/weisberg/try.sh">try.sh</a> and <a
|
||
href="/1994/weisberg/primes.sh">primes.sh</a>. The
|
||
<code>primes.sh</code> script is used by <code>try.sh</code> and if both
|
||
<code>primes(1)</code> and <code>rev(1)</code> are installed it will
|
||
reverse the lines of the <code>weisberg</code>, feeding it to
|
||
<code>primes(1)</code>, showing those that are primes. It only does the
|
||
reversed output because the program actually prints primes.</p>
|
||
<h2 id="westley-readme.md-6"><a name="1994_westley"></a><a
|
||
href="/1994/westley/westley.c">1994/westley</a> (<a
|
||
href="/1994/westley/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> converted the spoiler compiler options
|
||
(provided by the author) to be compiler commands and added a script <a
|
||
href="/1994/westley/try.sh">try.sh</a> to automate the spoiler commands
|
||
to make it easier to see the game in action from start to finish.</p>
|
||
<p>Cody also added the alternate version that will look fine on
|
||
terminals not set to 80 columns and the <a
|
||
href="/1994/westley/try.alt.sh">try.alt.sh</a> script to automate the
|
||
play along the lines of the <a href="/1994/westley/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h1 id="section-11"><a name="1995"></a>1995</h1>
|
||
<h2 id="cdua-readme.md"><a name="1995_cdua"></a><a
|
||
href="/1995/cdua/cdua.c">1995/cdua</a> (<a
|
||
href="/1995/cdua/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this so that it would work with macOS.
|
||
Once it could compile it additionally segfaulted under macOS which he
|
||
also fixed.</p>
|
||
<p>Cody also provided the <a href="/1995/cdua/cdua.alt.c">Alternate
|
||
code</a> for fun :-) ) (in particular to make it easier to see the
|
||
program do what it does in systems that are too fast … if there is such
|
||
a thing anyway :-) ). See the README.md for details on this.</p>
|
||
<p>Out of an abundance of caution with clang, Cody also added a second
|
||
arg to <code>main()</code> as some versions of clang whine about the
|
||
number of args on top of the type of args. In particular some versions
|
||
supposedly only allow 0, 2 or 3 args. It actually appears to allow 1 but
|
||
if you specify 4 it says 0, 2 or 3 and it is an error but it’s entirely
|
||
possible that they will eventually make the defect function as the error
|
||
message claims.</p>
|
||
<h2 id="dodsond1-readme.md"><a name="1995_dodsond1"></a><a
|
||
href="/1995/dodsond1/dodsond1.c">1995/dodsond1</a> (<a
|
||
href="/1995/dodsond1/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/1995/dodsond1/try.sh">try.sh</a> script that uses the text file
|
||
he provided which is input we suggested one try with the entry.</p>
|
||
<h2 id="esde-readme.md"><a name="1995_esde"></a><a
|
||
href="/1995/esde/esde.c">1995/esde</a> (<a
|
||
href="/1995/esde/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/1995/esde/try.sh">try.sh</a> script.</p>
|
||
<h2 id="garry-readme.md"><a name="1995_garry"></a><a
|
||
href="/1995/garry/garry.c">1995/garry</a> (<a
|
||
href="/1995/garry/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the alt code so that it will compile
|
||
with modern compilers. The problem was a missing <code>int</code> for
|
||
the <code>f</code> variable. He felt it was even more important that it
|
||
works because the layout does indeed look to him like a rat is dropping
|
||
core :-), something that the judges suggested.</p>
|
||
<p>Cody also renamed <code>garry.test.sh</code> to <a
|
||
href="/1995/garry/try.sh">try.sh</a> and improved it to to make sure the
|
||
program is compiled before trying to use it as well as adding a few
|
||
enhancements. For the alt version he also added the <a
|
||
href="/1995/garry/try.alt.sh">try.alt.sh</a> script to use the alt
|
||
version, though the alt version is not as important as alt code in other
|
||
entries. In order to get the paging to work right for the
|
||
<code>garry.data</code> file leading blank lines had to be added.</p>
|
||
<h2 id="heathbar-readme.md"><a name="1995_heathbar"></a><a
|
||
href="/1995/heathbar/heathbar.c">1995/heathbar</a> (<a
|
||
href="/1995/heathbar/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/1995/heathbar/try.sh">try.sh</a> script.</p>
|
||
<h2 id="leo-readme.md-1"><a name="1995_leo"></a><a
|
||
href="/1995/leo/leo.c">1995/leo</a> (<a
|
||
href="/1995/leo/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/1995/leo/try.sh">try.sh</a> script.</p>
|
||
<p>At our change in how to deal with spoilers, Cody also uudecoded the
|
||
spoiler provided by the author, putting it in <a
|
||
href="/1995/leo/spoiler1.md">spoiler1.md</a>.</p>
|
||
<h2 id="makarios-readme.md"><a name="1995_makarios"></a><a
|
||
href="/1995/makarios/makarios.c">1995/makarios</a> (<a
|
||
href="/1995/makarios/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this so that it will compile with
|
||
versions of clang that has a defect which only allows
|
||
<code>main()</code> to have 0, 2 or 3 args. This is done by a new
|
||
function (<code>pain()</code> as it’s annoying that clang is this way
|
||
:-) ) that <code>main()</code> calls which has the four args.</p>
|
||
<h2 id="savastio-readme.md"><a name="1995_savastio"></a><a
|
||
href="/1995/savastio/savastio.c">1995/savastio</a> (<a
|
||
href="/1995/savastio/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/1995/savastio/try.sh">try.sh</a> script.</p>
|
||
<h2 id="schnitzi-readme.md-2"><a name="1995_schnitzi"></a><a
|
||
href="/1995/schnitzi/schnitzi.c">1995/schnitzi</a> (<a
|
||
href="/1995/schnitzi/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/1995/schnitzi/try.sh">try.sh</a> script.</p>
|
||
<h2 id="vanschnitz-readme.md"><a name="1995_vanschnitz"></a><a
|
||
href="/1995/vanschnitz/vanschnitz.c">1995/vanschnitz</a> (<a
|
||
href="/1995/vanschnitz/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the authors’ <a
|
||
href="/1995/vanschnitz/vanschnitz.alt.c">spoiler as a C file</a> as in
|
||
2023 we have decided that in most cases all the code should be available
|
||
for the wider audience, without having to extract it. The exception is
|
||
when the files are created by the entry or the entry decrypts the text
|
||
or something like that.</p>
|
||
<p>Cody also added the <a href="/1995/vanschnitz/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h1 id="section-12"><a name="1996"></a>1996</h1>
|
||
<h2 id="august-readme.md-1"><a name="1996_august"></a><a
|
||
href="/1996/august/august.c">1996/august</a> (<a
|
||
href="/1996/august/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed a segfault in this program that
|
||
prevented it from working right and also fixed an infinite loop in the
|
||
try commands.</p>
|
||
<p>The problem with the infinite loop is that the file
|
||
<code>august.oc</code> had to have lines starting with <code>#</code>
|
||
removed and it was not being done. After this is done with say
|
||
<code>sed(1)</code> (like <code>sed -i'' '/^#/d' august.oc</code> which
|
||
has been added to both the remarks and the <code>try.sh</code> script
|
||
noted below) the code can proceed. This problem existed in macOS.</p>
|
||
<p>Cody also added the <a href="/1996/august/try.sh">try.sh</a> script
|
||
that runs all the commands that were given by the judges in the try
|
||
section, with the fix above applied.</p>
|
||
<h2 id="dalbec-readme.md"><a name="1996_dalbec"></a><a
|
||
href="/1996/dalbec/dalbec.c">1996/dalbec</a> (<a
|
||
href="/1996/dalbec/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> proposed a fix for this to compile with
|
||
clang and Landon implemented it after some discussion (though Cody
|
||
changed the function name). The reason Cody did not do it is because he
|
||
thought it was the wrong output but as it happens the try section below
|
||
was worded a bit confusingly. He looked at <a
|
||
href="#yusuke">Yusuke</a>‘s analysis found <a
|
||
href="https://mame-github-io.translate.goog/ioccc-ja-spoilers/1996/dalbec.html?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp">here</a>
|
||
but he missed that Yusuke added a’…’ after the result which made him
|
||
think the fix was wrong.</p>
|
||
<p>Cody also made the recommended change of the author to make it so
|
||
that each number is printed on a line by itself rather than having a
|
||
long string of numbers on the same line. This was not put in an
|
||
alternate version but perhaps it should be.</p>
|
||
<p>Cody also added the <a href="/1996/dalbec/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="eldby-readme.md"><a name="1996_eldby"></a><a
|
||
href="/1996/eldby/eldby.c">1996/eldby</a> (<a
|
||
href="/1996/eldby/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> provided an <a
|
||
href="/1996/eldby/eldby.alt.c">alternate version</a> which uses
|
||
<code>usleep()</code> in between writing the output to make it easier to
|
||
see what is going on with faster systems and importantly also for those
|
||
who are sensitive to text flashing by rapidly (it affects him too but he
|
||
also thinks it moves too fast nowadays anyway). We recommend that you
|
||
try the alternate version first due to these reasons.</p>
|
||
<h2 id="gandalf-readme.md"><a name="1996_gandalf"></a><a
|
||
href="/1996/gandalf/gandalf.c">1996/gandalf</a> (<a
|
||
href="/1996/gandalf/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to compile and work with modern
|
||
systems. As he loved the references in the code that could not compile
|
||
he just commented out as little as possible to get this to compile.</p>
|
||
<p>Cody also added the rather useful <a
|
||
href="/1996/gandalf/try.sh">try.sh</a> script to really demonstrate the
|
||
different ways of running the program ends up showing either different
|
||
output or the same output that we briefly pointed out.</p>
|
||
<p>BTW: it is perilous to try the patience of <a
|
||
href="https://www.glyphweb.com/arda/g/gandalf.html">Gandalf</a>. Go
|
||
ahead, try it! :-)</p>
|
||
<h2 id="huffman-readme.md"><a name="1996_huffman"></a><a
|
||
href="/1996/huffman/huffman.c">1996/huffman</a> (<a
|
||
href="/1996/huffman/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/1996/huffman/try.sh">try.sh</a> script.</p>
|
||
<h2 id="jonth-readme.md-1"><a name="1996_jonth"></a><a
|
||
href="/1996/jonth/jonth.c">1996/jonth</a> (<a
|
||
href="/1996/jonth/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to not segfault under macOS. The
|
||
problem was that the function pointer <code>w</code>, which points to
|
||
<code>XCreateWindow()</code>, did not specify the parameters of the
|
||
function in the pointer assignment.</p>
|
||
<p>NOTE: if there is no X server running this program will still
|
||
crash.</p>
|
||
<h2 id="rcm-readme.md"><a name="1996_rcm"></a><a
|
||
href="/1996/rcm/rcm.c">1996/rcm</a> (<a
|
||
href="/1996/rcm/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/1996/rcm/try.sh">try.sh</a> script.</p>
|
||
<h2 id="schweikh1-readme.md"><a name="1996_schweikh1"></a><a
|
||
href="/1996/schweikh1/schweikh1.c">1996/schweikh1</a> (<a
|
||
href="/1996/schweikh1/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/1996/schweikh1/try.sh">try.sh</a> script.</p>
|
||
<p>The author stated that <code>-I/usr/include</code> is needed by gcc
|
||
in Solaris because <code>errno.h</code> has two identical extern
|
||
declarations of <code>errno</code>. That leads to an error due to the
|
||
redefinition of <code>main</code> but the <code>-I</code> option makes
|
||
sure the working <code>/usr/include/rrno.h</code> is found first, which
|
||
shouldn’t cause any problems on other systems (the other file is
|
||
<code>gcc-lib/sparc-sun-solaris2.5/2.7.2/include/errno.h</code>). Thus
|
||
Cody also added this to the Makefile despite the fact that very few
|
||
probably use Solaris nowadays.</p>
|
||
<h2 id="schweikh2-readme.md"><a name="1996_schweikh2"></a><a
|
||
href="/1996/schweikh2/schweikh2.c">1996/schweikh2</a> (<a
|
||
href="/1996/schweikh2/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/1996/schweikh2/try.sh">try.sh</a> script with a few commands to
|
||
try along with a shorter version of something the author suggested one
|
||
try (it is suggested that one try the longer version too but it will run
|
||
in an infinite loop so having it in a script is less desired).</p>
|
||
<h2 id="schweikh3-readme.md"><a name="1996_schweikh3"></a><a
|
||
href="/1996/schweikh3/schweikh3.c">1996/schweikh3</a> (<a
|
||
href="/1996/schweikh3/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> updated the Makefile so that if it fails to
|
||
compile it will try he method suggested for SunOS rather than having to
|
||
update the Makefile manually or running a more complicated command: now
|
||
one can just run <code>make</code>.</p>
|
||
<h2 id="westley-readme.md-7"><a name="1996_westley"></a><a
|
||
href="/1996/westley/westley.c">1996/westley</a> (<a
|
||
href="/1996/westley/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed a segfault in this entry as well as it
|
||
displaying environmental variables. Although the scripts showed correct
|
||
output, it somewhat lessened the usability because they segfaulted and
|
||
showed (an) environmental variable, interspersed with the output of the
|
||
program. With the fix they no longer have this problem. If
|
||
<code>argc < 5</code> (<code>argv[4]</code> is referenced) it will
|
||
not do anything and it will not segfault either - this was caused by the
|
||
body of the for() loop which is now empty (it doesn’t appear to be
|
||
needed at all at least modernly). Note that you should check the <a
|
||
href="/1996/westley/westley.alt.c">westley.alt.c</a> file when reading
|
||
the author’s comments. To see how to use the original, see the README.md
|
||
file.</p>
|
||
<p>Cody also added the two scripts, <a
|
||
href="/1996/westley/try.sh">try.sh</a> and <a
|
||
href="/1996/westley/try.alt.sh">try.alt.sh</a> to automate showing the
|
||
different clocks, both with the fixed version and the original (alt)
|
||
version.</p>
|
||
<p>Also, to fix any potential problem with displaying in GitHub the
|
||
scripts provided by the author, Cody added ‘.sh’ to the
|
||
<code>clock[1-3].sh</code> scripts.</p>
|
||
<h1 id="section-13"><a name="1998"></a>1998</h1>
|
||
<h2 id="banks-readme.md"><a name="1998_banks"></a><a
|
||
href="/1998/banks/banks.c">1998/banks</a> (<a
|
||
href="/1998/banks/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> improved the Makefile to allow for easier
|
||
redefining the control keys and time step that the author set up.</p>
|
||
<p>Cody also set up the Makefile to have an alt build (using the same
|
||
code) for those who do not have a page up or page down key and added the
|
||
<a href="/1998/banks/keysym.h">keysym.h</a> header file as a reference
|
||
for other keys one can use if they wish to modify the controls. One can
|
||
certainly do this even if they do have page up and page down but this
|
||
gives a default for those who don’t have them like with Macs. The alt
|
||
build hard codes the page up and page down alternatives because not
|
||
doing so would overly complicate both builds and since you can configure
|
||
them all in both builds it shouldn’t matter.</p>
|
||
<h2 id="bas1-readme.md"><a name="1998_bas1"></a><a
|
||
href="/1998/bas1/bas1.c">1998/bas1</a> (<a
|
||
href="/1998/bas1/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a>, out of an abundance of caution, added a
|
||
second arg to <code>main()</code> as some versions of clang whine about
|
||
the number of args on top of what type they are In particular some
|
||
versions claim that they only allow 0, 2 or 3 args. It appears that they
|
||
do allow 1 but for instance 4 is not allowed. However as it’s quite
|
||
possible they will ‘fix’ this defect it would be better to have this not
|
||
be a problem at such a time.</p>
|
||
<p>Cody also added the <a href="/1998/bas1/bas1.sh">bas1.sh</a> script
|
||
to simplify running the program.</p>
|
||
<h2 id="bas2-readme.md"><a name="1998_bas2"></a><a
|
||
href="/1998/bas2/bas2.c">1998/bas2</a> (<a
|
||
href="/1998/bas2/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/1998/bas2/try.sh">try.sh</a> script which runs some default
|
||
actions as well as allowing one to pass in different file names or
|
||
strings.</p>
|
||
<h2 id="chaos-readme.md"><a name="1998_chaos"></a><a
|
||
href="/1998/chaos/chaos.c">1998/chaos</a> (<a
|
||
href="/1998/chaos/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added a call to <code>endwin()</code> to
|
||
restore terminal sanity (echo etc.) when exiting the program (in both
|
||
versions).</p>
|
||
<p>Cody also added the <a href="/1998/chaos/try.sh">try.sh</a> script
|
||
that runs the program on all the data files, giving instructions on how
|
||
to rotate and zoom in and out, prior to each run.</p>
|
||
<h2 id="df-readme.md"><a name="1998_df"></a><a
|
||
href="/1998/df/df.c">1998/df</a> (<a
|
||
href="/1998/df/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> changed a <code>int *</code> used for
|
||
<code>fopen(3)</code> to be a <code>FILE *</code> to be more correct and
|
||
prevent any possible problems in some systems (which has happened).</p>
|
||
<p>Cody also made the fixed version to look more like the original
|
||
version by using the old style of <code>main()</code> args so that it
|
||
reads <code>i,love_unix</code> more naturally, and by changing the
|
||
<code>typedef int lint</code> to be <code>typedef int _int</code>. See
|
||
the code for why this has to be done this way.</p>
|
||
<p>Cody also added the <a href="/1998/df/try.sh">try.sh</a> script which
|
||
runs the program in a loop until one hits <code>q</code> (or
|
||
<code>Q</code>) or sends intr/ctrl-c. He also proposed there’s a way to
|
||
cheat very easily. Can you figure out how?</p>
|
||
<h2 id="dlowe-readme.md"><a name="1998_dlowe"></a><a
|
||
href="/1998/dlowe/dlowe.c">1998/dlowe</a> (<a
|
||
href="/1998/dlowe/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> made the program more portable by changing
|
||
the void return type of <code>main()</code> to be <code>int</code> (in
|
||
both versions).</p>
|
||
<p>Cody added the scripts <a href="/1998/dlowe/try.sh">try.sh</a>, <a
|
||
href="/1998/dlowe/try.alt.sh">try.alt.sh</a>, <a
|
||
href="/1998/dlowe/pootify.sh">pootify.sh</a> and <a
|
||
href="/1998/dlowe/pootify.cgi.sh">pootify.cgi.sh</a> for a fun example
|
||
use of the program, a local pootifier of web pages and a CGI pootifier.
|
||
See <a href="/1998/dlowe/README.md#historical-remarks">historical
|
||
remarks</a> for more details on the pootify scripts.</p>
|
||
<h2 id="dloweneil-readme.md"><a name="1998_dloweneil"></a><a
|
||
href="/1998/dloweneil/dloweneil.c">1998/dloweneil</a> (<a
|
||
href="/1998/dloweneil/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added <a
|
||
href="/1998/dloweneil/dloweneil.alt.c">alt code</a> which has vi(m)
|
||
movement (in addition to the other keys except for dropping it’s not
|
||
<code>d</code> but <code>j</code> or space) keys as well as allowing one
|
||
to quit the game.</p>
|
||
<h2 id="dorssel-readme.md"><a name="1998_dorssel"></a><a
|
||
href="/1998/dorssel/dorssel.c">1998/dorssel</a> (<a
|
||
href="/1998/dorssel/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/1998/dorssel/try.sh">try.sh</a> script.</p>
|
||
<h2 id="fanf-readme.md"><a name="1998_fanf"></a><a
|
||
href="/1998/fanf/fanf.c">1998/fanf</a> (<a
|
||
href="/1998/fanf/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to compile. The problem was the
|
||
intermediate steps to get to the final code that is compiled. The code
|
||
is now what it essentially becomes when processed completely. The
|
||
intermediate steps can now be performed to see how it expands but it can
|
||
still compile and be used.</p>
|
||
<p>Cody also added a second arg to <code>main()</code> out of an
|
||
abundance of caution as some versions of clang whine about the number of
|
||
args to <code>main()</code>. These versions claim that only 0, 2 or 3
|
||
are allowed but it does allow 1 anyway. It is quite possible though that
|
||
this will change so it is fixed in case this happens. As it is mostly
|
||
just through the C pre-processor Cody added a new macro to make the code
|
||
look like the original with just an extra arg.</p>
|
||
<p>In some versions of clang <code>-Wno-int-conversion</code> had to be
|
||
added to the <code>CSILENCE</code> variable of the Makefile.</p>
|
||
<p>Cody also added the <a href="/1998/fanf/try.sh">try.sh</a> script to
|
||
show the output of some of the expressions that we selected.</p>
|
||
<h2 id="schnitzi-readme.md-3"><a name="1998_schnitzi"></a><a
|
||
href="/1998/schnitzi/schnitzi.c">1998/schnitzi</a> (<a
|
||
href="/1998/schnitzi/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed invalid data types which prevented
|
||
this entry from working, causing a segfault. This showed itself in two
|
||
parts which required two fixes, one for Linux and further changes for
|
||
macOS. He also fixed a segfault (after printing garbage) when the arg
|
||
specified evaluated to 0. It was decided by us, the judges, that these
|
||
segfault fixes should be made because the program is so beautiful.</p>
|
||
<p>Later on Cody improved the fixes by checking that the arg is a number
|
||
<code>>0 && <27</code> as that was noted by the author as
|
||
a requirement and again since it’s such a beautiful program it is worth
|
||
it, especially as the larger the number the larger the resulting program
|
||
becomes. It can be gigabytes in length if it doesn’t crash. At this
|
||
point since the author stated it has no <code>while</code>,
|
||
<code>do...while</code>, <code>for</code>, <code>if/else</code>,
|
||
<code>switch</code>, <code>?:</code> Cody removed the if statement by
|
||
doing:</p>
|
||
<div class="sourceCode" id="cb48"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb48-1"><a href="#cb48-1" aria-hidden="true" tabindex="-1"></a><span class="op">((</span>V<span class="op">[</span><span class="dv">1</span><span class="op">]&&((</span>atoi<span class="op">(</span>V<span class="op">[</span><span class="dv">1</span><span class="op">])></span><span class="dv">0</span><span class="op">&&</span>atoi<span class="op">(</span>V<span class="op">[</span><span class="dv">1</span><span class="op">])<</span><span class="dv">27</span><span class="op">))||(</span>exit<span class="op">(</span><span class="dv">1</span><span class="op">),</span><span class="dv">1</span><span class="op">)));</span></span></code></pre></div>
|
||
<p>Cody also added the <a href="/1998/schnitzi/try.sh">try.sh</a> script
|
||
to help users try the commands that we recommended as well as some added
|
||
by him.</p>
|
||
<h2 id="schweikh1-readme.md-1"><a name="1998_schweikh1"></a><a
|
||
href="/1998/schweikh1/schweikh1.c">1998/schweikh1</a> (<a
|
||
href="/1998/schweikh1/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this for modern systems (it did not
|
||
work at all) and added an alternate version that works with macOS. Cody
|
||
also made it ever so slightly more portable by removing the hard-coding
|
||
of <code>gcc</code>, instead hard-coding it <code>cc</code>. Doing this
|
||
not only lets it work with systems without <code>gcc</code> (though in
|
||
macOS it does exist but is actually <code>clang</code>) as
|
||
<code>cc</code> always should. Getting this entry to work was quite
|
||
complicated but is also very interesting.</p>
|
||
<p>To see how the macOS fixes works, see the <a
|
||
href="/1998/schweikh1/macos.md">macos.md</a> file but do note that this
|
||
includes spoilers for both versions! The fixes to get it to work at all
|
||
are described next.</p>
|
||
<p>So what was wrong with the original?</p>
|
||
<p>The call to <code>freopen(3)</code> was incorrect with the second arg
|
||
(the mode) being <code>5+__FILE__</code>; it is now <code>"r"</code>.
|
||
(Observe that the mode to the <code>fopen(3)</code> call is:
|
||
<code>43+__FILE__</code>. This might seem incorrect and indeed it can be
|
||
changed to <code>"r"</code> as well but this was not actually necessary
|
||
so once this was noticed it was changed back to the original.)</p>
|
||
<p>Another important change is that the files are only closed if the
|
||
<code>FILE *H</code> is <code>!= NULL</code>. Without this check,
|
||
because it’s almost certain that some files will not exist, it would
|
||
dereference a NULL pointer and very likely crash or halt and catch fire
|
||
:-), preventing the entry from working. Notice how <code>H</code> is a
|
||
funny macro defined as:</p>
|
||
<div class="sourceCode" id="cb49"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb49-1"><a href="#cb49-1" aria-hidden="true" tabindex="-1"></a><span class="pp">%:define H</span><span class="op">(</span><span class="pp">x</span><span class="op">)</span><span class="pp"> </span><span class="op"><</span><span class="pp">st</span><span class="op">%:%:</span><span class="pp">x</span><span class="op">##.</span><span class="pp">h</span><span class="op">></span></span></code></pre></div>
|
||
<p>and yet the <code>FILE *</code> can be called <code>H</code>! This
|
||
might or might not make sense to you but if it doesn’t can you figure
|
||
out why?</p>
|
||
<p>Another fix is that previously the program would
|
||
<code>return 1</code> if a file failed to open but for the same reason
|
||
as above, it being very likely some files will not exist, the return was
|
||
removed so that if the statement of the <code>if</code> is true the
|
||
<code>while</code> loop run, rather than having the loop by itself. It
|
||
was done this way to make it as close to the original as possible and to
|
||
maintain the obfuscation as close as possible as well.</p>
|
||
<p>Also crucial, and the final fixes to make it work, is that the arrays
|
||
<code>K</code> and <code>L</code> had to be increased in size. They were
|
||
originally (somewhat bewildering at first glance) defined as
|
||
<code>K[X(*)], L[X(<<)]</code> but they were changed to
|
||
<code>K[(X(*))*4], L[4*X(<<)]</code> though it is no longer clear
|
||
just how necessary this might be.</p>
|
||
<p>As noted, a limitation of <code>gcc</code> existing was removed by
|
||
Cody to make it so that <code>gcc</code> is not required as
|
||
<code>cc</code> should exist in every system with a C compiler and as
|
||
the author stated: as long as the options <code>-E -dM</code> of the
|
||
compiler prints out the macros in the form of <code>gcc -dM</code> i.e.,
|
||
the lines are in the form <code>#define MACRO value</code> it will work,
|
||
assuming that compiler can run, of course.</p>
|
||
<p>Cody also added the perl script that the author provided that they
|
||
used to compute the character count in the code according to the contest
|
||
rules of 1998 in the file <a
|
||
href="/1998/schweikh1/charcount.pl">charcount.pl</a>.</p>
|
||
<h2 id="schweikh2-readme.md-1"><a name="1998_schweikh2"></a><a
|
||
href="/1998/schweikh2/schweikh2.c">1998/schweikh2</a> (<a
|
||
href="/1998/schweikh2/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the code to not trigger an internal
|
||
compiler error in gcc:</p>
|
||
<pre><code>:10:16: warning: type defaults to 'int' in declaration of 'zero' [-Wimplicit-int]
|
||
: In function 'main':
|
||
:12:1: warning: missing terminating " character
|
||
:12:19: internal compiler error: invalid built-in macro "__FILE__"</code></pre>
|
||
<p>The string <code>"01\015"</code> had to be changed to
|
||
<code>ONE(O(/1,1,2,6,0,6))</code>. For an interesting historical
|
||
explanation and further details and fun, see the <a
|
||
href="/1998/schweikh2/README.md#historical-remarks">historical
|
||
remarks</a> in the README.md.</p>
|
||
<p>Cody also added an <code>int</code> after <code>register</code> in
|
||
<code>main()</code> in case clang decides to have a problem with that in
|
||
the future which is not entirely out of the question.</p>
|
||
<p>Cody also added the <a href="/1998/schweikh2/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="schweikh3-readme.md-1"><a name="1998_schweikh3"></a><a
|
||
href="/1998/schweikh3/schweikh3.c">1998/schweikh3</a> (<a
|
||
href="/1998/schweikh3/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/1998/schweikh3/README.md#alternate-code">alternate code</a> which
|
||
allows one to reconfigure the size constant in the rare case that the
|
||
author wrote about occurs.</p>
|
||
<p>Cody made <code>main()</code> have two args out of an abundance of
|
||
caution as some versions of clang say that <code>main()</code> can only
|
||
have 0, 2 or 3 args. These versions accept 1 arg but it is entirely
|
||
possible that they fix this so this should prevent it from breaking if
|
||
that happens.</p>
|
||
<p>Cody added the <a href="/1998/schweikh3/try.sh">try.sh</a> script to
|
||
make it easier to try the commands that we suggested. One command was
|
||
not added, that of the to use command.</p>
|
||
<p>Cody also made the Makefile rule <code>all</code> symlink the entry
|
||
to <code>samefile</code> as that is the name of the program.</p>
|
||
<p>The author stated that:</p>
|
||
<pre><code>In the remote event that the input has more than `8192` files with
|
||
the same size (on systems where `sizeof (char *) == 4`, or `4096` when
|
||
`sizeof (char *) == 8`), increase the manifest constant 32767 on line
|
||
31.</code></pre>
|
||
<p>so Cody changed the constant to a macro in the Makefile called
|
||
<code>SZ</code> so one can more easily do this (though it indeed seems
|
||
highly unlikely). See the README.md for more details.</p>
|
||
<p>There actually is a web page for the tool and this was added to the
|
||
author information for the entry. It has not been added to any JSON
|
||
file.</p>
|
||
<h2 id="tomtorfs-readme.md"><a name="1998_tomtorfs"></a><a
|
||
href="/1998/tomtorfs/tomtorfs.c">1998/tomtorfs</a> (<a
|
||
href="/1998/tomtorfs/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the assumption that <code>EOF</code>
|
||
is <code>-1</code> (the author noted that it assumes it is
|
||
<code>-1</code> and it’s indeed a valid concern as the standard only
|
||
guarantees that it’s a value <code>< 0</code>) and that
|
||
<code>1</code> is a valid code to return failure (it seems unlikely that
|
||
it wouldn’t be but since the author suggested it it was changed to
|
||
<code>EXIT_FAILURE</code>). To make it so the lines end at the same
|
||
columns as the original the <code>EXIT_FAILURE</code> change was done by
|
||
redefining <code>exit(3)</code> to be
|
||
<code>exit(a) return EXIT_FAILURE</code> and <code>1</code> was passed
|
||
to it (<code>return</code> was used because the original program had
|
||
<code>return 1</code>).</p>
|
||
<p>Cody also added the <a href="/1998/tomtorfs/try.sh">try.sh</a> script
|
||
to try out a few commands that we recommended.</p>
|
||
<h1 id="section-14"><a name="2000"></a>2000</h1>
|
||
<h2 id="anderson-readme.md"><a name="2000_anderson"></a><a
|
||
href="/2000/anderson/anderson.c">2000/anderson</a> (<a
|
||
href="/2000/anderson/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> changed this entry to use
|
||
<code>fgets(3)</code> instead of <code>gets(3)</code>. This involved
|
||
changing the <code>K</code> arg to <code>gets(3)</code> to
|
||
<code>&K</code> in <code>fgets(3)</code>.</p>
|
||
<p>Cody also added the <a href="/2000/anderson/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="bmeyer-readme.md"><a name="2000_bmeyer"></a><a
|
||
href="/2000/bmeyer/bmeyer.c">2000/bmeyer</a> (<a
|
||
href="/2000/bmeyer/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2000/bmeyer/try.sh">try.sh</a> script with some improvements to
|
||
the commands we recommended like not assuming the number of columns one
|
||
has in their terminal.</p>
|
||
<h2 id="briddlebane-readme.md"><a name="2000_briddlebane"></a><a
|
||
href="/2000/briddlebane/briddlebane.c">2000/briddlebane</a> (<a
|
||
href="/2000/briddlebane/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to compile in systems that
|
||
require one to explicitly link in <code>libm</code>.</p>
|
||
<p>Cody also added the <a href="/2000/briddlebane/try.sh">try.sh</a>
|
||
script for those who are feeling a bit too confident, cocky or even
|
||
happy :-)</p>
|
||
<h2 id="dhyang-readme.md"><a name="2000_dhyang"></a><a
|
||
href="/2000/dhyang/dhyang.c">2000/dhyang</a> (<a
|
||
href="/2000/dhyang/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> made this more portable by changing the
|
||
<code>void main</code> to <code>int main</code>.</p>
|
||
<p>He also added the <a href="/2000/dhyang/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="dlowe-readme.md-1"><a name="2000_dlowe"></a><a
|
||
href="/2000/dlowe/dlowe.c">2000/dlowe</a> (<a
|
||
href="/2000/dlowe/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to compile with more recent perl
|
||
versions; the symbol that’s now <code>PL_na</code> was once
|
||
<code>na</code>. He notes that this entry crashes under macOS but it
|
||
works under Linux after this change.</p>
|
||
<p>Cody also added the <a href="/2000/dlowe/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="jarijyrki-readme.md"><a name="2000_jarijyrki"></a><a
|
||
href="/2000/jarijyrki/jarijyrki.c">2000/jarijyrki</a> (<a
|
||
href="/2000/jarijyrki/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> made it easier to compile this in some cases
|
||
by adding <code>X11/</code> to the includes of <code>Xlib.h</code> and
|
||
<code>keysym.h</code>.</p>
|
||
<h2 id="natori-readme.md"><a name="2000_natori"></a><a
|
||
href="/2000/natori/natori.c">2000/natori</a> (<a
|
||
href="/2000/natori/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this for modern compilers. Depending
|
||
on the compiler it would either segfault when run or not compile at all
|
||
(gcc and clang respectively).</p>
|
||
<p>Cody also provided alternate code that supports the southern
|
||
hemisphere.</p>
|
||
<p>Cody also provided the <a href="/2000/natori/try.sh">try.sh</a> and
|
||
<a href="/2000/natori/try.alt.sh">try.alt.sh</a> scripts that show the
|
||
Moon phase in artistic ways. It is recommended one try both a number of
|
||
times in a row on different days (that is run <code>./try.sh</code>
|
||
several times in a row a few days apart, until you see all the Moon
|
||
phases, and run <code>./try.alt.sh</code> a few times in a row a few
|
||
days apart, until you see all the Moon phases).</p>
|
||
<p>Later on Cody restored the <code>#include</code>s in the source code
|
||
which had been changed by us to make it a one-liner again but this was
|
||
an error as it was not a one-liner but rather a small program. At the
|
||
same point Cody made the code itself a one-line like the code is in the
|
||
original entry. Now it looks much more like the original entry but with
|
||
the two fixes.</p>
|
||
<p>Finally Cody fixed the Makefile that had the <code>-Wno-foo</code>
|
||
options in the <code>CDEFINE</code> variable which although works it is
|
||
incongruent with the other Makefiles and is more confusing (even if not
|
||
confusing).</p>
|
||
<h2 id="primenum-readme.md"><a name="2000_primenum"></a><a
|
||
href="/2000/primenum/primenum.c">2000/primenum</a> (<a
|
||
href="/2000/primenum/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> made this more portable by changing the
|
||
<code>void main</code> to <code>int main</code>.</p>
|
||
<p>Cody also added the <a href="/2000/primenum/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="rince-readme.md-2"><a name="2000_rince"></a><a
|
||
href="/2000/rince/rince.c">2000/rince</a> (<a
|
||
href="/2000/rince/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2000/rince/try.sh">try.sh</a> script.</p>
|
||
<h2 id="robison-readme.md-1"><a name="2000_robison"></a><a
|
||
href="/2000/robison/robison.c">2000/robison</a> (<a
|
||
href="/2000/robison/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed an infinite loop that occurred if
|
||
invalid input was entered, flooding the screen with:</p>
|
||
<pre><code>Black position and direction: illegal</code></pre>
|
||
<p>This was fixed by having the <code>scanf(3)</code> read in a string
|
||
and then use <code>atoi(3)</code> on it to assign to the
|
||
<code>int</code>s, much like with <code>1987/lievaart</code>. The
|
||
strings are <code>char[5]</code> and the <code>%</code> specifier is
|
||
<code>%4s</code> which is enough for the game.</p>
|
||
<h2 id="schneiderwent-readme.md"><a name="2000_schneiderwent"></a><a
|
||
href="/2000/schneiderwent/schneiderwent.c">2000/schneiderwent</a> (<a
|
||
href="/2000/schneiderwent/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2000/schneiderwent/try.sh">try.sh</a> script.</p>
|
||
<h2 id="thadgavin-readme.md"><a name="2000_thadgavin"></a><a
|
||
href="/2000/thadgavin/thadgavin.c">2000/thadgavin</a> (<a
|
||
href="/2000/thadgavin/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the code and added an appropriate make
|
||
rule so that the <a href="https://www.libsdl.org">SDL</a> version works
|
||
independent from the curses version (using the same code).</p>
|
||
<p>Cody also added alt code to allow one to slow down the code. This
|
||
code also, at least for the curses mode, allows one to quit at any time
|
||
by pressing ‘q’. See below for more details.</p>
|
||
<p>Due to a terrible design choice of the SDL1 developers something had
|
||
to be changed. As was noted in the log:</p>
|
||
<pre><code>The SDL version did not work for a number of reasons. First of all the
|
||
code requires that SDL is defined. Second the path[sic] wrong header file was
|
||
included. Third the SDL1 developers thought it would be a great idea
|
||
(but obviously it's a terrible idea) to redefine main() (!!) so that any
|
||
program that uses SDL1 has to have the same args as their definition.
|
||
This program had 'main()' so the error message was:
|
||
|
||
thadgavin.c:60:1: error: conflicting types for 'SDL_main'
|
||
main()
|
||
^
|
||
/opt/local/include/SDL/SDL_main.h:34:14: note: expanded from macro 'main'
|
||
#define main SDL_main
|
||
^
|
||
/opt/local/include/SDL/SDL_main.h:35:12: note: previous declaration is here
|
||
extern int SDL_main(int argc, char *argv[]);
|
||
^
|
||
1 warning and 1 error generated.
|
||
make: *** [thadgavin_sdl] Error 1
|
||
|
||
Thus main() was changed to 'int main(int argc, char **argv)'.</code></pre>
|
||
<p>Cody also added an alternate version to help see what is going on in
|
||
more modern systems and in case you’re sensitive to rapidly moving
|
||
swirling. See the README.md for details on that. Note that this
|
||
alternate version only will impact the curses and the SDL versions as
|
||
Cody does not have a DOS system to test the other version in.</p>
|
||
<h2 id="tomx-readme.md"><a name="2000_tomx"></a><a
|
||
href="/2000/tomx/tomx.c">2000/tomx</a> (<a
|
||
href="/2000/tomx/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2000/tomx/README.md#alternate-code">alt code</a> based on the
|
||
author’s remarks with a fix for modern systems and he also added the two
|
||
scripts, <a href="/2000/tomx/try.sh">try.sh</a> and <a
|
||
href="/2000/tomx/try.alt.sh">try.alt.sh</a> for the main code and the
|
||
alt code respectively.</p>
|
||
<p>And although the scripts do <code>chmod +x</code> on the source code
|
||
(see the README.md for details) the source code is now executable by
|
||
default.</p>
|
||
<h1 id="section-15"><a name="2001"></a>2001</h1>
|
||
<h2 id="anonymous-readme.md-1"><a name="2001_anonymous"></a><a
|
||
href="/2001/anonymous/anonymous.c">2001/anonymous</a> (<a
|
||
href="/2001/anonymous/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed both the supplementary program and the
|
||
program itself (both of which segfaulted and once that was fixed only
|
||
the binary was modified; it was not run but according to the author’s
|
||
remarks it should be executed). He managed to do this with Linux but it
|
||
will not work with any system that does not allow one to compile 32-bit
|
||
ELF binaries. See <a href="/bugs.md#2001anonymous-readmemd">bugs.md</a>
|
||
for why this is; <em>this is <strong>not</strong> a bug, it’s a
|
||
feature</em> inherent in what it does!</p>
|
||
<p>The following had to be done to fix this:</p>
|
||
<ul>
|
||
<li><code>#include <sys/mman.h></code> for <code>mmap()</code> and
|
||
<code>munmap()</code>.</li>
|
||
<li>have <code>main()</code> call another function which is no longer a
|
||
recursive function; this prevented <code>main()</code> from entering an
|
||
infinite recursive loop.</li>
|
||
</ul>
|
||
<p>Without these it would crash and prevent modification of the 32-bit
|
||
<a
|
||
href="https://en.wikipedia.org/wiki/Executable_and_Linkable_Format">ELF</a>
|
||
(not elf :-) ) binary. But again see <a href="/bugs.md">bugs.md</a>
|
||
here.</p>
|
||
<p>These also had to be done:</p>
|
||
<ul>
|
||
<li>when <code>open()</code>ing the file the file descriptor had to be
|
||
saved so it could be closed prior to executing the program. This is the
|
||
<code>f</code> variable which an <code>int</code>.</li>
|
||
<li><code>munmap()</code> also had to be called prior to executing the
|
||
program. This involved a new <code>off_t N</code> which was added in the
|
||
<code>mmap()</code> call which was then used in the
|
||
<code>munmap()</code> call.</li>
|
||
</ul>
|
||
<p>Without those changes the program was not executed after modification
|
||
which it was supposed to do; instead it reported text file busy
|
||
error.</p>
|
||
<p>Notice that the location of <code>munmap()</code> and
|
||
<code>close()</code> followed by <code>execv()</code> <em>does
|
||
matter</em>!</p>
|
||
<p>To get this to compile with clang, <code>main()</code> had to change
|
||
from:</p>
|
||
<div class="sourceCode" id="cb54"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb54-1"><a href="#cb54-1" aria-hidden="true" tabindex="-1"></a>main <span class="op">(</span><span class="dt">char</span> <span class="op">*</span>ck<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>k<span class="op">)</span></span></code></pre></div>
|
||
<p>to:</p>
|
||
<div class="sourceCode" id="cb55"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb55-1"><a href="#cb55-1" aria-hidden="true" tabindex="-1"></a>main <span class="op">(</span><span class="dt">int</span> cka<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>k<span class="op">)</span> <span class="op">{</span> <span class="dt">char</span> <span class="op">*</span>ck <span class="op">=</span> <span class="op">(</span><span class="dt">char</span> <span class="op">*)</span>cka<span class="op">;</span> <span class="co">/* ... */</span> <span class="op">}</span></span></code></pre></div>
|
||
<p>The following change was also made to be more portable, in case the
|
||
constants <code>PROT_READ</code> and/or <code>PROT_WRITE</code> are not
|
||
standardised or some platform does not follow it:</p>
|
||
<p>Change <code>3</code> in the call to <code>mmap()</code> to be
|
||
<code>PROT_READ|PROT_WRITE</code>: just in case
|
||
<code>PROT_READ|PROT_WRITE</code> does not equal 3 (though it seems to
|
||
be equal in both macOS and Linux).</p>
|
||
<p>NOTE: there might be educational value to see the progress of this
|
||
fix; if you wish to see, try the following commands from the
|
||
<code>2001/anonymous</code> directory:</p>
|
||
<div class="sourceCode" id="cb56"><pre
|
||
class="sourceCode sh"><code class="sourceCode bash"><span id="cb56-1"><a href="#cb56-1" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> diff d2a42f42e8f477f29e9d5ed09ce2bb349eaf7397..93aa8d79f208dcccc3c5a2370a727b5cf64e9c53 anonymous.c</span>
|
||
<span id="cb56-2"><a href="#cb56-2" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> diff 93aa8d79f208dcccc3c5a2370a727b5cf64e9c53..c48629017117379a52b1a512ef8f2593ca9569c8 anonymous.c</span>
|
||
<span id="cb56-3"><a href="#cb56-3" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> diff c48629017117379a52b1a512ef8f2593ca9569c8..efdee208a2bc650256637b9357ddfd0de82d2f41 anonymous.c</span>
|
||
<span id="cb56-4"><a href="#cb56-4" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> diff efdee208a2bc650256637b9357ddfd0de82d2f41..e9a3f77ea3b209e63ac3f9c06bb84ad86e5ea706 anonymous.c</span>
|
||
<span id="cb56-5"><a href="#cb56-5" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> diff d2a42f42e8f477f29e9d5ed09ce2bb349eaf7397..2159caec4677e0f25ad704a74e04c8196fd6c343 anonymous.c</span>
|
||
<span id="cb56-6"><a href="#cb56-6" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> diff 2159caec4677e0f25ad704a74e04c8196fd6c343..4bc03de321612869aebf855850c6500df95cb6ef anonymous.c</span></code></pre></div>
|
||
<p>Finally to see from start to finish:</p>
|
||
<div class="sourceCode" id="cb57"><pre
|
||
class="sourceCode sh"><code class="sourceCode bash"><span id="cb57-1"><a href="#cb57-1" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> diff d2a42f42e8f477f29e9d5ed09ce2bb349eaf7397..4bc03de321612869aebf855850c6500df95cb6ef anonymous.c</span></code></pre></div>
|
||
<p>or to not use <code>git</code>:</p>
|
||
<div class="sourceCode" id="cb58"><pre
|
||
class="sourceCode sh"><code class="sourceCode bash"><span id="cb58-1"><a href="#cb58-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> diff_orig_prog</span></code></pre></div>
|
||
<p>Cody also added a <a href="anonymous.bed.c">program</a> like <a
|
||
href="anonymous.ten.c">anonymous.ten.c</a> <a
|
||
href="https://en.wikipedia.org/wiki/Ten_Green_Bottles">Ten Green
|
||
Bottles</a> but which sings <a
|
||
href="https://allnurseryrhymes.com/ten-in-the-bed/">Ten in the Bed</a>
|
||
instead.</p>
|
||
<p>As well he added the <a href="/2001/anonymous/try.sh">try.sh</a> so
|
||
that one can attempt to use the program as it was designed but if
|
||
compiling as 32-bit fails it will at least run the supplementary program
|
||
as a 64-bit program directly.</p>
|
||
<h2 id="bellard-readme.md"><a name="2001_bellard"></a><a
|
||
href="/2001/bellard/bellard.c">2001/bellard</a> (<a
|
||
href="/2001/bellard/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to compile with clang but
|
||
according to the author this will not work without i386 Linux. It
|
||
generates i386 32-bit code (not bytecode) but unfortunately it will not
|
||
work without i386 Linux. See <a href="/bugs.md">bugs.md</a>.</p>
|
||
<p>Cody fixed an earlier segfault so that it can at least now open the
|
||
file should you have an i386 Linux machine (it can open it in other
|
||
platforms too, of course, but it won’t work). This involved pointer
|
||
updates and also changing an <code>int</code> to a <code>FILE *</code>.
|
||
Where possible he left the macros as the same but in the case of
|
||
<code>main()</code> this was not possible.</p>
|
||
<p><a href="#yusuke">Yusuke</a> added another change (see below) to make
|
||
it even more portable across compilers besides what Cody did.</p>
|
||
<p>Cody entirely fixed the <a
|
||
href="/2001/bellard/bellard.otccex.c">supplementary bellard.otccex.c</a>
|
||
so it does not segfault and works as well (it did not work at all). The
|
||
main problem was that some ints were being used as pointers. This
|
||
includes, for example, an int used as a <code>char *</code>, an int used
|
||
as a function pointer and an int to access <code>argv</code> as well as
|
||
there being invalid access to <code>argv</code>. He updated the Makefile
|
||
so that this program will compile by default.</p>
|
||
<p>Also the Fibonacci sequence (<code>fib()</code>) will overflow at
|
||
<code>n > 48</code> so this is checked prior to running the function
|
||
just like the author did for the factorial (overflowing at
|
||
<code>>12</code>). Either way unfortunately this entry seems to not
|
||
work in 64-bit Linux or macOS. See below portability notes as well as
|
||
another fix in this entry by Yusuke.</p>
|
||
<h2 id="portability-notes">Portability notes:</h2>
|
||
<p>With a tip from Yusuke we rediscovered the author’s <a
|
||
href="https://bellard.org/otcc/">web page for this program</a> where it
|
||
is stated that this will only work in i386 Linux. The author also stated
|
||
in the remarks in this document that they used <a
|
||
href="https://ftp.gnu.org/gnu/gcc/gcc-2.95.2/gcc-everything-2.95.2.tar.gz">gcc
|
||
2.95.2</a> but we don’t know if that’s relevant or not.</p>
|
||
<p>Yusuke offered a modification which is not needed with gcc but with
|
||
some versions of <code>clang</code> it is. With <code>gcc</code> we can
|
||
get away with <code>-rdynamic -fno-pie -Wl,-z,execstack</code> which
|
||
solves the problem of execution in memory but any compiler that does not
|
||
support this would not work. Thus we use the modification by Yusuke.</p>
|
||
<h2 id="cheong-readme.md"><a name="2001_cheong"></a><a
|
||
href="/2001/cheong/cheong.c">2001/cheong</a> (<a
|
||
href="/2001/cheong/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to work with clang by adding
|
||
another function that is allowed to have a third arg as an int, not a
|
||
<code>char **</code>. He chose <code>pain()</code> because it’s a four
|
||
letter word that would match the format and because it’s pain that clang
|
||
forces this. :-) This fix makes a point of the author’s notes on
|
||
portability no longer valid, BTW.</p>
|
||
<p>Cody also added the <a href="/2001/cheong/try.sh">try.sh</a>
|
||
script.</p>
|
||
<p>He also fixed it to check the number of args.</p>
|
||
<h2 id="coupard-readme.md"><a name="2001_coupard"></a><a
|
||
href="/2001/coupard/coupard.c">2001/coupard</a> (<a
|
||
href="/2001/coupard/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added a value to <code>return</code> in
|
||
<code>main()</code> to make it more portable.</p>
|
||
<p>Cody fixed this to compile with clang in Linux. The problem was C99
|
||
does not support implicit int:</p>
|
||
<div class="sourceCode" id="cb59"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb59-1"><a href="#cb59-1" aria-hidden="true" tabindex="-1"></a>coupard<span class="op">.</span>c<span class="op">:</span><span class="dv">31</span><span class="op">:</span><span class="dv">10</span><span class="op">:</span> error<span class="op">:</span> parameter <span class="ch">'h'</span> was not declared<span class="op">,</span> defaults to <span class="ch">'i</span><span class="er">nt</span><span class="ch">'</span><span class="op">;</span> ISO C99 and later <span class="cf">do</span> not support implicit <span class="dt">int</span> <span class="op">[-</span>Wimplicit<span class="op">-</span><span class="dt">int</span><span class="op">]</span></span>
|
||
<span id="cb59-2"><a href="#cb59-2" aria-hidden="true" tabindex="-1"></a><span class="dt">void</span> e<span class="op">(</span>n<span class="op">,</span>h<span class="op">){</span></span>
|
||
<span id="cb59-3"><a href="#cb59-3" aria-hidden="true" tabindex="-1"></a> <span class="op">^</span></span>
|
||
<span id="cb59-4"><a href="#cb59-4" aria-hidden="true" tabindex="-1"></a>coupard<span class="op">.</span>c<span class="op">:</span><span class="dv">31</span><span class="op">:</span><span class="dv">8</span><span class="op">:</span> error<span class="op">:</span> parameter <span class="ch">'n'</span> was not declared<span class="op">,</span> defaults to <span class="ch">'i</span><span class="er">nt</span><span class="ch">'</span><span class="op">;</span> ISO C99 and later <span class="cf">do</span> not support implicit <span class="dt">int</span> <span class="op">[-</span>Wimplicit<span class="op">-</span><span class="dt">int</span><span class="op">]</span></span>
|
||
<span id="cb59-5"><a href="#cb59-5" aria-hidden="true" tabindex="-1"></a><span class="dt">void</span> e<span class="op">(</span>n<span class="op">,</span>h<span class="op">){</span></span>
|
||
<span id="cb59-6"><a href="#cb59-6" aria-hidden="true" tabindex="-1"></a> <span class="op">^</span></span></code></pre></div>
|
||
<p>and for some reason it was being reported as an error. This was not
|
||
really worth a thanks per se but it was originally done by adding
|
||
<code>int</code>. The better solution is to disable the warning which is
|
||
what was done later on to make it more like the original.</p>
|
||
<p><a href="#yusuke">Yusuke</a> provided a proper command line for those
|
||
without <code>/dev/audio</code> or <code>/dev/sound/dsp</code> (which is
|
||
most everyone nowadays, it seems, and especially those with macOS) (to
|
||
do with sound; see his <a
|
||
href="/2013/endoh3/README.md">/2013/endoh3/README.md</a> entry where he
|
||
also refers to sound devices in macOS).</p>
|
||
<p>Cody added the <a href="/2001/coupard/try.sh">try.sh</a>.</p>
|
||
<h2 id="ctk-readme.md"><a name="2001_ctk"></a><a
|
||
href="/2001/ctk/ctk.c">2001/ctk</a> (<a
|
||
href="/2001/ctk/README.md%5D">README.md</a>)</h2>
|
||
<p>The ANSI escape codes were no longer valid but <a
|
||
href="#yusuke">Yusuke</a> provided a patch to fix the ANSI escape codes.
|
||
This works with both Linux and macOS.</p>
|
||
<p><a href="#cody">Cody</a> fixed this so that it should always restore
|
||
terminal sanity (echo enabled etc.) after exiting even if you don’t
|
||
press ‘q’, if you crash or if you kill the program prematurely. This was
|
||
done by adding an explicit call to <code>e()</code> at the end of
|
||
<code>main()</code>.</p>
|
||
<p>Cody also added the <a href="/2001/ctk/README.md#alternate-code">alt
|
||
code</a> that adds vi(m) movement keys.</p>
|
||
<h2 id="dgbeards-readme.md"><a name="2001_dgbeards"></a><a
|
||
href="/2001/dgbeards/dgbeards.c">2001/dgbeards</a> (<a
|
||
href="/2001/dgbeards/README.md%5D">README.md</a>)</h2>
|
||
<p>The author provided two changes: one to speed it up and one to make
|
||
it not crash on losing. <a href="#cody">Cody</a> provided an alternate
|
||
version which does the former but he felt that the idea of crashing on
|
||
losing (see the README.md for details on why that might be) too good to
|
||
get rid of so he kept that in.</p>
|
||
<p>He also points out that there is a way to get the computer to
|
||
automatically lose very quickly. Do you know what it is?</p>
|
||
<h2 id="herrmann1-readme.md"><a name="2001_herrmann1"></a><a
|
||
href="/2001/herrmann1/herrmann1.c">2001/herrmann1</a> (<a
|
||
href="/2001/herrmann1/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this so that the when compiling the
|
||
code the program is not executed itself by itself which just showed the
|
||
usage string and exited. The <a
|
||
href="/2001/herrmann1/herrmann1.sh">script herrmann1.sh</a> is used to
|
||
compile the program but it’s also how you invoke the program.</p>
|
||
<p>Cody provided the file <a
|
||
href="/2001/herrmann1/plus1.turing">plus1.turing</a> based on the
|
||
author’s remarks.</p>
|
||
<p>He also fixed the <a href="/2001/herrmann1/herrmann1.sh">script
|
||
herrmann1.sh</a> for shellcheck. In particular there were quite a
|
||
few:</p>
|
||
<pre><code>SC2086 (info): Double quote to prevent globbing and word splitting.
|
||
SC2248 (style): Prefer double quoting even when variables don't contain special characters.</code></pre>
|
||
<p>errors/warnings.</p>
|
||
<p>Cody also added the <a href="/2001/herrmann1/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="herrmann2-readme.md"><a name="2001_herrmann2"></a><a
|
||
href="/2001/herrmann2/herrmann2.c">2001/herrmann2</a> (<a
|
||
href="/2001/herrmann2/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to work with both 64-bit and
|
||
32-bit compilers by changing most of the <code>int</code>s (all but that
|
||
in <code>main(int ...)</code>) to <code>long</code>s. He also fixed it
|
||
to compile with clang by changing the args of main to be
|
||
<code>int</code> and <code>char **</code>, respectively, and changing
|
||
specific references to the <code>argv</code> arg, casting to
|
||
<code>long</code> (was <code>int</code> but the 64-bit fix requires
|
||
<code>long</code>) which was its old type.</p>
|
||
<p>Cody also added the <a href="/2001/herrmann2/try.sh">try.sh</a>
|
||
script which might be more useful than any other place as the command to
|
||
try is quite long with C code.</p>
|
||
<p>For some reason the original code was missing (presumingly because it
|
||
had been added to <code>.gitignore</code> by accident) but Cody restored
|
||
it from the archive.</p>
|
||
<h2 id="kev-readme.md"><a name="2001_kev"></a><a
|
||
href="/2001/kev/kev.c">2001/kev</a> (<a
|
||
href="/2001/kev/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> improved the Makefile to allow one to more
|
||
easily set up the port, speed and <code>socket(2)</code> call that the
|
||
author had set up.</p>
|
||
<p>Cody also slowed down the ball just a tad (it was already a
|
||
<code>-D</code> macro that was used in the code) as it went too fast for
|
||
the speed at which the paddles move even when holding down the movement
|
||
keys (but see below).</p>
|
||
<p>Cody also provided an <a href="/2001/kev/kev.alt.c">alternate
|
||
version</a> which lets you use the arrow keys on your keyboard instead
|
||
of the more awkward ‘<code>,</code>’ and ‘<code>.</code>’.</p>
|
||
<p>He updated both versions to have <code>#ifndef..#endif</code> pairs
|
||
for the macros so one can more easily configure different settings
|
||
without having to specify all of them (though this change became
|
||
unnecessary with an improvement on how it was done). The speed,
|
||
<code>SPEED</code>, will be set to 50 if it’s not defined at the
|
||
compiler line as 50 is what it used to be set to. This way it’s more to
|
||
the original but without having to sacrifice playability by running
|
||
<code>make</code>.</p>
|
||
<h2 id="ollinger-readme.md"><a name="2001_ollinger"></a><a
|
||
href="/2001/ollinger/ollinger.c">2001/ollinger</a> (<a
|
||
href="/2001/ollinger/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2001/ollinger/try.sh">try.sh</a> script.</p>
|
||
<p>Cody also fixed it to not crash if not enough args, exiting 1
|
||
instead. This was done at a time where it was said to be a bug that
|
||
should be fixed, for better or worse.</p>
|
||
<h2 id="schweikh-readme.md"><a name="2001_schweikh"></a><a
|
||
href="/2001/schweikh/schweikh.c">2001/schweikh</a> (<a
|
||
href="/2001/schweikh/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to not crash if not enough args
|
||
as this was not documented by the author. The other problems are
|
||
documented so were not fixed. See README.md for details.</p>
|
||
<p>Cody also added the <a href="/2001/schweikh/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="westley-readme.md-8"><a name="2001_westley"></a><a
|
||
href="/2001/westley/westley.c">2001/westley</a> (<a
|
||
href="/2001/westley/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the script <a
|
||
href="2001/westley/try.sh">try.sh</a> to automate a heap of commands
|
||
that we, the IOCCC judges, suggested, as well as some additional ones
|
||
that he thought would be fun. He also provided the sort and punch card
|
||
versions, described in the README.md, based on the author’s remarks.</p>
|
||
<h1 id="section-16"><a name="2004"></a>2004</h1>
|
||
<h2 id="anonymous-readme.md-2"><a name="2004_anonymous"></a><a
|
||
href="/2004/anonymous/anonymous.c">2004/anonymous</a> (<a
|
||
href="/2004/anonymous/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2004/anonymous/try.sh">try.sh</a> script.</p>
|
||
<h2 id="arachnid-readme.md"><a name="2004_arachnid"></a><a
|
||
href="/2004/arachnid/arachnid.c">2004/arachnid</a> (<a
|
||
href="/2004/arachnid/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added an <a
|
||
href="/2004/arachnid/README.md#alternate-code">alternate version</a>
|
||
which allows those like himself used to <code>h</code>, <code>j</code>,
|
||
<code>k</code> and <code>l</code> movement keys to not get lost. Non
|
||
rogue players, vi users and Dvorak typists are invited to get lost (or
|
||
use the original version)! :-)</p>
|
||
<p>Cody also renamed the <code>arachnid.info</code> file to <a
|
||
href="/2004/arachnid/arachnid.txt">arachnid.txt</a> as it’s not really
|
||
an informative file but a maze file. The extension <code>.maz</code> was
|
||
not chosen to help with (some?) browsers knowing what to do with it.</p>
|
||
<h2 id="burley-readme.md"><a name="2004_burley"></a><a
|
||
href="/2004/burley/burley.c">2004/burley</a> (<a
|
||
href="/2004/burley/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to compile with clang and also
|
||
fixed it to work.</p>
|
||
<p>For clang the problem was that <code>main()</code> had one arg, a
|
||
<code>char *</code> and this is not allowed in any version of clang. In
|
||
some versions it is allowed if the arg is an <code>int</code> but never
|
||
if it’s anything else. To get it to work took numerous changes.</p>
|
||
<p>First the inclusion of <code>setjmp.h</code> was necessary. Without
|
||
this <code>longjmp(3)</code> implicitly returned <code>int</code> which
|
||
was used for the purpose of binary expression but this no longer
|
||
worked.</p>
|
||
<p>But by including <code>setjmp.h</code> it naturally made the binary
|
||
expressions invalid (as it returns <code>void</code> which is not
|
||
allowed in binary expressions) so the comma operator with <code>0</code>
|
||
(<code>,0</code>) had to be used (<code>,1</code> was tried first but
|
||
this did not work right).</p>
|
||
<p><code>longjmp(3)</code> was being called with one arg which was an
|
||
element of an <code>int[4][1000]</code> which had to be changed to a
|
||
<code>jmp_buf p[4]</code> (this due to the prototype being
|
||
included).</p>
|
||
<p><code>main()</code> also called itself but this was a problem so it
|
||
now calls another function <code>poke()</code> which calls itself
|
||
instead (this is sometimes necessary nowadays).</p>
|
||
<p>Finally the optimiser cannot be enabled so the compiler flags were
|
||
changed for this.</p>
|
||
<h2 id="gavare-readme.md"><a name="2004_gavare"></a><a
|
||
href="/2004/gavare/gavare.c">2004/gavare</a> (<a
|
||
href="/2004/gavare/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added three different <a
|
||
href="/2004/gavare/README.md#alternate-code">alternate versions</a>:</p>
|
||
<ul>
|
||
<li><a href="/2004/gavare/gavare.alt.c">gavare.alt.c</a> allows you to
|
||
change the image size and anti-alias setting at compile time.</li>
|
||
<li><a href="/2004/gavare/gavare.alt2.c">gavare.alt2.c</a> is like <a
|
||
href="/2004/gavare/gavare.alt.c">gavare.alt.c</a> but it should work for
|
||
Windows as well (it sets binary mode on <code>stdout</code>).</li>
|
||
<li><a href="/2004/gavare/gavare.r3.c">gavare.r3.c</a> is the author’s
|
||
unobfuscated version that was used during development, found on their <a
|
||
href="https://gavare.se/ioccc/ioccc_gavare.c.html">website about the
|
||
entry</a>.</li>
|
||
</ul>
|
||
<h2 id="gavin-readme.md"><a name="2004_gavin"></a><a
|
||
href="/2004/gavin/gavin.c">2004/gavin</a> (<a
|
||
href="/2004/gavin/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> provided the <a
|
||
href="/2004/gavin/README.md#alternate-code">alt code</a> for those who
|
||
want to use QEMU. The most important part of this is the macro
|
||
<code>K</code> has to be defined as <code>1</code>, not
|
||
<code>0</code>.</p>
|
||
<p><a href="#yusuke">Yusuke</a> provided the <code>kernel</code> and
|
||
<code>fs.tar</code> files which can be used if you cannot normally use
|
||
this entry. Instead of generating the files just use the files provided,
|
||
found under the <a href="/2004/gavin/img/">img/</a> directory. Note that
|
||
the <code>img/fs.tar</code> extracts into <code>fs/</code> so you will
|
||
have to fix the tarball; this is done this way to prevent extraction
|
||
from the entry directory overwriting the files and causing
|
||
<code>make clobber</code> to wipe some of them out.</p>
|
||
<h2 id="hibachi-readme.md"><a name="2004_hibachi"></a><a
|
||
href="/2004/hibachi/hibachi.c">2004/hibachi</a> (<a
|
||
href="/2004/hibachi/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed a bunch of links in the index.html
|
||
provided with the entry (web server) that no longer exist or have
|
||
changed in some other way (<code>https</code> instead of
|
||
<code>http</code> for instance). In most cases a new link or change to
|
||
https was all that was necessary but at least one or two URLs required
|
||
the Internet Wayback Machine.</p>
|
||
<h2 id="hoyle-readme.md"><a name="2004_hoyle"></a><a
|
||
href="/2004/hoyle/hoyle.c">2004/hoyle</a> (<a
|
||
href="/2004/hoyle/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2004/hoyle/try.sh">try.sh</a> script.</p>
|
||
<h2 id="jdalbec-readme.md"><a name="2004_jdalbec"></a><a
|
||
href="/2004/jdalbec/jdalbec.c">2004/jdalbec</a> (<a
|
||
href="/2004/jdalbec/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to compile with gcc (it worked
|
||
with clang). The problem was the cpp being unable to parse the generated
|
||
code (see the README.md for details) and this ended up with a number of
|
||
errors like:</p>
|
||
<div class="sourceCode" id="cb61"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb61-1"><a href="#cb61-1" aria-hidden="true" tabindex="-1"></a>jdalbec<span class="op">.</span>c<span class="op">:</span><span class="dv">64</span><span class="op">:</span><span class="dv">5</span><span class="op">:</span> error<span class="op">:</span> stray <span class="ch">'#</span><span class="er">#</span><span class="ch">'</span> in program</span>
|
||
<span id="cb61-2"><a href="#cb61-2" aria-hidden="true" tabindex="-1"></a> <span class="dv">64</span> <span class="op">|</span> B N##B <span class="op">(</span>I<span class="op">)</span> <span class="op">;</span> \</span>
|
||
<span id="cb61-3"><a href="#cb61-3" aria-hidden="true" tabindex="-1"></a> <span class="op">|</span> <span class="op">^~</span></span>
|
||
<span id="cb61-4"><a href="#cb61-4" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb61-5"><a href="#cb61-5" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb61-6"><a href="#cb61-6" aria-hidden="true" tabindex="-1"></a><span class="op">..</span></span>
|
||
<span id="cb61-7"><a href="#cb61-7" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb61-8"><a href="#cb61-8" aria-hidden="true" tabindex="-1"></a>jdalbec<span class="op">.</span>c<span class="op">:</span><span class="dv">65</span><span class="op">:</span><span class="dv">5</span><span class="op">:</span> error<span class="op">:</span> stray <span class="ch">'#</span><span class="er">#</span><span class="ch">'</span> in program</span>
|
||
<span id="cb61-9"><a href="#cb61-9" aria-hidden="true" tabindex="-1"></a> <span class="dv">65</span> <span class="op">|</span> V F##B <span class="op">(</span>B<span class="op">)</span> <span class="op">;</span> \</span>
|
||
<span id="cb61-10"><a href="#cb61-10" aria-hidden="true" tabindex="-1"></a> <span class="op">|</span> <span class="op">^~</span></span>
|
||
<span id="cb61-11"><a href="#cb61-11" aria-hidden="true" tabindex="-1"></a>jdalbec<span class="op">.</span>c<span class="op">:</span><span class="dv">65</span><span class="op">:</span><span class="dv">5</span><span class="op">:</span> error<span class="op">:</span> expected <span class="ch">';'</span> before <span class="ch">'B'</span></span>
|
||
<span id="cb61-12"><a href="#cb61-12" aria-hidden="true" tabindex="-1"></a> <span class="dv">65</span> <span class="op">|</span> V F##B <span class="op">(</span>B<span class="op">)</span> <span class="op">;</span> \</span>
|
||
<span id="cb61-13"><a href="#cb61-13" aria-hidden="true" tabindex="-1"></a> <span class="op">|</span> <span class="op">^</span> <span class="op">~</span></span>
|
||
<span id="cb61-14"><a href="#cb61-14" aria-hidden="true" tabindex="-1"></a> <span class="op">|</span> <span class="op">;</span></span></code></pre></div>
|
||
<p>and various other problems.</p>
|
||
<p>Cody also added <a href="/2004/jdalbec/README.md#alternate-code">alt
|
||
code</a> which allows one to control how many numbers after the
|
||
<code>:</code> to print before printing a newline, so that one can see
|
||
the output a bit better (though for lines that have a lot of numbers
|
||
this will be harder to see).</p>
|
||
<p>Finally Cody added <a href="/2004/jdalbec/try.sh">try.sh</a> and <a
|
||
href="/2004/jdalbec/try.alt.sh">try.alt.sh</a> to demonstrate both
|
||
versions.</p>
|
||
<h2 id="kopczynski-readme.md"><a name="2004_kopczynski"></a><a
|
||
href="/2004/kopczynski/kopczynski.c">2004/kopczynski</a> (<a
|
||
href="/2004/kopczynski/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> reported that this entry cannot be optimised
|
||
by the compiler as otherwise it will not work.</p>
|
||
<p>Cody, out of an abundance of caution for clang, added a second arg to
|
||
<code>main()</code> as some versions complain about the number of args
|
||
and although they accept 1 it is entirely possible it will eventually be
|
||
that they don’t.</p>
|
||
<p>Cody also added the <a href="/2004/kopczynski/try.sh">try.sh</a>
|
||
script and various data files: <a href="kopczynski-a">kopczynski-a</a>
|
||
to demonstrate what happens when art more like a letter is fed to the
|
||
program and the <code>kopczynski*-rev</code> files which are the data
|
||
files reversed with <code>rev(1)</code>. One had to be modified
|
||
additionally to get it to work, that being
|
||
<code>kopczynski-10-rev</code>.</p>
|
||
<h2 id="newbern-readme.md"><a name="2004_newbern"></a><a
|
||
href="/2004/newbern/newbern.c">2004/newbern</a> (<a
|
||
href="/2004/newbern/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> and Landon individually fixed this to work
|
||
with clang.</p>
|
||
<p>Cody also added the <a href="/2004/newbern/try.sh">try.sh</a> script
|
||
(with a hidden feature that the author referred to and was documented by
|
||
<a href="#yusuke">Yusuke</a> though Cody chose the word
|
||
<code>IOCCC</code> instead of <code>AAA</code>).</p>
|
||
<h2 id="omoikane-readme.md"><a name="2004_omoikane"></a><a
|
||
href="/2004/omoikane/omoikane.c">2004/omoikane</a> (<a
|
||
href="/2004/omoikane/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2004/omoikane/try.sh">try.sh</a> script.</p>
|
||
<h2 id="schnitzi-readme.md-4"><a name="2004_schnitzi"></a><a
|
||
href="/2004/schnitzi/schnitzi.c">2004/schnitzi</a> (<a
|
||
href="/2004/schnitzi/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> made this use <code>fgets(3)</code>.</p>
|
||
<p>He also changed the time factor in the data files as the animations
|
||
went too fast in modern systems, especially the scrolling text of <a
|
||
href="schnitzi.inp1">schnitzi.inp1</a>.</p>
|
||
<p>Cody also added the <a href="/2004/schnitzi/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="sds-readme.md"><a name="2004_sds"></a><a
|
||
href="/2004/sds/sds.c">2004/sds</a> (<a
|
||
href="/2004/sds/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2004/sds/try.sh">try.sh</a> script.</p>
|
||
<h2 id="vik2-readme.md"><a name="2004_vik2"></a><a
|
||
href="/2004/vik2/vik2.c">2004/vik2</a> (<a
|
||
href="/2004/vik2/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to compile in Linux. Although it
|
||
compiled cleanly in macOS (and BSD?) the code failed to compile at all
|
||
in Linux due to:</p>
|
||
<div class="sourceCode" id="cb62"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb62-1"><a href="#cb62-1" aria-hidden="true" tabindex="-1"></a>cc <span class="op">-</span>E vik2_1<span class="op">.</span>c <span class="op">></span> vik2_2<span class="op">.</span>c</span>
|
||
<span id="cb62-2"><a href="#cb62-2" aria-hidden="true" tabindex="-1"></a>In file included from vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">945</span><span class="op">,</span></span>
|
||
<span id="cb62-3"><a href="#cb62-3" aria-hidden="true" tabindex="-1"></a> from vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">959</span><span class="op">,</span></span>
|
||
<span id="cb62-4"><a href="#cb62-4" aria-hidden="true" tabindex="-1"></a> from vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">972</span><span class="op">,</span></span>
|
||
<span id="cb62-5"><a href="#cb62-5" aria-hidden="true" tabindex="-1"></a> from vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">1025</span><span class="op">:</span></span>
|
||
<span id="cb62-6"><a href="#cb62-6" aria-hidden="true" tabindex="-1"></a>vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">383</span><span class="op">:</span><span class="dv">8</span><span class="op">:</span> error<span class="op">:</span> no macro name given in #ifdef directive</span>
|
||
<span id="cb62-7"><a href="#cb62-7" aria-hidden="true" tabindex="-1"></a> <span class="dv">383</span> <span class="op">|</span> O \</span>
|
||
<span id="cb62-8"><a href="#cb62-8" aria-hidden="true" tabindex="-1"></a> <span class="op">|</span> <span class="op">^</span></span>
|
||
<span id="cb62-9"><a href="#cb62-9" aria-hidden="true" tabindex="-1"></a>In file included from vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">946</span><span class="op">:</span></span>
|
||
<span id="cb62-10"><a href="#cb62-10" aria-hidden="true" tabindex="-1"></a>vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">383</span><span class="op">:</span><span class="dv">8</span><span class="op">:</span> error<span class="op">:</span> no macro name given in #ifdef directive</span>
|
||
<span id="cb62-11"><a href="#cb62-11" aria-hidden="true" tabindex="-1"></a> <span class="dv">383</span> <span class="op">|</span> O \</span>
|
||
<span id="cb62-12"><a href="#cb62-12" aria-hidden="true" tabindex="-1"></a> <span class="op">|</span> <span class="op">^</span></span>
|
||
<span id="cb62-13"><a href="#cb62-13" aria-hidden="true" tabindex="-1"></a>In file included from vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">947</span><span class="op">:</span></span>
|
||
<span id="cb62-14"><a href="#cb62-14" aria-hidden="true" tabindex="-1"></a>vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">383</span><span class="op">:</span><span class="dv">8</span><span class="op">:</span> error<span class="op">:</span> no macro name given in #ifdef directive</span>
|
||
<span id="cb62-15"><a href="#cb62-15" aria-hidden="true" tabindex="-1"></a> <span class="dv">383</span> <span class="op">|</span> O \</span>
|
||
<span id="cb62-16"><a href="#cb62-16" aria-hidden="true" tabindex="-1"></a> <span class="op">|</span> <span class="op">^</span></span>
|
||
<span id="cb62-17"><a href="#cb62-17" aria-hidden="true" tabindex="-1"></a>In file included from vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">948</span><span class="op">:</span></span>
|
||
<span id="cb62-18"><a href="#cb62-18" aria-hidden="true" tabindex="-1"></a>vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">383</span><span class="op">:</span><span class="dv">8</span><span class="op">:</span> error<span class="op">:</span> no macro name given in #ifdef directive</span>
|
||
<span id="cb62-19"><a href="#cb62-19" aria-hidden="true" tabindex="-1"></a> <span class="dv">383</span> <span class="op">|</span> O \</span>
|
||
<span id="cb62-20"><a href="#cb62-20" aria-hidden="true" tabindex="-1"></a> <span class="op">|</span> <span class="op">^</span></span>
|
||
<span id="cb62-21"><a href="#cb62-21" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb62-22"><a href="#cb62-22" aria-hidden="true" tabindex="-1"></a><span class="op">...</span></span>
|
||
<span id="cb62-23"><a href="#cb62-23" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb62-24"><a href="#cb62-24" aria-hidden="true" tabindex="-1"></a>In file included from vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">182</span><span class="op">:</span></span>
|
||
<span id="cb62-25"><a href="#cb62-25" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb62-26"><a href="#cb62-26" aria-hidden="true" tabindex="-1"></a>vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">992</span><span class="op">:</span><span class="dv">85</span><span class="op">:</span> error<span class="op">:</span> #include nested depth <span class="dv">201</span> exceeds maximum of <span class="dv">200</span> <span class="op">(</span>use <span class="op">-</span>fmax<span class="op">-</span>include<span class="op">-</span>depth<span class="op">=</span>DEPTH to increase the maximum<span class="op">)</span></span>
|
||
<span id="cb62-27"><a href="#cb62-27" aria-hidden="true" tabindex="-1"></a> <span class="dv">992</span> <span class="op">|</span> I</span>
|
||
<span id="cb62-28"><a href="#cb62-28" aria-hidden="true" tabindex="-1"></a> <span class="op">|</span> <span class="op">^</span></span>
|
||
<span id="cb62-29"><a href="#cb62-29" aria-hidden="true" tabindex="-1"></a>vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">1497</span><span class="op">:</span><span class="dv">21</span><span class="op">:</span> error<span class="op">:</span> #include nested depth <span class="dv">200</span> exceeds maximum of <span class="dv">200</span> <span class="op">(</span>use <span class="op">-</span>fmax<span class="op">-</span>include<span class="op">-</span>depth<span class="op">=</span>DEPTH to increase the maximum<span class="op">)</span></span>
|
||
<span id="cb62-30"><a href="#cb62-30" aria-hidden="true" tabindex="-1"></a>vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">1498</span><span class="op">:</span><span class="dv">21</span><span class="op">:</span> error<span class="op">:</span> #include nested depth <span class="dv">200</span> exceeds maximum of <span class="dv">200</span> <span class="op">(</span>use <span class="op">-</span>fmax<span class="op">-</span>include<span class="op">-</span>depth<span class="op">=</span>DEPTH to increase the maximum<span class="op">)</span></span>
|
||
<span id="cb62-31"><a href="#cb62-31" aria-hidden="true" tabindex="-1"></a>vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">1499</span><span class="op">:</span><span class="dv">21</span><span class="op">:</span> error<span class="op">:</span> #include nested depth <span class="dv">200</span> exceeds maximum of <span class="dv">200</span> <span class="op">(</span>use <span class="op">-</span>fmax<span class="op">-</span>include<span class="op">-</span>depth<span class="op">=</span>DEPTH to increase the maximum<span class="op">)</span></span>
|
||
<span id="cb62-32"><a href="#cb62-32" aria-hidden="true" tabindex="-1"></a>vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">1500</span><span class="op">:</span><span class="dv">21</span><span class="op">:</span> error<span class="op">:</span> #include nested depth <span class="dv">200</span> exceeds maximum of <span class="dv">200</span> <span class="op">(</span>use <span class="op">-</span>fmax<span class="op">-</span>include<span class="op">-</span>depth<span class="op">=</span>DEPTH to increase the maximum<span class="op">)</span></span>
|
||
<span id="cb62-33"><a href="#cb62-33" aria-hidden="true" tabindex="-1"></a>vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">1501</span><span class="op">:</span><span class="dv">21</span><span class="op">:</span> error<span class="op">:</span> #include nested depth <span class="dv">200</span> exceeds maximum of <span class="dv">200</span> <span class="op">(</span>use <span class="op">-</span>fmax<span class="op">-</span>include<span class="op">-</span>depth<span class="op">=</span>DEPTH to increase the maximum<span class="op">)</span></span>
|
||
<span id="cb62-34"><a href="#cb62-34" aria-hidden="true" tabindex="-1"></a>vik2<span class="op">.</span>c<span class="op">:</span><span class="dv">1504</span><span class="op">:</span><span class="dv">21</span><span class="op">:</span> error<span class="op">:</span> #include nested depth <span class="dv">200</span> exceeds maximum of <span class="dv">200</span> <span class="op">(</span>use <span class="op">-</span>fmax<span class="op">-</span>include<span class="op">-</span>depth<span class="op">=</span>DEPTH to increase the maximum<span class="op">)</span></span>
|
||
<span id="cb62-35"><a href="#cb62-35" aria-hidden="true" tabindex="-1"></a>make<span class="op">:</span> <span class="op">***</span> <span class="op">[</span>Makefile<span class="op">:</span><span class="dv">133</span><span class="op">:</span> vik2<span class="op">]</span> Error <span class="dv">1</span></span></code></pre></div>
|
||
<p>Unfortunately the fix required heavy modification to the original
|
||
file (see below) and also inclusion of what used to be generated by the
|
||
<a href="/2004/vik2/Makefile">Makefile</a> but now it at least works for
|
||
both Linux and macOS.</p>
|
||
<p>As for the fix itself it required changing the C pre-processor macros
|
||
that resulted in macros themselves like <code>#ifdef</code>,
|
||
<code>#else</code> etc. to be <code>#ifdef</code>, <code>#else</code>
|
||
etc. and also the inclusion of the file <a
|
||
href="/2004/vik2/vik2_1.c">vik2_1.c</a> (which actually includes itself,
|
||
once directly and now by <code>__FILE__</code>) which used to be
|
||
generated by the Makefile via <code>cc -E</code>.</p>
|
||
<p>Cody also made it so that the <code>FNAME</code> is (for the entry
|
||
file itself and <code>vik2_1.c</code>: it shouldn’t be done for <a
|
||
href="/2004/vik2/vik2.possible.cat.death.c">vik2.possible.cat.death.c</a>!)
|
||
<code>__FILE__</code> just to make it a bit easier to compile.</p>
|
||
<h1 id="section-17"><a name="2005"></a>2005</h1>
|
||
<h2 id="aidan-readme.md"><a name="2005_aidan"></a><a
|
||
href="/2005/aidan/aidan.c">2005/aidan</a> (<a
|
||
href="/2005/aidan/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the test script, described by the
|
||
author in their remarks, to refer to the proper compiled program (it’s
|
||
hardcoded). This had never been done and so the script did not even work
|
||
(at least modernly?).</p>
|
||
<p>He also added the <a href="/2005/aidan/README.md#alternate-code">alt
|
||
code</a> based on the author’s remarks which is a different approach
|
||
than the one used and which (according to the author) ‘is slower
|
||
(particularly in worst-case or nearly so scenarios), inelegant, and not
|
||
a good starting place for sudoku generation.’</p>
|
||
<p>Cody added the <a href="/2005/aidan/try.sh">try.sh</a> and <a
|
||
href="/2005/aidan/try.alt.sh">try.alt.sh</a> scripts that correspond to
|
||
the entry and alt code respectively.</p>
|
||
<p>Cody added the <code>make test</code> and <code>make test-n0</code>
|
||
rules for easier use of the test suite.</p>
|
||
<h2 id="anon-readme.md"><a name="2005_anon"></a><a
|
||
href="/2005/anon/anon.c">2005/anon</a> (<a
|
||
href="/2005/anon/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed a problem where in some systems (like
|
||
macOS) the <code>stty sane</code> would not work and end up causing a
|
||
bus error. Instead of <code>stty sane</code> it uses
|
||
<code>stty echo</code> which is what it was trying to accomplish.</p>
|
||
<p>The author noted that one can define <code>NO_STTY</code> to not use
|
||
<code>stty(1)</code> at all (either to prevent having to hit enter or to
|
||
turn echo off/on) which is explained in the README.md.</p>
|
||
<p>Cody added the <a href="/2005/anon/README.md#alternate-code">alt
|
||
code</a> with vi(m) like movements.</p>
|
||
<h2 id="boutines-readme.md"><a name="2005_boutines"></a><a
|
||
href="/2005/boutines/boutines.c">2005/boutines</a> (<a
|
||
href="/2005/boutines/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2005/boutines/input.txt">input.txt</a> data file based on
|
||
suggested input from the author, adapting it to a command to try
|
||
out.</p>
|
||
<p>Cody also added the <a href="/2005/boutines/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="giljade-readme.md"><a name="2005_giljade"></a><a
|
||
href="/2005/giljade/giljade.c">2005/giljade</a> (<a
|
||
href="/2005/giljade/README.md%5D">README.md</a>)</h2>
|
||
<p>After Landon fixed the entry to compile with clang <a
|
||
href="#cody">Cody</a> noticed this does not work at all in modern
|
||
systems (see below). He fixed this to work and then he later fixed the
|
||
self-test feature.</p>
|
||
<p>The problem that was showing up is that with either optimising or if
|
||
anything but 32-bit (as in <code>-m32</code>) was used it would not work
|
||
(at least in 64-bit systems?). The optimising cannot be used still but
|
||
it now works with both 32-bit and 64-bit. The solution has to do with
|
||
the size difference between <code>int</code> and <code>long</code> so
|
||
that the <code>long*E</code> is now <code>int*E</code>. This solves a
|
||
specific problem for Linux (32-bit, 64-bit) and macOS (arm64).</p>
|
||
<p>To get the self-test feature to work it was required to remove from
|
||
the code:</p>
|
||
<div class="sourceCode" id="cb63"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb63-1"><a href="#cb63-1" aria-hidden="true" tabindex="-1"></a>O<span class="op">-</span>b<span class="op">-</span>f<span class="op">-</span>u <span class="op">-</span>s<span class="op">-</span>c<span class="op">-</span>a<span class="op">-</span>t<span class="op">-</span>e<span class="op">;</span></span></code></pre></div>
|
||
<p>as it caused a compilation error in some of the generated code but
|
||
served no purpose, didn’t affect the output of the puzzle and since the
|
||
‘string’ is already in the code there is no problem omitting it.</p>
|
||
<p>The most complicated fix was for, as might be expected,
|
||
<code>clang</code>: it (at least some systems?) has <code>-Werror</code>
|
||
by default so the program was changed to use <code>make</code> and then
|
||
<code>rm -f</code> on the output of the compiled binary instead. This
|
||
change might also not have been necessary if using different flags to
|
||
<code>cc</code> but this is less portable and caused other problems.
|
||
This was a complicated fix as it’s in the comments but in a funny way;
|
||
the final result to get the test feature to work is:</p>
|
||
<div class="sourceCode" id="cb64"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb64-1"><a href="#cb64-1" aria-hidden="true" tabindex="-1"></a><span class="op">;;</span> <span class="co">/*echo/Line/%d;sed/-n/-e/ %d,%dp/%s/|sed*/</span></span>
|
||
<span id="cb64-2"><a href="#cb64-2" aria-hidden="true" tabindex="-1"></a><span class="co">/*-e/'s,intZ,int/ Z,g'>c.c;make/c;/ rm/-f/c*/</span></span>
|
||
<span id="cb64-3"><a href="#cb64-3" aria-hidden="true" tabindex="-1"></a><span class="op">;;</span></span></code></pre></div>
|
||
<p>changed from:</p>
|
||
<div class="sourceCode" id="cb65"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb65-1"><a href="#cb65-1" aria-hidden="true" tabindex="-1"></a><span class="op">;;</span> <span class="co">/*echo/Line/%d;sed/-n/-e/ %d,%dp/%s>*/</span></span>
|
||
<span id="cb65-2"><a href="#cb65-2" aria-hidden="true" tabindex="-1"></a><span class="co">/*c.c;cc/c.c /-c*/</span><span class="op">;;</span></span></code></pre></div>
|
||
<p>or as a diff:</p>
|
||
<div class="sourceCode" id="cb66"><pre
|
||
class="sourceCode diff"><code class="sourceCode diff"><span id="cb66-1"><a href="#cb66-1" aria-hidden="true" tabindex="-1"></a><span class="st">-(t(m),(0));; /*echo/Line/%d;sed/-n/-e/ %d,%dp/%s>*/</span></span>
|
||
<span id="cb66-2"><a href="#cb66-2" aria-hidden="true" tabindex="-1"></a><span class="st">-/*c.c;cc/c.c /-c*/;;char*A=0,*_,*R,*Q, D[9999],*r,l</span></span>
|
||
<span id="cb66-3"><a href="#cb66-3" aria-hidden="true" tabindex="-1"></a><span class="st">-[9999],T=42, M,V=32;long*E,k[9999],B[1 <<+21],*N=B+</span></span>
|
||
<span id="cb66-4"><a href="#cb66-4" aria-hidden="true" tabindex="-1"></a><span class="va">+(t(m),(0));; /*echo/Line/%d;sed/-n/-e/ %d,%dp/%s/|sed*/</span></span>
|
||
<span id="cb66-5"><a href="#cb66-5" aria-hidden="true" tabindex="-1"></a><span class="va">+/*-e/'s,intZ,int/ Z,g'>c.c;make/c;/ rm/-f/c*/</span></span>
|
||
<span id="cb66-6"><a href="#cb66-6" aria-hidden="true" tabindex="-1"></a><span class="va">+;;char*A=0,*_,*R,*Q, D[9999],*r,l[9999],T=42, M,V=32;int *E,k[9999],B[1 <<+21],*N=B+</span></span></code></pre></div>
|
||
<p>Cody also added the <a href="/2005/giljade/try.sh">try.sh</a> script
|
||
which also lets one see the beauty of the entry without having to use
|
||
vi(m), should they be afraid of getting stuck in it (and for ease of
|
||
use). :-)</p>
|
||
<p>Finally, to improve upon the test-suite provided by the program, Cody
|
||
added the <code>make test</code> rule which only shows lines matching
|
||
<code>'^Line'</code> but writing to a temporary file the compilation
|
||
including the ‘Line’ lines. After that is done it uses
|
||
<code>grep -c</code> on the file to show that there are indeed as many
|
||
versions the program generates as the author states, 180. If it does not
|
||
find 180 it is an error; otherwise it is success. It uses <a
|
||
href="/2005/giljade/test.sh">test.sh</a>.</p>
|
||
<h2 id="jetro-readme.md"><a name="2005_jetro"></a><a
|
||
href="/2005/jetro/jetro.c">2005/jetro</a> (<a
|
||
href="/2005/jetro/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added explicit linking of libm
|
||
(<code>-lm</code>) for systems like Linux that seem to not do it
|
||
implicitly (like macOS does).</p>
|
||
<h2 id="klausler-readme.md"><a name="2005_klausler"></a><a
|
||
href="/2005/klausler/klausler.c">2005/klausler</a> (<a
|
||
href="/2005/klausler/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2005/klausler/try.sh">try.sh</a> script.</p>
|
||
<h2 id="mikeash-readme.md"><a name="2005_mikeash"></a><a
|
||
href="/2005/mikeash/mikeash.c">2005/mikeash</a> (<a
|
||
href="/2005/mikeash/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to work in Linux. The problem was
|
||
an unknown escape sequence, <code>\N</code>, which caused a funny
|
||
compiler error:</p>
|
||
<div class="sourceCode" id="cb67"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb67-1"><a href="#cb67-1" aria-hidden="true" tabindex="-1"></a><span class="op">};</span>n b<span class="op">[</span><span class="dv">2048</span><span class="op">];</span><span class="dt">int</span> i</span>
|
||
<span id="cb67-2"><a href="#cb67-2" aria-hidden="true" tabindex="-1"></a>mikeash<span class="op">.</span>c<span class="op">:</span> In function <span class="ch">'R'</span><span class="op">:</span></span>
|
||
<span id="cb67-3"><a href="#cb67-3" aria-hidden="true" tabindex="-1"></a>mikeash<span class="op">.</span>c<span class="op">:</span><span class="dv">7</span><span class="op">:</span><span class="dv">1</span><span class="op">:</span> error<span class="op">:</span> <span class="ch">'\</span><span class="er">N</span><span class="ch">'</span> not followed by <span class="ch">'{'</span></span>
|
||
<span id="cb67-4"><a href="#cb67-4" aria-hidden="true" tabindex="-1"></a> <span class="dv">7</span> <span class="op">|</span> <span class="op">;</span>C<span class="op">!=</span><span class="ch">'</span><span class="sc">\n</span><span class="ch">'</span><span class="op">;</span>A<span class="op">()</span></span>
|
||
<span id="cb67-5"><a href="#cb67-5" aria-hidden="true" tabindex="-1"></a> <span class="op">|</span> <span class="op">^</span></span>
|
||
<span id="cb67-6"><a href="#cb67-6" aria-hidden="true" tabindex="-1"></a>mikeash<span class="op">.</span>c<span class="op">:</span><span class="dv">7</span><span class="op">:</span><span class="dv">1</span><span class="op">:</span> error<span class="op">:</span> incomplete universal character name \Ne</span></code></pre></div>
|
||
<p>The problem was that in the string above there was a
|
||
<code>\Newline</code> but this is invalid C. This was changed to be
|
||
<code>\nNewline</code> and then, because the code is supposed to output
|
||
itself when fed itself, the reference to <code>'N'</code> had to be
|
||
updated in both the string and the code to be <code>'n'</code>.</p>
|
||
<p>The array size of <code>c</code> was updated by 1 out of caution just
|
||
in case as the array is used to store at least part of the string.</p>
|
||
<p>It might be worth noting that the author stated that the reason for
|
||
the <code>\N</code> is due to LISP having different escape sequences.
|
||
The code was modified so that feeding the program itself will print
|
||
itself, showing no difference, which is what is supposed to happen. It
|
||
is not known, however, if having to change the <code>\N</code> to
|
||
<code>\n</code> ended up breaking any LISP. The other examples given by
|
||
the author also show correct output though.</p>
|
||
<p>Cody also added the <a href="/2005/mikeash/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="mynx-readme.md"><a name="2005_mynx"></a><a
|
||
href="/2005/mynx/mynx.c">2005/mynx</a> (<a
|
||
href="/2005/mynx/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this so that the <a
|
||
href="source/configure">configure</a> script (which is not needed but
|
||
part of the entry) would work with compilers that have by default
|
||
<code>-Werror</code> like clang in macOS.</p>
|
||
<p>Cody also added the alt code which does scan for https. Futile,
|
||
maybe, based on how https is set up, in which case just enjoy it for
|
||
what it was. But there might be some command line that will let it work
|
||
that way or perhaps someone wants to add the necessary code.</p>
|
||
<h2 id="persano-readme.md"><a name="2005_persano"></a><a
|
||
href="/2005/persano/persano.c">2005/persano</a> (<a
|
||
href="/2005/persano/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the (untested) <a
|
||
href="/2005/persano/README.md#alternate-code">alternate code</a> which
|
||
should work for Windows as it sets binary mode on <code>stdout</code>.
|
||
It is untested as Cody has no Windows system to test it on.</p>
|
||
<p>Cody also added the <a href="/2005/persano/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="sykes-readme.md"><a name="2005_sykes"></a><a
|
||
href="/2005/sykes/sykes.c">2005/sykes</a> (<a
|
||
href="/2005/sykes/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the saved (with the <code>SAVE</code>
|
||
command) BASIC program <code>PET</code> which was:</p>
|
||
<pre class="basic"><code>10 PRINT "2005'S IOCCC BEST EMULATOR"
|
||
20 PRINT "BY STEPHEN SYKES!"</code></pre>
|
||
<p>followed by the commands:</p>
|
||
<pre><code>SAVE "PET"
|
||
|
||
READY.
|
||
NEW
|
||
|
||
READY.
|
||
LOAD "PET"
|
||
|
||
READY.
|
||
RUN
|
||
2005'S IOCCC BEST EMULATOR
|
||
BY STEPHEN SYKES!</code></pre>
|
||
<p>to both save and test run it.</p>
|
||
<p>Cody added the <a href="/2005/sykes/try.sh">try.sh</a> script which
|
||
runs in a loop with a menu of things one might wish to try, asking if
|
||
they wish to continue when done.</p>
|
||
<p>Cody added the script <a href="/2005/sykes/test.sh">test.sh</a> and
|
||
the make rule <code>test</code> to run the test suite. The program will
|
||
enter an infinite loop after it runs so you have to hit ctrl-c to end it
|
||
which the script tells you.</p>
|
||
<p>The scripts note every time that one will have to send ctrl-c or
|
||
whatever their interrupt is set to in order to exit the program.</p>
|
||
<h2 id="timwi-readme.md"><a name="2005_timwi"></a><a
|
||
href="/2005/timwi/timwi.c">2005/timwi</a> (<a
|
||
href="/2005/timwi/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added <a
|
||
href="/2005/timwi/try.sh">try.sh</a>. It only has one command as he
|
||
doesn’t want to knacker his brain any more than it might or might not
|
||
already be :-) and he doesn’t want to damage anyone else’s brain either.
|
||
:-)</p>
|
||
<h2 id="toledo-readme.md"><a name="2005_toledo"></a><a
|
||
href="/2005/toledo/toledo.c">2005/toledo</a> (<a
|
||
href="/2005/toledo/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to compile with some versions of
|
||
clang which have an additional defect where <code>main()</code> can only
|
||
have 0, 2 or 3 args (it was 4). It now calls another function that takes
|
||
4 args and which is what used to be <code>main()</code>.</p>
|
||
<p>The alternate versions were also fixed.</p>
|
||
<h2 id="vince-readme.md"><a name="2005_vince"></a><a
|
||
href="/2005/vince/vince.c">2005/vince</a> (<a
|
||
href="/2005/vince/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this in the case that the program is
|
||
compiled or linked/copies to another file name: the code constructed the
|
||
source code file name in a clever and more obscure way by copying to the
|
||
buffer <code>*argv</code> and then using <code>strcat(3)</code> to
|
||
concatenate to it <code>.c</code>. But this assumes that the executable
|
||
is the same name as the source file which isn’t always be true. The
|
||
author even stated: ‘as long as the source is in the same directory as
|
||
the executable it should be able to find it’ but the source code file
|
||
name is not always the same as the executable with the appropriate
|
||
extension so this might be called a bug fix as well though if one runs
|
||
it from another directory, specifying the directory, it’ll not catch
|
||
it.</p>
|
||
<h1 id="section-18"><a name="2006"></a>2006</h1>
|
||
<h2 id="birken-readme.md"><a name="2006_birken"></a><a
|
||
href="/2006/birken/birken.c">2006/birken</a> (<a
|
||
href="/2006/birken/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed a segfault in macOS with this entry.
|
||
The problem was a missing <code>+1</code> for strlen() with malloc().
|
||
This prevented it from working.</p>
|
||
<p>Cody also added the <a href="/2006/birken/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="borsanyi-readme.md"><a name="2006_borsanyi"></a><a
|
||
href="/2006/borsanyi/borsanyi.c">2006/borsanyi</a> (<a
|
||
href="/2006/borsanyi/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the Makefile to work in systems where
|
||
the <code>lpthread</code> is not implicitly linked in.</p>
|
||
<p>Cody also added the <a href="/2006/borsanyi/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="grothe-readme.md"><a name="2006_grothe"></a><a
|
||
href="/2006/grothe/grothe.c">2006/grothe</a> (<a
|
||
href="/2006/grothe/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2006/grothe/try.sh">try.sh</a> script.</p>
|
||
<h2 id="hamre-readme.md"><a name="2006_hamre"></a><a
|
||
href="/2006/hamre/hamre.c">2006/hamre</a> (<a
|
||
href="/2006/hamre/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this so that it will not crash without
|
||
an arg after it was suggested this should be fixed.</p>
|
||
<p>Cody also added the <a href="/2006/hamre/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="monge-readme.md"><a name="2006_monge"></a><a
|
||
href="/2006/monge/monge.c">2006/monge</a> (<a
|
||
href="/2006/monge/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2006/monge/README.md#alternate-code">alternate code</a> that lets
|
||
one resize the image and redefine the number of iterations.</p>
|
||
<p>Cody also added the <a href="/2006/monge/try.sh">try.sh</a> and <a
|
||
href="/2006/monge/try.alt.sh">try.alt.sh</a> scripts.</p>
|
||
<p>Cody also fixed the Makefile to use <code>sdl-config</code> (which is
|
||
what the author stated too though that was noticed later), not
|
||
<code>sdl2-config</code> as two functions that are used were removed
|
||
from <a href="https://www.libsdl.org">SDL2</a>, thus making it not link.
|
||
Since SDL2 is still available and since changing the code to use SDL2 is
|
||
much more complicated and also makes the entry less like the original it
|
||
was simply made to link in SDL1.</p>
|
||
<p>Nevertheless this entry does require x86/x86_64 CPUS. This is a
|
||
documented feature but one which we will accept fixes to. See <a
|
||
href="/bugs.md#2006-monge">2006/monge in bugs.md</a>.</p>
|
||
<h2 id="night-readme.md"><a name="2006_night"></a><a
|
||
href="/2006/night/night.c">2006/night</a> (<a
|
||
href="/2006/night/README.md%5D">README.md</a>)</h2>
|
||
<p>As <a href="#cody">Cody</a> is a lost :-) <code>vim</code> user he
|
||
took the author’s remarks to add support back for arrow keys in the <a
|
||
href="/2006/night/night.alt.c">alternate version</a>.</p>
|
||
<h2 id="sloane-readme.md"><a name="2006_sloane"></a><a
|
||
href="/2006/sloane/sloane.c">2006/sloane</a> (<a
|
||
href="/2006/sloane/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this entry to work with clang which
|
||
has a defect with the args to <code>main()</code>: it requires specific
|
||
types: <code>int</code> and <code>char **</code> for the first and
|
||
latter args.</p>
|
||
<p>Cody also provided the <a href="/2006/sloane/sloane.alt.c">alternate
|
||
version</a>, which allows one to see what is going on in modern systems,
|
||
and which we recommend one use <em>first</em>.</p>
|
||
<p>Curiously, although clang requires the types of args to be strictly
|
||
correct, some versions do allow only one arg. This was done at first
|
||
because it’s not used but Cody discovered that later versions of clang
|
||
have an additional defect where it does not allow only one arg so the
|
||
second arg to <code>main()</code> was added back.</p>
|
||
<p>This was an unfortunate problem for the alt code as he has been using
|
||
Z for alt code <code>usleep()</code> (for sleep) but in this case
|
||
unfortunately the original entry used <code>Z</code> in
|
||
<code>main()</code> (though unused) so to make it more like the original
|
||
Cody renamed the macro <code>Z</code> for <code>usleep()</code> to
|
||
<code>S</code> instead which can stand for sleep and also it is kind of
|
||
like a backwards <code>Z</code>. That way <code>Z</code> could be in
|
||
<code>main()</code>.</p>
|
||
<p>Cody also made sure that the Makefile links in <code>libm</code> as
|
||
not all systems do this by default.</p>
|
||
<p>Since the author suggested that the lack of certain
|
||
<code>#include</code>s might break the program in some systems he also
|
||
added <code>-include ...</code> to the Makefile as well.</p>
|
||
<h2 id="stewart-readme.md"><a name="2006_stewart"></a><a
|
||
href="/2006/stewart/stewart.c">2006/stewart</a> (<a
|
||
href="/2006/stewart/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2006/stewart/try.sh">try.sh</a> script.</p>
|
||
<p>Cody also fixed it so that if the file cannot be opened it exits
|
||
rather than trying to read from the file. This was done at a time when
|
||
it was considered to be a bug to fix.</p>
|
||
<h2 id="sykes1-readme.md"><a name="2006_sykes1"></a><a
|
||
href="/2006/sykes1/sykes1.c">2006/sykes1</a> (<a
|
||
href="/2006/sykes1/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> provided the <a
|
||
href="/2006/sykes1/README.md#alternate-code">alt code</a> based on the
|
||
author’s remarks.</p>
|
||
<p>Cody also added the <a href="/2006/sykes1/try.sh">try.sh</a>
|
||
script.</p>
|
||
<p>Cody also provided the <a
|
||
href="/2006/sykes1/bedlam-cubes.pdf">bedlam-cubes.pdf</a> file, obtained
|
||
from the Internet Wayback Machine, as the file was no longer available.
|
||
The video was also no longer available but Cody found an alternative and
|
||
added it to the repo as well.</p>
|
||
<h2 id="sykes2-readme.md"><a name="2006_sykes2"></a><a
|
||
href="/2006/sykes2/sykes2.c">2006/sykes2</a> (<a
|
||
href="/2006/sykes2/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a>, out of an abundance of caution for
|
||
<code>clang</code>’s defects, made <code>main()</code> have to args
|
||
instead of 1 as some versions report that <code>main()</code> must have
|
||
0, 2 or 3 args, even though at least one of those versions allows 1 arg
|
||
only.</p>
|
||
<p>Cody also added the <a href="/2006/sykes2/try.sh">try.sh</a> script
|
||
for easier use of the entry to show the clock update in real time.</p>
|
||
<h2 id="toledo1-readme.md"><a name="2006_toledo1"></a><a
|
||
href="/2006/toledo1/toledo1.c">2006/toledo1</a> (<a
|
||
href="/2006/toledo1/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2006/toledo1/try.sh">try.sh</a> script.</p>
|
||
<h2 id="toledo2-readme.md"><a name="2006_toledo2"></a><a
|
||
href="/2006/toledo2/toledo2.c">2006/toledo2</a> (<a
|
||
href="/2006/toledo2/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed a segfault in this program which was
|
||
making it fail to work under macOS - it did not seem to be a problem
|
||
under Linux, at least not fedora. The problem was wrong variable types -
|
||
implicit <code>int</code>s instead of <code>FILE *</code>s. It now works
|
||
with both macOS and Linux.</p>
|
||
<p>Cody also added the (untested) alt code that is based on the author’s
|
||
remarks to port this to systems that have the non-standard
|
||
<code>kbhit()</code> and <code>getch()</code> (not the one from curses)
|
||
which is typically (always?) in <code>conio.h</code>.</p>
|
||
<p>The author, <a href="/authors.html#Oscar_Toledo">Oscar Toledo G.</a>,
|
||
later went back over the program and modified the
|
||
<code>fread(3)</code>/<code>fwrite(3)</code> section to use the variable
|
||
<code>FILE *e</code> (that Cody changed) instead of <code>int y</code>,
|
||
making it to work on x86_64 (perhaps Cody’s fix was for arm64 only?).
|
||
Also, he added a note to clarify from where appears the
|
||
<code>IMPORT.COM</code> and <code>HALT.COM</code> files.</p>
|
||
<h2 id="toledo3-readme.md"><a name="2006_toledo3"></a><a
|
||
href="/2006/toledo3/toledo3.c">2006/toledo3</a> (<a
|
||
href="/2006/toledo3/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed a crash and a display problem in this
|
||
entry so that it now works in modern (64-bit) systems. The crash appears
|
||
to only occur in macOS but the fix lets it work in both Linux and macOS.
|
||
The problem was that it relied on 32-bits so some <code>int</code>s were
|
||
changed to <code>long</code>s. The display problem might or might not
|
||
have been a problem in Linux with the old <code>int</code>s but this is
|
||
no longer known.</p>
|
||
<p>Cody also added the code that <em>should</em> work for Windows, <a
|
||
href="/2006/toledo3/toledo3.alt.c">toledo3.alt.c</a>, based on the
|
||
author’s remarks. We’re not able to test this.</p>
|
||
<h1 id="section-19"><a name="2011"></a>2011</h1>
|
||
<h2 id="akari-readme.md"><a name="2011_akari"></a><a
|
||
href="/2011/akari/akari.c">2011/akari</a> (<a
|
||
href="/2011/akari/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2011/akari/try.sh">try.sh</a> script.</p>
|
||
<h2 id="blakely-readme.md"><a name="2011_blakely"></a><a
|
||
href="/2011/blakely/blakely.c">2011/blakely</a> (<a
|
||
href="/2011/blakely/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2011/blakely/try.sh">try.sh</a> script.</p>
|
||
<h2 id="borsanyi-readme.md-1"><a name="2011_borsanyi"></a><a
|
||
href="/2011/borsanyi/borsanyi.c">2011/borsanyi</a> (<a
|
||
href="/2011/borsanyi/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a>, out of an abundance of caution, added a
|
||
second arg to <code>main()</code> as some versions of clang complain
|
||
about not only the type of each arg to <code>main()</code> but the
|
||
number of args as well.</p>
|
||
<p>Cody also added the <a href="/2011/borsanyi/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="dlowe-readme.md-2"><a name="2011_dlowe"></a><a
|
||
href="/2011/dlowe/dlowe.c">2011/dlowe</a> (<a
|
||
href="/2011/dlowe/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2011/dlowe/try.sh">try.sh</a> script.</p>
|
||
<h2 id="eastman-readme.md"><a name="2011_eastman"></a><a
|
||
href="/2011/eastman/eastman.c">2011/eastman</a> (<a
|
||
href="/2011/eastman/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the video file <a
|
||
href="/2011/eastman">boing-ball.mp4</a> which is the demo the author
|
||
referred to.</p>
|
||
<h2 id="fredriksson-readme.md"><a name="2011_fredriksson"></a><a
|
||
href="/2011/fredriksson/fredriksson.c">2011/fredriksson</a> (<a
|
||
href="/2011/fredriksson/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2011/fredriksson/try.sh">try.sh</a> script.</p>
|
||
<h2 id="goren-readme.md"><a name="2011_goren"></a><a
|
||
href="/2011/goren/goren.c">2011/goren</a> (<a
|
||
href="/2011/goren/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this for macOS. Before the fix it
|
||
segfaulted. It worked fine under Linux. After fixing it it was noticed
|
||
that the author stated it does not work for 64-bit so it was then tested
|
||
as a 32-bit binary (Linux) and 64-bit binary (Linux, macOS) and both
|
||
work. It was fixed by changing some <code>int</code>s to
|
||
<code>long</code>s and now it does work with 64-bit systems as well as
|
||
32-bit systems.</p>
|
||
<p>Cody also added the <a href="/2011/goren/try.sh">try.sh</a>
|
||
script.</p>
|
||
<p>Cody added the following words of wisdom:
|
||
<code>'"this" is not a pipe but "!" is'</code>.</p>
|
||
<h2 id="hamaji-readme.md"><a name="2011_hamaji"></a><a
|
||
href="/2011/hamaji/hamaji.c">2011/hamaji</a> (<a
|
||
href="/2011/hamaji/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2011/hamaji/try.sh">try.sh</a> script and the <code>.nono</code>
|
||
files <a
|
||
href="/2011/hamaji/conway-game-of-life.nono">conway-game-of-life.nono</a>,
|
||
<a href="/2011/hamaji/multi-solutions.nono">multi-solutions.nono</a>, <a
|
||
href="/2011/hamaji/no-solution.nono">no-solution.nono</a>, <a
|
||
href="/2011/hamaji/plus.nono">plus.nono</a> and <a
|
||
href="/2011/hamaji/smiley.nono">smiley.nono</a>. The latter two
|
||
<code>.nono</code> files were taken from <a
|
||
href="https://web.archive.org/web/20130218055139/http://codegolf.com/paint-by-numbers"
|
||
class="uri">https://web.archive.org/web/20130218055139/http://codegolf.com/paint-by-numbers</a>
|
||
and the others were from the authors’ remarks.</p>
|
||
<h2 id="hou-readme.md"><a name="2011_hou"></a><a
|
||
href="/2011/hou/hou.c">2011/hou</a> (<a
|
||
href="/2011/hou/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2011/hou/try.sh">try.sh</a> script.</p>
|
||
<h2 id="konno-readme.md"><a name="2011_konno"></a><a
|
||
href="/2011/konno/konno.c">2011/konno</a> (<a
|
||
href="/2011/konno/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the program to not crash if no arg was
|
||
specified as this was not a documented feature.</p>
|
||
<p>Cody also added the <a href="/2011/konno/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="richards-readme.md"><a name="2011_richards"></a><a
|
||
href="/2011/richards/richards.c">2011/richards</a> (<a
|
||
href="/2011/richards/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed a minor problem that showed up in both
|
||
Linux and macOS. He notes however that as of this time this entry does
|
||
not work properly with macOS at least with the silicon chip (Intel has
|
||
not been tested) and it is quite possibly an inherent problem in macOS
|
||
to do with executing code in in memory/JIT and in particular with the
|
||
silicon chip. See <a href="/bugs.md#2011-richards">2011/richards in
|
||
bugs.md</a> for more details and a document from Apple about how it
|
||
might be fixed if anyone is brave enough to try. If they do they might
|
||
want to look also at <a
|
||
href="/2011/richards/richards.alt.c">richards.alt.c</a>, for whatever it
|
||
might or might not be worth, as it is a possible starting point that
|
||
Cody added.</p>
|
||
<p>Cody also added the <a href="/2011/richards/try.sh">try.sh</a> and
|
||
the <a href="/2011/richards/try.alt.sh">try.alt.sh</a> scripts. The
|
||
<code>try.alt.sh</code> script will be helpful to test any fixes for
|
||
Apple silicon chips (see <a href="/bugs.md#2011-richards">2011/richards
|
||
in bugs.md</a> for more details).</p>
|
||
<h2 id="toledo-readme.md-1"><a name="2011_toledo"></a><a
|
||
href="/2011/toledo/toledo.c">2011/toledo</a> (<a
|
||
href="/2011/toledo/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added two <a
|
||
href="/2011/toledo/README.md#alternate-code">alternate versions</a>: one
|
||
that lets one reconfigure the controls and also the size of the game and
|
||
another version that should work in Windows, based on the author’s
|
||
remarks and support file, <code>layer.c</code>.</p>
|
||
<p>The Makefile was also modified by Cody to make it simpler to redefine
|
||
the controls, width and height.</p>
|
||
<h2 id="vik-readme.md"><a name="2011_vik"></a><a
|
||
href="/2011/vik/vik.c">2011/vik</a> (<a
|
||
href="/2011/vik/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2011/vik/try.sh">try.sh</a> script.</p>
|
||
<p>Cody also added an <a
|
||
href="/2011/vik/README.md#alternate-code">alternate version</a> for
|
||
Windows based on the author’s comments (along with looking up the
|
||
function for the right header files). To build try the alt rule of the
|
||
Makefile.</p>
|
||
<h2 id="zucker-readme.md"><a name="2011_zucker"></a><a
|
||
href="/2011/zucker/zucker.c">2011/zucker</a> (<a
|
||
href="/2011/zucker/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2011/zucker/try.sh">try.sh</a> script.</p>
|
||
<p>Cody also added <a href="/2011/zucker/README.md#alternate-code">alt
|
||
code</a> that should work on Windows, based on the author’s remarks that
|
||
if the system distinguishes binary and text then <code>stdout</code>
|
||
needs to be set to binary mode.</p>
|
||
<p>Cody also added the PDF file <a
|
||
href="/2011/zucker/sphere-tracing.pdf">sphere-tracing.pdf</a> in case
|
||
the link eventually dies.</p>
|
||
<h1 id="section-20"><a name="2012"></a>2012</h1>
|
||
<h2 id="blakely-readme.md-1"><a name="2012_blakely"></a><a
|
||
href="/2012/blakely/blakely.c">2012/blakely</a> (<a
|
||
href="/2012/blakely/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added explicit linking of libm
|
||
(<code>-lm</code>) as not all systems do this implicitly (Linux doesn’t
|
||
seem to but macOS does).</p>
|
||
<p>Cody also added the <a href="/2012/blakely/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="deckmyn-readme.md"><a name="2012_deckmyn"></a><a
|
||
href="/2012/deckmyn/deckmyn.c">2012/deckmyn</a> (<a
|
||
href="/2012/deckmyn/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2012/deckmyn/try.sh">try.sh</a> script.</p>
|
||
<h2 id="endoh1-readme.md"><a name="2012_endoh1"></a><a
|
||
href="/2012/endoh1/endoh1.c">2012/endoh1</a> (<a
|
||
href="/2012/endoh1/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added explicit linking of libm
|
||
(<code>-lm</code>) as not all systems do this implicitly (Linux doesn’t
|
||
seem to but macOS does).</p>
|
||
<p>Cody also added two <a
|
||
href="/2012/endoh1/README.md#alternate-code">alt versions</a> that let
|
||
one control how fast the fluid moves (how long to sleep in between
|
||
writes) and also the gravity factor, the pressure factor and the
|
||
viscosity factor as well as an alarm that lets one run it in a loop
|
||
without having to hit ctrl-c/intr in between (the alarm can be disabled,
|
||
however). The Makefile allows one to easily do this with variable names
|
||
rather than redefining <code>CDEFINE</code>.</p>
|
||
<p>The two different alt versions is because there are two versions: the
|
||
original and the colour version added by the author, <a
|
||
href="#yusuke">Yusuke</a>, at the request of the judges.</p>
|
||
<p>Cody also added the <a href="/2012/endoh1/try.alt.sh">try.alt.sh</a>
|
||
script that compiles the alt code in two ways, one with setting the
|
||
gravity factor to <code>I</code> and another with the default, and which
|
||
is run on the source file and each of the text files supplied by the
|
||
author. This code has an alarm set at 10 seconds so that one need not
|
||
hit ctrl-c/intr in between .. say to make it more fluid :-)</p>
|
||
<p>Cody also added the <a
|
||
href="/2012/endoh1/try.alt.bw.sh">try.alt.bw.sh</a> which is the same as
|
||
the <code>try.alt.sh</code> except it does not use the coloured
|
||
version.</p>
|
||
<p>Finally Cody added the <a href="/2012/endoh1/try.sh">try.sh</a> and
|
||
<a href="/2012/endoh1/try.bw.sh">try.bw.sh</a> which correspond to the
|
||
coloured version <a
|
||
href="/2012/endoh1/endoh1_color.c">endoh1_color.c</a> and the original
|
||
submitted version without colour, <a
|
||
href="/2012/endoh1/endoh1.c">endoh1.c</a>.</p>
|
||
<p>The <a href="/2012/endoh1/endoh1.alt2.c">endoh1.alt2.c</a> was
|
||
provided by the author, <a href="#yusuke">Yusuke</a>, at the time of the
|
||
contest as a de-obfuscated version.</p>
|
||
<h2 id="endoh2-readme.md"><a name="2012_endoh2"></a><a
|
||
href="/2012/endoh2/endoh2.c">2012/endoh2</a> (<a
|
||
href="/2012/endoh2/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2012/endoh2/try.sh">try.sh</a> script that runs everything,
|
||
filtered through less.</p>
|
||
<p>Cody also fixed a typo in the ruby script <a
|
||
href="/2012/endoh2/find-font-table.rb">find-font-table.rb</a>.</p>
|
||
<h2 id="grothe-readme.md-1"><a name="2012_grothe"></a><a
|
||
href="/2012/grothe/grothe.c">2012/grothe</a> (<a
|
||
href="/2012/grothe/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2012/grothe/try.sh">try.sh</a> script.</p>
|
||
<p>Cody also changed <code>argv</code> to be not
|
||
<code>const char **</code> but <code>char **</code>, mostly out of an
|
||
abundance of caution in case clang, which already imposes restrictions
|
||
on the types of args to <code>main()</code> including to do with
|
||
<code>char **</code>, decides to further restrict them.</p>
|
||
<p>Cody also restored the original code from the archive.</p>
|
||
<p>And although the URL works for now (via redirect), Cody changed the
|
||
website linked to in the recipe file to the domain that the old one
|
||
currently redirects to, in case the other domain ends up expiring or
|
||
stops redirecting to the more recent domain. For historical purposes the
|
||
old link was <code>http://recipes.stevex.net/</code> but it redirects to
|
||
<code>https://www.mealsteps.com</code> which the recipe file now links
|
||
to.</p>
|
||
<h2 id="hamano-readme.md"><a name="2012_hamano"></a><a
|
||
href="/2012/hamano/hamano.c">2012/hamano</a> (<a
|
||
href="/2012/hamano/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2012/hamano/try.sh">try.sh</a> script and the helper Makefile
|
||
rules <code>hint.pdf</code>, <code>hint</code>, <code>hello.pdf</code>
|
||
and <code>hello</code> to simplify the procedure for both
|
||
<code>hint.pdf</code> and <code>hello.pdf</code> as well as compiling
|
||
them as C.</p>
|
||
<h2 id="hou-readme.md-1"><a name="2012_hou"></a><a
|
||
href="/2012/hou/hou.c">2012/hou</a> (<a
|
||
href="/2012/hou/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2012/hou/try.sh">try.sh</a> script and restored the original <a
|
||
href="/2012/hou/hint.md">hint markdown file</a> as the changes made when
|
||
converting to a GitHub README.md made the generated html not look
|
||
correct; it did not have a title, a stylesheet etc. due to the fact that
|
||
there is no <code>#</code> header (which specified title and stylesheet)
|
||
and other formatting changes.</p>
|
||
<h2 id="kang-readme.md"><a name="2012_kang"></a><a
|
||
href="/2012/kang/kang.c">2012/kang</a> (<a
|
||
href="/2012/kang/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added alt code that fixes a problem where in
|
||
German ‘v’ sounds like ‘f’ which the program has as ‘f’: with the
|
||
original version it would translate ‘fier’ to ‘4’ when the word is
|
||
‘vier’. But see below.</p>
|
||
<p>Originally this was updated in the original code but it was noticed
|
||
that this caused <em>other</em> German (and maybe other languages?)
|
||
words to be incorrect so it was set as an alt version since the code was
|
||
already there. It might also be considered a feature and not a bug so an
|
||
alt version is the better way to go about it. Using both, however,
|
||
allows one to experience different capabilities and also enjoy or
|
||
appreciate the entry even more, given how simple the difference is.</p>
|
||
<p>Cody also added six scripts: <a href="/2012/kang/en.sh">en.sh</a>, <a
|
||
href="/2012/kang/de.sh">de.sh</a>, <a
|
||
href="/2012/kang/en.alt.sh">en.alt.sh</a> and <a
|
||
href="/2012/de.alt.sh">de.alt.sh</a> which count from 0 through 13 in
|
||
English and German using the original entry and the alt version
|
||
respectively.</p>
|
||
<p>In the German scripts it uses the umlaut and also does it without the
|
||
umlaut (add an ‘e’). Notice how the program picks up on this! All
|
||
scripts can use either version but the <code>.alt.sh</code> versions
|
||
default to the <code>alt</code> version whereas the other defaults to
|
||
the submitted entry. See the README.md for details.</p>
|
||
<p>The fifth and sixth scripts, <a href="/2012/kang/try.sh">try.sh</a>
|
||
and <a href="/2012/kang/try.alt.sh">try.alt.sh</a>, run a sequence of
|
||
commands to show different languages and numbers with the submitted and
|
||
alternate version respectively. Notice how a single letter changes so
|
||
much!</p>
|
||
<h2 id="konno-readme.md-1"><a name="2012_konno"></a><a
|
||
href="/2012/konno/konno.c">2012/konno</a> (<a
|
||
href="/2012/konno/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2012/konno/try.sh">try.sh</a> script.</p>
|
||
<h2 id="omoikane-readme.md-1"><a name="2012_omoikane"></a><a
|
||
href="/2012/omoikane/omoikane.c">2012/omoikane</a> (<a
|
||
href="/2012/omoikane/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2012/omoikane/README.md#alternate-code">alternate versions</a>
|
||
which will, if no arg is specified, read in the program itself, rather
|
||
than <code>/dev/urandom</code>. This is mostly useful for those without
|
||
a <code>/dev/urandom</code> device file (the default for the entry). The
|
||
second alternate version is like the first except that it also sets
|
||
binary mode on <code>stdin</code> and <code>stdout</code> which should
|
||
theoretically make it work in Windows.</p>
|
||
<p>Cody also added the <a href="/2012/omoikane/try.sh">try.sh</a> and <a
|
||
href="/2012/omoikane/try.alt.sh">try.alt.sh</a> scripts.</p>
|
||
<h2 id="tromp-readme.md-1"><a name="2012_tromp"></a><a
|
||
href="/2012/tromp/tromp.c">2012/tromp</a> (<a
|
||
href="/2012/tromp/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2012/tromp/try.sh">try.sh</a> script.</p>
|
||
<h2 id="vik-readme.md-1"><a name="2012_vik"></a><a
|
||
href="/2012/vik/vik.c">2012/vik</a> (<a
|
||
href="/2012/vik/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2012/vik/try.sh">try.sh</a> script.</p>
|
||
<p>Based on the author’s description it should be able to get this entry
|
||
to work for Windows. With his instructions Cody also added the alternate
|
||
version that does this for the few who might use Windows.</p>
|
||
<h2 id="zeitak-readme.md"><a name="2012_zeitak"></a><a
|
||
href="/2012/zeitak/zeitak.c">2012/zeitak</a> (<a
|
||
href="/2012/zeitak/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> <a href="/2012/zeitak/test.sh">test.sh</a>
|
||
script and the <code>make test</code> rule that uses the script along
|
||
with a number of files that will correctly be flagged as incorrect
|
||
(including a text file and a java file, with a joke, to show that it’s
|
||
not that it parses C but rather just matching pairs though that’s
|
||
probably obvious) and some correctly nested files were also added
|
||
including <a href="/1984/anonymous/README.md">1984/anonymous</a> (as the
|
||
author explicitly mentioned it) and a java file as well with another
|
||
joke.</p>
|
||
<p>A minor point is that the author noted that one should look at the
|
||
program source with tab space of 4 characters so Cody added the command
|
||
to do this in vim for those who use it, in the judges’ remarks, to make
|
||
it easier for those who do not know how, and to make it more obvious to
|
||
try it.</p>
|
||
<h1 id="section-21"><a name="2013"></a>2013</h1>
|
||
<h2 id="birken-readme.md-1"><a name="2013_birken"></a><a
|
||
href="/2013/birken/birken.c">2013/birken</a> (<a
|
||
href="/2013/birken/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> changed the <code>return 0;</code> at the
|
||
end of the program to be <code>return system("reset");</code> (via
|
||
redefining <code>exit(3)</code> so that the column ending would be the
|
||
same) so that as long as it runs to completion the terminal will be sane
|
||
and the cursor will be visible. Using <code>atexit(3)</code> will not
|
||
work if the program is killed, signals are ugly and these would be
|
||
messing with the entry too much so these were not done.</p>
|
||
<p>Cody also added the alt version that lets one control how fast the
|
||
painting is done, based on the author’s recommendations, except that
|
||
Cody made it configurable at compile time. The Makefile was modified in
|
||
such a way as to make it very easy to redefine it at compile time.</p>
|
||
<p>Cody also added the <a href="/2013/birken/try.sh">try.sh</a> script
|
||
for the entry and the <a href="/2013/birken/try.alt.sh">try.alt.sh</a>
|
||
script for the alt code.</p>
|
||
<h2 id="cable1-readme.md"><a name="2013_cable1"></a><a
|
||
href="/2013/cable1/cable1.c">2013/cable1</a> (<a
|
||
href="/2013/cable1/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2013/cable1/try.sh">try.sh</a> script which also has an joke
|
||
Easter egg in it based on the judges’ remarks.</p>
|
||
<h2 id="cable2-readme.md"><a name="2013_cable2"></a><a
|
||
href="/2013/cable2/cable2.c">2013/cable2</a> (<a
|
||
href="/2013/cable2/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2013/cable2/try.sh">try.sh</a> script.</p>
|
||
<h2 id="cable3-readme.md"><a name="2013_cable3"></a><a
|
||
href="/2013/cable3/cable3.c">2013/cable3</a> (<a
|
||
href="/2013/cable3/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to compile with modern systems.
|
||
The problems were that <code>localtime()</code> is used differently and
|
||
<code>time.h</code> being included (with <a
|
||
href="https://www.libsdl.org">SDL2</a> in macOS - but see below) there
|
||
was a conflicting function type. This appeared to be a problem with
|
||
macOS and only when SDL2 was included (but which as noted next it cannot
|
||
be).</p>
|
||
<p>The other problem is that this entry uses SDL functions that were
|
||
removed from SDL2 so the Makefile has to use <code>sdl-config</code> and
|
||
not <code>sdl2-config</code>. This meant that at one point to be
|
||
strictly technical, the removal of <code>localtime()</code> wasn’t
|
||
necessary but this change was left in place anyway.</p>
|
||
<p>Later on in an updated macOS (problem discovered in macOS Sonoma) the
|
||
entry failed to compile again also due to <code>localtime()</code> so he
|
||
removed the prototype entirely to solve the problem.</p>
|
||
<p>Cody also slightly improved the <code>runme</code> script (renamed to
|
||
<a href="/2013/cable3/cable3.sh">cable3.sh</a> for consistency with
|
||
other entries that have wrapper scripts) to not assume that the program
|
||
has been compiled by running <code>make clobber all || exit 1</code> and
|
||
he also made it pass <code>shellcheck</code> (using
|
||
<code>[[ .. ]]</code> over <code>[ .. ]</code>).</p>
|
||
<p>As well, based on the author’s remarks, Cody added the <a
|
||
href="/2013/cable3/cable3.alt.c">alternate code</a> which should be
|
||
compilable for Windows/MS Visual Studio. This is done by in the compile
|
||
line undefining <code>KB</code> (<code>-UKB</code>) and then in the
|
||
source code defining <code>KB</code> to what the author suggested,
|
||
<code>(kb=H(8),kbhit())&&(r[1190]=getch(),H(7))</code>. It need
|
||
hardly be mentioned that this will not link in Unix systems (including
|
||
macOS).</p>
|
||
<p>Clang required a <code>-Wno-</code> option as well.</p>
|
||
<p>Finally Cody provided the <a
|
||
href="/2013/cable3/bios.asm">bios.asm</a> that the author referred to,
|
||
found at the <a
|
||
href="https://github.com/adriancable/8086tiny/tree/master">GitHub repo
|
||
for the entry</a>, and the ‘ready-made 40MB hard disk image containing a
|
||
whole bunch of software’ in <code>hd.img</code> that the author linked
|
||
to at <code>https://bitly.com/1bU8URK</code>.</p>
|
||
<h2 id="dlowe-readme.md-3"><a name="2013_dlowe"></a><a
|
||
href="/2013/dlowe/dlowe.c">2013/dlowe</a> (<a
|
||
href="/2013/dlowe/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the source code that we suggested one
|
||
should compile and run with different compilers as <a
|
||
href="/2013/dlowe/fun.c">fun.c</a>. He modified the Makefile so that
|
||
running <code>make all</code> will compile it, saving you the
|
||
effort.</p>
|
||
<p>He also provided the script <a
|
||
href="/2013/dlowe/slflen.sh">slflen.sh</a> which is based on the
|
||
author’s remarks, fixing it for shellcheck and improving upon it (show
|
||
what files will be processed). This script shows the sparkline of the
|
||
file lengths (as in <code>wc -c</code>). The fixes (but not the
|
||
improvements) were added to the author’s remarks.</p>
|
||
<p>Since the author called the program <code>sparkl</code> Cody modified
|
||
the Makefile so that running <code>make all</code> will create a symlink
|
||
to <code>dlowe</code> as <code>sparkl</code>. Running
|
||
<code>make clobber</code> will delete both and running
|
||
<code>make clobber all</code> will ensure that the symlink is created.
|
||
The <code>slflen.sh</code> script also explicitly makes sure to create
|
||
the symlink as it uses it, even though it runs
|
||
<code>make clobber all</code>.</p>
|
||
<p>Cody also added the <a href="/2013/dlowe/try.sh">try.sh</a> script to
|
||
more easily try the program.</p>
|
||
<p>He also added the <a href="/2013/dlowe/diff.sh">diff.sh</a> script
|
||
which is based on some commands to try that he suggested to see how
|
||
different lengths look.</p>
|
||
<h2 id="endoh1-readme.md-1"><a name="2013_endoh1"></a><a
|
||
href="/2013/endoh1/endoh1.c">2013/endoh1</a> (<a
|
||
href="/2013/endoh1/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2013/endoh1/try.sh">try.sh</a> script.</p>
|
||
<h2 id="endoh2-readme.md-1"><a name="2013_endoh2"></a><a
|
||
href="/2013/endoh2/endoh2.c">2013/endoh2</a> (<a
|
||
href="/2013/endoh2/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the Makefile <code>check</code> rule
|
||
so that it <code>checks</code> :-) that both <a
|
||
href="https://www.ruby-lang.org">Ruby</a> and <a
|
||
href="https://imagemagick.org">ImageMagick</a> are installed before
|
||
trying to run the ruby script. To be more technically correct: it checks
|
||
that the <code>convert</code> tool of ImageMagick is available (via
|
||
<code>type -P</code>) because <code>convert</code> is part of the
|
||
ImageMagick suite.</p>
|
||
<p>This is useful because the Ruby script tries to run (via
|
||
<code>IO.popen()</code>) the <code>convert</code> tool but without
|
||
ImageMagick being installed, if one is unaware of where it comes from it
|
||
will appear to be an error in the Ruby script (it might also appear to
|
||
be an issue with the script even if you know of <code>convert</code>: it
|
||
was another day that Cody remembered it and why it wasn’t installed on
|
||
his MacBook Pro even though in the past it had been and is indeed
|
||
now).</p>
|
||
<p>The rule will report the tools not installed and where to find them,
|
||
if they are not installed, and after checking these requirements it will
|
||
exit if either is not found.</p>
|
||
<p>The entry can still be enjoyed if you do not have these tools,
|
||
however.</p>
|
||
<h2 id="endoh3-readme.md"><a name="2013_endoh3"></a><a
|
||
href="/2013/endoh3/endoh3.c">2013/endoh3</a> (<a
|
||
href="/2013/endoh3/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2013/endoh3/try.sh">try.sh</a> script.</p>
|
||
<p>Cody also (out of an abundance of caution for <code>clang(1)</code>
|
||
which is strict with arg type and count to <code>main()</code>) added a
|
||
second (unused) arg to <code>main()</code>.</p>
|
||
<h2 id="endoh4-readme.md"><a name="2013_endoh4"></a><a
|
||
href="/2013/endoh4/endoh4.c">2013/endoh4</a> (<a
|
||
href="/2013/endoh4/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2013/endoh4/endoh4.sh">endoh4.sh</a> script which temporarily
|
||
turns off the cursor as suggested by the author, with the addition that
|
||
if no file is specified it will feed the source code <a
|
||
href="/2013/endoh4/endoh4.c">endoh4.c</a> to the program rather than the
|
||
file specified. It does not try and detect if the file exists or can be
|
||
read as that will be handled by the shell/program. One may pass more
|
||
than one file to the script.</p>
|
||
<p>Cody also made it easier to redefine the size at compilation time
|
||
(see the author’s remarks for more details on what this means). The
|
||
<code>endoh4.sh</code> script allows one to redefine it as well.</p>
|
||
<h2 id="hou-readme.md-2"><a name="2013_hou"></a><a
|
||
href="/2013/hou/hou.c">2013/hou</a> (<a
|
||
href="/2013/hou/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the Makefile so that this would work
|
||
properly. Before this the use of the program just did what the judges’
|
||
remarks said as far as how it might violate rule 2: the program is
|
||
really just a decompressor to generate the real source of the program.
|
||
So the source of the entry has to be compiled and then run, and the
|
||
output has to be compiled to be <code>hou</code>. This allows the real
|
||
program to be used. Thus the Makefile rule looks like:</p>
|
||
<div class="sourceCode" id="cb70"><pre
|
||
class="sourceCode makefile"><code class="sourceCode makefile"><span id="cb70-1"><a href="#cb70-1" aria-hidden="true" tabindex="-1"></a><span class="dv">${PROG}:</span><span class="dt"> </span><span class="ch">${</span><span class="dt">PROG</span><span class="ch">}</span><span class="dt">.c</span></span>
|
||
<span id="cb70-2"><a href="#cb70-2" aria-hidden="true" tabindex="-1"></a><span class="er"> </span><span class="ch">${</span><span class="dt">CC</span><span class="ch">}</span> <span class="ch">${</span><span class="dt">CFLAGS</span><span class="ch">}</span> <span class="ch">$<</span> -o <span class="ch">$@</span> <span class="ch">${</span><span class="dt">LDFLAGS</span><span class="ch">}</span></span>
|
||
<span id="cb70-3"><a href="#cb70-3" aria-hidden="true" tabindex="-1"></a> ./<span class="ch">${</span><span class="dt">PROG</span><span class="ch">}</span> | <span class="ch">${</span><span class="dt">CC</span><span class="ch">}</span> <span class="ch">${</span><span class="dt">CFLAGS</span><span class="ch">}</span> -xc - -o <span class="ch">$@</span> <span class="ch">${</span><span class="dt">LDFLAGS</span><span class="ch">}</span></span></code></pre></div>
|
||
<p>which then compiles like:</p>
|
||
<div class="sourceCode" id="cb71"><pre
|
||
class="sourceCode sh"><code class="sourceCode bash"><span id="cb71-1"><a href="#cb71-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cc</span> <span class="at">-std</span><span class="op">=</span>gnu11 <span class="at">-Wall</span> <span class="at">-Wextra</span> <span class="at">-pedantic</span> <span class="at">-Wno-sign-compare</span> <span class="at">-Wno-strict-prototypes</span> <span class="at">-O3</span> hou.c <span class="at">-o</span> hou <span class="at">-lm</span></span>
|
||
<span id="cb71-2"><a href="#cb71-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./hou</span> <span class="kw">|</span> <span class="fu">cc</span> <span class="at">-std</span><span class="op">=</span>gnu11 <span class="at">-Wall</span> <span class="at">-Wextra</span> <span class="at">-pedantic</span> <span class="at">-Wno-sign-compare</span> <span class="at">-Wno-strict-prototypes</span> <span class="at">-O3</span> <span class="at">-xc</span> <span class="at">-</span> <span class="at">-o</span> hou <span class="at">-lm</span></span></code></pre></div>
|
||
<p>The <code>LDFLAGS</code> were updated to have <code>-lm</code> as the
|
||
author suggested it uses the <code>math.h</code> library which not all
|
||
systems link in by default (Linux for instance does not).</p>
|
||
<p>Further, after the file <code>2013/hou/doc/example.markdown</code>
|
||
was moved to <a
|
||
href="/2013/hou/doc/example.md">2013/hou/doc/example.md</a> to match the
|
||
rest of the repo this broke <code>make</code> which Cody also fixed.</p>
|
||
<p>Cody also added the <a href="/2013/hou/try.sh">try.sh</a> script.</p>
|
||
<h2 id="mills-readme.md2013millsreadme.md"><a name="2013_mills"></a><a
|
||
href="/2013/mills/mills.c">2013/mills</a>
|
||
([README.md)[2013/mills/README.md))</h2>
|
||
<p><a href="#cody">Cody</a> fixed this so that the server would not
|
||
refuse the connection after the first call to <code>close(2)</code>. The
|
||
problem was that because the backlog to <code>listen(2)</code> was 1
|
||
once the connection closed the server was essentially ‘dead’. The
|
||
backlog was changed to 10 and this solves the problem. It is not known
|
||
if this was specific to macOS but it was not specific to a browser as
|
||
Safari and Firefox both had the problem.</p>
|
||
<h2
|
||
id="misaka-readme.md2013misakareadme.md"><a name="2013_misaka"></a><a
|
||
href="/2013/misaka/misaka.c">2013/misaka</a>
|
||
([README.md)[2013/misaka/README.md))</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2013/misaka/try.sh">try.sh</a> script.</p>
|
||
<h2 id="morgan1-readme.md"><a name="2013_morgan1"></a><a
|
||
href="/2013/morgan1/morgan1.c">2013/morgan1</a> (<a
|
||
href="/2013/morgan1/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added explicit linking of libm
|
||
(<code>-lm</code>) as not all systems do this implicitly (Linux doesn’t
|
||
seem to but macOS does).</p>
|
||
<p>Cody also added the <a href="/2013/morgan1/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="robison-readme.md-2"><a name="2013_robison"></a><a
|
||
href="/2013/robison/robison.c">2013/robison</a> (<a
|
||
href="/2013/robison/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2013/robison/try.sh">try.sh</a> script.</p>
|
||
<h1 id="section-22"><a name="2014"></a>2014</h1>
|
||
<h2 id="birken-readme.md-2"><a name="2014_birken"></a><a
|
||
href="/2014/birken/prog.c">2014/birken</a> (<a
|
||
href="/2014/birken/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> provided the <a
|
||
href="/2014/birken/README.md#alternate-code">alternate code</a> that
|
||
lets one redefine the port to bind to in case there is a firewall issue
|
||
or there is some other reason to not have the default port. Remember
|
||
that ports < 1024 are privileged. It also lets you redefine the
|
||
timing constant <code>STARDATE</code> (see the author’s remarks for more
|
||
details on this macro). The Makefile was made to use variables so it’s
|
||
easier to redefine the port and timing constant.</p>
|
||
<h2 id="deak-readme.md"><a name="2014_deak"></a><a
|
||
href="/2014/deak/prog.c">2014/deak</a> (<a
|
||
href="/2014/deak/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added <a
|
||
href="/2014/deak/README.md#alternate-code">alt code</a> that lets one
|
||
(via the Makefile) reconfigure the coordinates but instead of being a
|
||
modified version of the entry it is the version the author provided
|
||
which would be what the program would look like if, as the author put
|
||
it:</p>
|
||
<blockquote>
|
||
<p>The usage of recognizable elements from the C programming language in
|
||
the application source code is intentionally kept to a bare minimum.</p>
|
||
</blockquote>
|
||
<p>.. was not true.</p>
|
||
<p>This alt version did not originally compile because a value was left
|
||
off the <code>return</code> statement (this might have been fixed in the
|
||
README.md file too) so that was fixed and it also has
|
||
<code>#include <stdio.h></code> for <code>putchar(3)</code>. The
|
||
<code>#ifndef..#define..#endif</code> was not part of the original alt
|
||
code, of course.</p>
|
||
<p>Cody also added the <a href="/2014/deak/try.alt.sh">try.alt.sh</a>
|
||
script.</p>
|
||
<h2 id="endoh1-readme.md-2"><a name="2014_endoh1"></a><a
|
||
href="/2014/endoh1/prog.c">2014/endoh1</a> (<a
|
||
href="/2014/endoh1/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2014/endoh1/rake.sh">rake.sh</a> script and
|
||
<code>make rake</code> rule that runs the script. This script will check
|
||
that <code>rake</code> is installed and if it is not it will report this
|
||
and then check that <code>gem</code> is installed. It checks that
|
||
<code>gem</code> is installed in this case because <code>gem</code> is
|
||
how you install <code>rake</code>. If <code>gem</code> is not installed
|
||
it tells you to get it along with how to install <code>gem</code>. Then
|
||
it tells you how to install <code>rake</code>. If <code>rake</code>
|
||
fails to run then it tells you to install a specific gem and then to try
|
||
again. Finally if <code>rake</code> succeeds it will verify that
|
||
<code>prog</code> is executable and if it is it will run it.</p>
|
||
<p>Cody also added the <a href="/2014/endoh1/try.sh">try.sh</a>
|
||
script.</p>
|
||
<p><strong><em>Barely</em></strong> worth noting but done nonetheless,
|
||
Cody renamed the <code>read_me.md</code> file to <a
|
||
href="/2014/endoh1/spoilers.md">spoilers.md</a> to be clearer in its
|
||
purpose as it is a file with spoilers (and too close to README.md?).</p>
|
||
<h2 id="endoh2-readme.md-2"><a name="2014_endoh2"></a><a
|
||
href="/2014/endoh2/prog.c">2014/endoh2</a> (<a
|
||
href="/2014/endoh2/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2014/endoh2/try.sh">try.sh</a> script.</p>
|
||
<h2 id="maffiodo1-readme.md"><a name="2014_maffiodo1"></a><a
|
||
href="/2014/maffiodo1/prog.c">2014/maffiodo1</a> (<a
|
||
href="/2014/maffiodo1/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the build for this entry: it does not
|
||
require <a href="https://www.libsdl.org">SDL2</a> but SDL1 so there were
|
||
linking errors.</p>
|
||
<p>Cody also added the <a href="/2014/maffiodo1/mario.sh">mario.sh</a>
|
||
and <a href="/2014/maffiodo1/giana.sh">giana.sh</a> scripts which play,
|
||
respectively, <a
|
||
href="http://en.wikipedia.org/wiki/Super_Mario_Bros.">Super Mario
|
||
Bros</a> and one of <a
|
||
href="http://en.wikipedia.org/wiki/The_Great_Giana_Sisters">The Great
|
||
Giana Sisters</a>, but which let one configure the width and height of
|
||
the game.</p>
|
||
<h2 id="maffiodo2-readme.md"><a name="2014_maffiodo2"></a><a
|
||
href="/2014/maffiodo2/prog.c">2014/maffiodo2</a> (<a
|
||
href="/2014/maffiodo2/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2014/maffiodo2/try.sh">try.sh</a> script.</p>
|
||
<p>He also added the <a
|
||
href="/2014/maffiodo2/README.md#alternate-code">alternate code</a>
|
||
provided by the author.</p>
|
||
<h2 id="morgan-readme.md"><a name="2014_morgan"></a><a
|
||
href="/2014/morgan/prog.c">2014/morgan</a> (<a
|
||
href="/2014/morgan/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2014/morgan/try.sh">try.sh</a> script.</p>
|
||
<h2 id="sinon-readme.md"><a name="2014_sinon"></a><a
|
||
href="/2014/sinon/prog.c">2014/sinon</a> (<a
|
||
href="/2014/sinon/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the code so that the game can play
|
||
automatically like it once did. The problem is that it expects a certain
|
||
file name which was <code>sinon.c</code>. The code now refers to
|
||
<code>prog.c</code>.</p>
|
||
<p>Cody also fixed the scripts <a
|
||
href="/2014/sinon/glock.sh">glock.sh</a> and <a
|
||
href="/2014/sinon/hecate.sh">hecate.sh</a> which did not work after
|
||
running either once as they compile <code>run.c</code> and then do
|
||
<code>./run | tee run.c</code> which overwrites it with output that is
|
||
not code.</p>
|
||
<p>Cody also added the <a href="/2014/sinon/try.sh">try.sh</a> script
|
||
that will first (if perl is installed) run the demo mode and then after
|
||
that it will run the above noted scripts in a loop until the user says
|
||
they do not want to try again (or they kill it). This is done this way
|
||
in case it jams (see README.md for details).</p>
|
||
<h2 id="skeggs-readme.md"><a name="2014_skeggs"></a><a
|
||
href="/2014/skeggs/prog.c">2014/skeggs</a> (<a
|
||
href="/2014/skeggs/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the Makefile to compile this entry in
|
||
modern systems. The problem was that the <code>CDEFINE</code> variable
|
||
in the Makefile was missing <code>'</code>s: the <code>#define CC</code>
|
||
is an actual string that is, in the Makefile,
|
||
<code>"${CC} -fPIC"</code>, which translates to whatever the compiler is
|
||
followed by a space followed by <code>-fPIC</code> but without the
|
||
<code>'</code>s it was incomplete and so would not compile. Cody didn’t
|
||
have a chance to really look at the compiler error.</p>
|
||
<p><a href="#yusuke">Yusuke</a> suggested that one should use
|
||
<code>-ldl</code> in the Makefile. This was not originally done because
|
||
it seemed to work but since it uses <code>dlsym()</code> it was added
|
||
later to make it more portable.</p>
|
||
<p>The program creates files in the working directory as part of how it
|
||
works (see the README.md file for details) so Cody made sure that
|
||
<code>make clobber</code> (via <code>make clean</code>) removes those
|
||
files and so that they are ignored by <code>.gitignore</code>.</p>
|
||
<h2 id="vik-readme.md-2"><a name="2014_vik"></a><a
|
||
href="/2014/vik/prog.c">2014/vik</a> (<a
|
||
href="/2014/vik/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2014/vik/try.sh">try.sh</a> script. Cody notes that there is a
|
||
bug that will show itself as one of the features does not work right.
|
||
The translation of the raw audio to text is buggy in some cases.</p>
|
||
<p>Cody also added an alternate version that is based on the author’s
|
||
remarks that will theoretically work for Microsoft Windows compilers (if
|
||
anything works in Windows :-) ). We have no way of testing this and if
|
||
anything has changed since 2014 that would break it we do not know.</p>
|
||
<h2 id="wiedijk-readme.md"><a name="2014_wiedijk"></a><a
|
||
href="/2014/wiedijk/prog.c">2014/wiedijk</a> (<a
|
||
href="/2014/wiedijk/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2014/wiedijk/try.sh">try.sh</a> script which is based on the
|
||
command to try in the ‘try’ section but improved so one can more easily
|
||
specify what ident tool they want to use and also change which sed to
|
||
use, should they want to. It also checks that both of these two tools
|
||
exist and are executable and it pipes it through less as it’s longer
|
||
than a page worth of output.</p>
|
||
<h1 id="section-23"><a name="2015"></a>2015</h1>
|
||
<h2 id="endoh3-readme.md-1"><a name="2015_burton"></a><a
|
||
href="/2015/burton/prog.c">2015/endoh3</a> (<a
|
||
href="/2015/burton/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the code so one can make use of the
|
||
echo feature, where the first character of the filename starts with
|
||
<code>e</code>. The only way it would work before that is if one did
|
||
something like:</p>
|
||
<div class="sourceCode" id="cb72"><pre
|
||
class="sourceCode sh"><code class="sourceCode bash"><span id="cb72-1"><a href="#cb72-1" aria-hidden="true" tabindex="-1"></a><span class="fu">ln</span> <span class="at">-sf</span> prog eprog</span>
|
||
<span id="cb72-2"><a href="#cb72-2" aria-hidden="true" tabindex="-1"></a><span class="va">PATH</span><span class="op">=</span><span class="va">$PATH</span>:. <span class="kw">;</span> <span class="ex">eprog</span> <span class="st">'...'</span></span></code></pre></div>
|
||
<p>since otherwise the first character would not be <code>e</code> but
|
||
rather a dot (<code>./eprog</code>). This was done by adding to the
|
||
Makefile <code>-include libgen.h</code> and adding to
|
||
<code>main()</code> after the variable declaration (<code>V*A;</code>)
|
||
the code:</p>
|
||
<div class="sourceCode" id="cb73"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb73-1"><a href="#cb73-1" aria-hidden="true" tabindex="-1"></a><span class="op">*</span>K<span class="op">=</span>basename<span class="op">(*</span>K<span class="op">);</span></span></code></pre></div>
|
||
<p>This was done for both the <a href="/2015/burton/prog.c">prog.c</a>
|
||
and <a href="/2015/burton/prog.alt.c">prog.alt.c</a>. The Makefile was
|
||
also updated to build <code>eprog</code> and <code>eprog.alt</code> to
|
||
make use of the feature more easily. Each is a new target (first in
|
||
<code>TARGET</code> and second in <code>ALT_TARGET</code>) which have a
|
||
prerequisite of <code>${PROG}</code> and <code>${PROG}.alt</code>
|
||
respectively both of which also copy the <code>prog</code>
|
||
(<code>prog</code> or <code>eprog</code>) to the respective
|
||
<code>eprog</code> (<code>eprog</code> or <code>eprog.alt</code>). With
|
||
these changes now one can easily use the echo feature the author
|
||
implemented.</p>
|
||
<p>Cody also added the <a href="/2015/burton/try.sh">try.sh</a> script.
|
||
This involved adding a text file, <a
|
||
href="/2015/burton/try.this.txt">try.this.txt</a>.</p>
|
||
<p>Cody also added <a href="/2015/burton/calc.1">calc.1</a> in place of
|
||
<code>calc.man</code> to have proper formatting (in the style of
|
||
<code>man(1)</code>). The <code>calc.man</code> was removed so as to not
|
||
have to maintain two copies of the same text.</p>
|
||
<p>Cody updated the Makefile to copy the <code>prog</code> to
|
||
<code>calc</code> and <code>prog.alt</code> to <code>calc.alt</code>.
|
||
<code>ecalc</code> and <code>ecalc.alt</code> also work. This is because
|
||
the program is called <code>calc</code> and is in documentation
|
||
including the man page. Thus one only need add a <code>./</code> to the
|
||
commands in the man page/README.md.</p>
|
||
<h2 id="endoh3-readme.md-2"><a name="2015_dogon"></a><a
|
||
href="/2015/dogon/prog.c">2015/endoh3</a> (<a
|
||
href="/2015/dogon/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> improved the Makefile so that one can easily
|
||
change the dimensions at compilation time via <code>make(1)</code>.</p>
|
||
<p>Cody also added alt code that is based on the author’s remarks,
|
||
suggesting that one change the value of <code>q</code> to a different
|
||
number, in order to see a bug that they avoided.</p>
|
||
<h2 id="endoh3-readme.md-3"><a name="2015_duble"></a><a
|
||
href="/2015/duble/prog.c">2015/endoh3</a> (<a
|
||
href="/2015/duble/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2015/duble/try.sh">try.sh</a> script.</p>
|
||
<h2 id="endoh2-readme.md-3"><a name="2015_endoh2"></a><a
|
||
href="/2015/endoh2/prog.c">2015/endoh2</a> (<a
|
||
href="/2015/endoh2/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="2015/endoh2/try.sh">try.sh</a> script.</p>
|
||
<h2 id="endoh3-readme.md-4"><a name="2015_endoh3"></a><a
|
||
href="/2015/endoh3/prog.c">2015/endoh3</a> (<a
|
||
href="/2015/endoh3/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed this to compile with Linux which was
|
||
having a problem with duplicate symbols of <code>main()</code>. The fix
|
||
is through the compiler option <code>-fcommon</code> which will let it
|
||
compile like it does with macOS.</p>
|
||
<p>Cody also added the <a href="/2015/endoh3/try.sh">try.sh</a> script
|
||
which makes use of the make rule he added (to enjoy the theme of the
|
||
entry, <a href="https://en.wikipedia.org/wiki/Back_to_the_Future">Back
|
||
to the Future</a> using this entry by simply typing
|
||
<code>make back_to</code> or <code>make mullender</code>) and then runs
|
||
the famous <a
|
||
href="/1984/mullender/mullender.c">1984/mullender.c</a>.</p>
|
||
<h2 id="endoh4-readme.md-1"><a name="2015_endoh4"></a><a
|
||
href="/2015/endoh4/prog.c">2015/endoh4</a> (<a
|
||
href="/2015/endoh4/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2015/endoh4/try.sh">try.sh</a> script.</p>
|
||
<h2 id="hou-readme.md-3"><a name="2015_hou"></a><a
|
||
href="/2015/hou/prog.c">2015/hou</a> (<a
|
||
href="/2015/hou/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added explicit linking of libm
|
||
(<code>-lm</code>) for systems that do not do this (Linux doesn’t seem
|
||
to but macOS does).</p>
|
||
<p>Cody also added the <a href="/2015/hou/try.sh">try.sh</a> script and
|
||
the large file <code>large</code> which the <code>try.sh</code> script
|
||
uses.</p>
|
||
<p>Cody also added the RFC 1321 text file, <a
|
||
href="/2015/hou/rfc1321.txt">rfc1321.txt</a> to the directory, to make
|
||
it so one need not download it, and which the README.md file now links
|
||
to.</p>
|
||
<h2 id="howe-readme.md"><a name="2015_howe"></a><a
|
||
href="/2015/howe/prog.c">2015/howe</a> (<a
|
||
href="/2015/howe/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2015/howe/try.sh">try.sh</a> script, downloaded the War and Peace
|
||
text file, fixed the <a href="/2015/howe/avgtime.sh">avgtime.sh</a>
|
||
script (it resulted in standard input errors in piping to
|
||
<code>bc(1)</code>) and added the <a href="/2015/howe/cc.1">cc.1</a> man
|
||
page as not all systems have it (in fact it’s <code>gcc(1)</code> from
|
||
Rocky Linux).</p>
|
||
<h2 id="mills1-readme.md"><a name="2015_mills1"></a><a
|
||
href="/2015/mills1/prog.c">2015/mills1</a> (<a
|
||
href="/2015/mills1/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2015/mills1/try.sh">try.sh</a> script which changes the
|
||
parameters to what we had in the judges’ remarks to make it easier (he
|
||
only died when he tried to mark a reminder complete on the other side of
|
||
the screen at the same time and he almost survived that, scoring at that
|
||
point over 90 - but this also involves good eye-hand coordination and
|
||
playing games like this in the past).</p>
|
||
<h2 id="mills2-readme.md"><a name="2015_mills2"></a><a
|
||
href="/2015/mills2/prog.c">2015/mills2</a> (<a
|
||
href="/2015/mills2/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2015/mills2/try.sh">try.sh</a> script.</p>
|
||
<h2 id="muth-readme.md"><a name="2015_muth"></a><a
|
||
href="/2015/muth/prog.c">2015/muth</a> (<a
|
||
href="/2015/muth/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2015/muth/try.sh">try.sh</a> script.</p>
|
||
<h2 id="endoh3-readme.md-5"><a name="2015_schweikhardt"></a><a
|
||
href="/2015/schweikhardt/prog.c">2015/endoh3</a> (<a
|
||
href="/2015/schweikhardt/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the build so that <code>EOF</code>
|
||
will be <code>-1</code> as the program assumes this. It was decided by
|
||
Cody to do <code>-UEOF -DEOF=-1</code> so as to not have to modify the
|
||
code any with C preprocessor directives (the preferred way) or changing
|
||
<code>EOF</code> to <code>-1</code>.</p>
|
||
<p>Cody also added the <a href="2015/schweikhardt/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="yang-readme.md"><a name="2015_yang"></a><a
|
||
href="/2015/yang/prog.c">2015/yang</a> (<a
|
||
href="/2015/yang/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed an unfortunate typo in the Makefile
|
||
that was preventing some of the files from compiling properly, trying
|
||
instead to compile already compiled code.</p>
|
||
<p>He also added explicit linking of libm (<code>-lm</code>) for systems
|
||
that do not do this (Linux seems to not but macOS does).</p>
|
||
<p>He also added the <a href="/2015/yang/try.sh">try.sh</a> script.</p>
|
||
<h1 id="section-24"><a name="2018"></a>2018</h1>
|
||
<h2 id="anderson-readme.md-1"><a name="2018_anderson"></a><a
|
||
href="/2018/anderson/prog.c">2018/anderson</a> (<a
|
||
href="/2018/anderson/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2018/anderson/try.sh">try.sh</a> and <a
|
||
href="/2018/anderson/try.alt.sh">try.alt.sh</a> scripts.</p>
|
||
<h2 id="algmyr-readme.md"><a name="2018_algmyr"></a><a
|
||
href="/2018/algmyr/prog.c">2018/algmyr</a> (<a
|
||
href="/2018/algmyr/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2018/algmyr/try.sh">try.sh</a> script.</p>
|
||
<h2 id="bellard-readme.md-1"><a name="2018_bellard"></a><a
|
||
href="/2018/bellard/prog.c">2018/bellard</a> (<a
|
||
href="/2018/bellard/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2018/bellard/try.sh">try.sh</a> script.</p>
|
||
<p>Cody also, out of abundance of caution, added a second arg to
|
||
<code>main()</code> because some versions of clang object to the number
|
||
of args of <code>main()</code>, saying that it must be 0, 2 or 3. The
|
||
version this has been observed in does not actually object to 1 arg but
|
||
it is entirely possible that this changes so a second arg (that’s not
|
||
needed and is unused) has been added just in case.</p>
|
||
<p>Cody also added explicit linking of libm (<code>-lm</code>) for
|
||
systems that do not do this (Linux doesn’t seem to but macOS does).</p>
|
||
<p>Cody also added <a href="/2018/bellard/README.md#alternate-code">alt
|
||
code</a> that should work for Windows, based on the author’s remarks.
|
||
The same thing with the number of args to <code>main()</code> that was
|
||
done in the original entry was done with this version as well.</p>
|
||
<h2 id="burton1-readme.md"><a name="2018_burton1"></a><a
|
||
href="/2018/burton1/prog.c">2018/burton1</a> (<a
|
||
href="/2018/burton1/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the <code>scripthd</code> script
|
||
(referred to <code>prog</code> not <code>./prog</code>) and renamed it
|
||
to <a href="/2018/burton1/scripthd.sh">scripthd.sh</a> to help browsers
|
||
and GitHub as far as downloading/displaying goes.</p>
|
||
<p>Cody also added the <a href="/2018/burton1/try.sh">try.sh</a> script
|
||
which also uses <code>scripthd.sh</code> to show how it differs from
|
||
<code>prog</code> itself.</p>
|
||
<h2 id="burton2-readme.md"><a name="2018_burton2"></a><a
|
||
href="/2018/burton2/prog.c">2018/burton2</a> (<a
|
||
href="/2018/burton2/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the <code>make test</code> rule: it
|
||
tried to run <code>tac(1)</code> (in systems that have that command)
|
||
rather than the entry itself which is called <code>tac</code> and the
|
||
<code>runtest</code> script (which he renamed to <code>runtest.sh</code>
|
||
for download/browser display purposes) was not executable.</p>
|
||
<p>Cody also renamed <code>manpage</code> to <code>manpage.sh</code> for
|
||
download/browser purposes and he did the same with <code>tokenfix</code>
|
||
to <code>tokenfix.sh</code> as well as <code>spotcheck</code> to
|
||
<code>spotcheck.sh</code>, <code>spotdiff</code> to
|
||
<code>spotdiff.sh</code>, <code>freqcount</code> to
|
||
<code>freqcount.sh</code> and <code>mkkeywords</code> to
|
||
<code>mkkeywords.sh</code>.</p>
|
||
<p>Cody also made the man page properly formatted for
|
||
<code>man(1)</code> and renamed it the file <code>tac.1</code>.</p>
|
||
<p>Cody also renamed <code>discrepancies</code> to
|
||
<code>discrepancies.md</code> and made it markdown format.</p>
|
||
<p>Cody added the <a href="/2018/burton2/tokcount.sh">tokcount.sh</a>
|
||
script which was included in the remarks of the author but not an
|
||
included file.</p>
|
||
<p>Finally Cody added the <a href="/2018/burton2/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="ciura-readme.md"><a name="2018_ciura"></a><a
|
||
href="/2018/ciura/prog.c">2018/ciura</a> (<a
|
||
href="/2018/ciura/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2018/ciura/try.sh">try.sh</a> and <a
|
||
href="/2018/ciura/try.alt.sh">try.alt.sh</a> scripts and the PDF file,
|
||
<a href="/2018/ciura/lexicon.pdf">lexicon.pdf</a>, that was a dead link,
|
||
restored from the Internet Wayback Machine.</p>
|
||
<h2 id="endoh1-readme.md-3"><a name="2018_endoh1"></a><a
|
||
href="/2018/endoh1/prog.c">2018/endoh1</a> (<a
|
||
href="/2018/endoh1/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2018/endoh1/try.sh">try.sh</a> script which shows the input files
|
||
one at a time and after each one is shown, it feeds it to the program,
|
||
redirecting the output to the respective GIF file. It then will inform
|
||
the user they should open it in a GIF viewer that can show animation in
|
||
animated GIF files. It offers an example command for macOS like the
|
||
judges did in their remarks. The input files offered includes the prog.c
|
||
as the author, <a href="#yusuke">Yusuke</a>, suggested that it too has a
|
||
secret.</p>
|
||
<h2 id="endoh2-readme.md-4"><a name="2018_endoh2"></a><a
|
||
href="/2018/endoh2/prog.c">2018/endoh2</a> (<a
|
||
href="/2018/endoh2/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the <a
|
||
href="/2018/endoh2/run.sh">run.sh</a> script (had commands that didn’t
|
||
exist and also didn’t work even after that was addressed) and added the
|
||
<a href="/2018/endoh2/try.sh">try.sh</a>, <a
|
||
href="/2018/endoh2/python.sh">python.sh</a> and <a
|
||
href="/2018/endoh2/python3.sh">python3.sh</a> scripts. The
|
||
<code>try.sh</code> script runs all three of the other scripts but each
|
||
allows one to send an interrupt in the loops and still continue to the
|
||
next script (if one does it when not in a loop it will exit the script).
|
||
The <code>make python</code> and <code>make python3</code> rules in the
|
||
Makefile now run the respective scripts.</p>
|
||
<h2 id="ferguson-readme.md"><a name="2018_ferguson"></a><a
|
||
href="/2018/ferguson/prog.c">2018/ferguson</a> (<a
|
||
href="/2018/ferguson/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a>, with irony well intended :-), fixed the <a
|
||
href="/2018/ferguson/test.sh">test.sh script</a> for portability,
|
||
shellcheck, making it executable and other things, fixed dead links in
|
||
the man page, updated the test-strings.txt file and other things as well
|
||
(like adding the <a href="/2018/ferguson/try.sh">try.sh</a> and <a
|
||
href="/2018/ferguson/try.alt.sh">try.alt.sh</a> scripts).</p>
|
||
<p>Landon notes that Cody will probably never finish changes in his
|
||
entries and that’s probably true: let’s just say that for the IOCCC I’m
|
||
(Cody) a weasel! :-) (but isn’t that kind of the point ? :-) )</p>
|
||
<h2 id="hou-readme.md-4"><a name="2018_hou"></a><a
|
||
href="/2018/hou/prog.c">2018/hou</a> (<a
|
||
href="/2018/hou/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added explicit linking of libm
|
||
(<code>-lm</code>) for systems that do not do this (Linux doesn’t seem
|
||
to but macOS does).</p>
|
||
<p>Cody also added the <a href="/2018/hou/try.sh">try.sh</a> script.</p>
|
||
<h2 id="mills-readme.md"><a name="2018_mills"></a><a
|
||
href="/2018/mills/prog.c">2018/mills</a> (<a
|
||
href="/2018/mills/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a>, based on the author’s remarks, made it
|
||
possible to save state between runs of the program so that one can
|
||
resume where they left off. It should be noted that there is a bug in
|
||
the entry (irrespective of save state option) where running
|
||
<code>./prog</code> twice in a row involves having to hit (the second
|
||
run) enter and then exit and then start the program again. Also if you
|
||
do add a file you should run <code>sync</code> prior to exiting or else
|
||
the file might not exist or it might be corrupt. See <a
|
||
href="/bugs.md#2018-mills">2018/mills in bugs.md</a> for more details on
|
||
the bug.</p>
|
||
<h2
|
||
id="poikola-readme.md2018poikolareadme.md"><a name="2018_poikola"></a><a
|
||
href="/2018/poikola/prog.c">2018/poikola</a>
|
||
([README.md[(/2018/poikola/README.md))</h2>
|
||
<p><a href="#cody">Cody</a> added the missing <code>docs</code> rule to
|
||
the Makefile that forms a PDF file. The rule requires the tool
|
||
<code>pdflatex</code>.</p>
|
||
<p>Cody also added the <a href="/2018/poikola/try.sh">try.sh</a>
|
||
script.</p>
|
||
<p><a href="/authors.html#Dave_Burton">Dave Burton</a>, during the
|
||
preview period, noticed a problem where the macOS
|
||
<code>Terminal.app</code> does not work properly for this program. We
|
||
added some additional notes on what might happen (it varies depending on
|
||
configuration).</p>
|
||
<h2 id="vokes-readme.md"><a name="2018_vokes"></a><a
|
||
href="/2018/vokes/prog.c">2018/vokes</a> (<a
|
||
href="/2018/vokes/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2018/vokes/try.sh">try.sh</a> script.</p>
|
||
<h2 id="yang-readme.md-1"><a name="2018_yang"></a><a
|
||
href="/2018/yang/prog.c">2018/yang</a> (<a
|
||
href="/2018/yang/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2018/yang/try.sh">try.sh</a> script. This script will ask if the
|
||
user wants to see some of the spoilers and only show them if they type
|
||
<code>y</code> or <code>Y</code>.</p>
|
||
<h1 id="section-25"><a name="2019"></a>2019</h1>
|
||
<h2 id="adamovsky-readme.md"><a name="2019_adamovsky"></a><a
|
||
href="/2019/adamovsky/prog.c">2019/adamovsky</a> (<a
|
||
href="/2019/adamovsky/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2019/adamovsky/try.sh">try.sh</a> script and the Unlambda file <a
|
||
href="/2019/adamovsky/crash.unl">crash.unl</a> which is in the judges’
|
||
remarks as to what can crash it - but it’s not a bug, it’s a
|
||
feature.</p>
|
||
<h2 id="burton-readme.md"><a name="2019_burton"></a><a
|
||
href="/2019/burton/prog.c">2019/burton</a> (<a
|
||
href="/2019/burton/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the Makefile which had a bad
|
||
character, a ‘%’ instead of a ‘$’ which caused a rule to fail.</p>
|
||
<p>Cody also added the <a href="/2019/burton/try.sh">try.sh</a> script
|
||
which shows a side-by-side comparison on several files of the entry and
|
||
<code>wc(1)</code> as well as running <code>make test</code>.</p>
|
||
<p>Cody also fixed the script <a
|
||
href="/2019/burton/check.sh">check.sh</a> (renamed from
|
||
<code>check</code>) in case <code>x</code> is specified and is not
|
||
executable and also made it satisfy ShellCheck. He also made ShellCheck
|
||
not be a cow and/or (to use Bart Simpson’s advice :-) ) ‘not have a cow’
|
||
about certain things (including one thing it was wrong about) in <a
|
||
href="/2019/burton/cow.sh">cow.sh</a> (which was renamed from
|
||
<code>cow</code>) <strike>moo</strike>too.</p>
|
||
<p>Cody also renamed the file <code>on.one.liners</code> to <a
|
||
href="/2019/burton/on.one.liners.txt">on.one.liners.txt</a> to help with
|
||
browsers/GitHub.</p>
|
||
<h2 id="ciura-readme.md-1"><a name="2019_ciura"></a><a
|
||
href="/2019/ciura/prog.c">2019/ciura</a> (<a
|
||
href="/2019/ciura/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed an invalid bytes error in
|
||
<code>tr</code> in the scripts. This does not mean that they will
|
||
produce any output, though, as they provide expect all letters and that
|
||
makes it harder to form perfect pangrams. On the subject of German
|
||
umlauts and Eszett (ß) see the <a href="/bugs.md#2019-ciura">entry in
|
||
bugs.md</a>.</p>
|
||
<p>Cody also fixed the Makefile so that the alt code would be built when
|
||
running <code>make alt</code>.</p>
|
||
<p>Cody converted the PS file linked to by the author to a PDF (<a
|
||
href="/2019/ciura/fasc5c.pdf">fasc5c.pdf</a>) and added it to the
|
||
website.</p>
|
||
<p>Cody also added the <a href="/2019/ciura/try.sh">try.sh</a> and <a
|
||
href="/2019/ciura/try.alt.sh">try.alt.sh</a> scripts.</p>
|
||
<p>Finally he added the scripts for the different languages that use the
|
||
alt version but with the caveat that only English appears to work. See
|
||
the <a href="/bugs.md#2019-ciura">entry in bugs.md</a> for more
|
||
details.</p>
|
||
<h2 id="diels-grabsch1-readme.md"><a name="2019_diels-grabsch1"></a><a
|
||
href="/2019/diels-grabsch1/prog.c">2019/diels-grabsch1</a> (<a
|
||
href="/2019/diels-grabsch1/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2019/diels-grabsch1/try.sh">try.sh</a> script.</p>
|
||
<p>Cody also added the file <a
|
||
href="/2019/diels-grabsch1/Shakespeare.txt">Shakespeare.txt</a> from <a
|
||
href="/2019/mills/README.md">2019/mills</a> (after running
|
||
<code>make</code>) so that one can not worry about having the entire
|
||
IOCCC winning entry tree (or at least the 2019 tree each entry in a
|
||
subdirectory). This is more important as there is discussion of having
|
||
tarballs for each individual entry as a convenience.</p>
|
||
<h2 id="diels-grabsch2-readme.md"><a name="2019_diels-grabsch2"></a><a
|
||
href="/2019/diels-grabsch2/prog.c">2019/diels-grabsch2</a> (<a
|
||
href="/2019/diels-grabsch2/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2019/diels-grabsch2/try.sh">try.sh</a> script. This script will
|
||
try and show the difference (i.e. the same output) between the program
|
||
and the result of <code>sha512sum</code> or <code>shasum -a 512</code>
|
||
if either of those tools can be found but otherwise it’ll just run the
|
||
program itself, showing its own sha512sum value.</p>
|
||
<h2 id="dogon-readme.md"><a name="2019_dogon"></a><a
|
||
href="/2019/dogon/prog.c">2019/dogon</a> (<a
|
||
href="/2019/dogon/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added explicit linking of libm
|
||
(<code>-lm</code>) for systems that do not do this (Linux does not seem
|
||
to but macOS does).</p>
|
||
<p>He also fixed the Makefile so that it compiles with clang in
|
||
Linux.</p>
|
||
<p>He also added the <a href="/2019/dogon/try.sh">try.sh</a> script.</p>
|
||
<p>He also made it possible to easily redefine the memory macro
|
||
<code>Z</code> at compilation time by modifying the Makefile.</p>
|
||
<p>He fixed a link in the spoiler source code. As a spoiler it felt more
|
||
important that this was done (some typos were fixed as well but only
|
||
some - the purpose was to only correct spelling and only some, not to
|
||
change wording or anything else).</p>
|
||
<h2 id="duble-readme.md"><a name="2019_duble"></a><a
|
||
href="/2019/duble/prog.c">2019/duble</a> (<a
|
||
href="/2019/duble/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> made the <code>make fullscreen</code> more
|
||
portable by not relying on <code>stty(1)</code> and <code>sed(1)</code>
|
||
but rather it just uses <code>tput(1)</code>. He also made it so that if
|
||
<code>tput(1)</code> is not found it tells the user an easier way to
|
||
compile the full screen size rather than having to modify the Makefile.
|
||
This done with a script, <a
|
||
href="/2019/duble/fullscreen.sh">fullscreen.sh</a>, to simplify the
|
||
Makefile and provide an easy way to tell the user how to compile it,
|
||
assuming that the environmental variables <code>LINES</code> and
|
||
<code>COLUMNS</code> are set. But even if they’re not set it explains
|
||
how to easily compile the program to a specific size. Note that
|
||
<code>LINES</code> and <code>COLUMNS</code> is not available to scripts
|
||
so it can’t make use of them that way.</p>
|
||
<h2 id="endoh-readme.md"><a name="2019_endoh"></a><a
|
||
href="/2019/endoh/prog.c">2019/endoh</a> (<a
|
||
href="/2019/endoh/README.md%5D">README.md</a>)</h2>
|
||
<p>As this is a backtrace quine having the optimiser enabled is not a
|
||
good idea so <a href="#cody">Cody</a> disabled it. For this same reason
|
||
he also added the <code>-g</code> flag to the compilation as debugging
|
||
symbols might just be useful for an entry that’s supposed to segfault
|
||
:-)</p>
|
||
<p>Cody also added the simple <a href="/2019/endoh/ascii.c">ascii.c</a>
|
||
that (while it has an arg) prints out the character of the ASCII value
|
||
(uses <code>isascii(3)</code> first). This combined with the <a
|
||
href="/2019/endoh/try.sh">try.sh</a> script that he added allows one to
|
||
easily reconstruct the source code through GDB by the fact it’s a
|
||
backtrace quine.</p>
|
||
<h2 id="giles-readme.md"><a name="2019_giles"></a><a
|
||
href="/2019/giles/prog.c">2019/giles</a> (<a
|
||
href="/2019/giles/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2019/giles/try.sh">try.sh</a> script.</p>
|
||
<h2 id="karns-readme.md"><a name="2019_karns"></a><a
|
||
href="/2019/karns/prog.c">2019/karns</a> (<a
|
||
href="/2019/karns/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> reported that with <code>-O</code> level
|
||
> 0 this program segfaults (sometimes?). He’s not sure why as it
|
||
worked fine before on the same systems tested but <code>-O0</code>
|
||
appears to fix the problem in both macOS and Linux. Perhaps this is the
|
||
problem that the author reported where it sometimes segfaults but Cody
|
||
did not try debugging it since it works with <code>-O0</code>.</p>
|
||
<p>He also added the script <a href="/2019/karns/try.sh">try.sh</a> to
|
||
showcase the entry a bit more easily.</p>
|
||
<h2 id="lynn-readme.md"><a name="2019_lynn"></a><a
|
||
href="/2019/lynn/prog.c">2019/lynn</a> (<a
|
||
href="/2019/lynn/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2019/lynn/try.sh">try.sh</a> script.</p>
|
||
<p>Cody also added the <a
|
||
href="/2019/lynn/example-1.txt">example-1.txt</a> and <a
|
||
href="/2019/lynn/example-2.txt">example-2.txt</a> text files from <a
|
||
href="/2018/vokes/README.md">2018/vokes</a> so that the entry does not
|
||
rely on any other entry existing.</p>
|
||
<h2 id="mills-readme.md-1"><a name="2019_mills"></a><a
|
||
href="/2019/mills/prog.c">2019/mills</a> (<a
|
||
href="/2019/mills/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2019/mills/try.sh">try.sh</a> script.</p>
|
||
<h2
|
||
id="poikola-readme.md2019poikolareadme.md"><a name="2019_poikola"></a><a
|
||
href="/2019/poikola/prog.c">2019/poikola</a>
|
||
([README.md[(/2019/poikola/README.md))</h2>
|
||
<p><a href="#cody">Cody</a> added the missing <code>docs</code> rule to
|
||
the Makefile that forms a PDF file. The rule requires the tool <a
|
||
href="https://tug.org/applications/pdftex/index.html">pdflatex</a>.</p>
|
||
<p>Cody also added the <a
|
||
href="/2019/poikola/README.md#alternate-code">alternate code</a>.</p>
|
||
<p>Cody also added the <a href="/2019/poikola/try.sh">try.sh</a> and <a
|
||
href="/2019/poikola/try.alt.sh">try.alt.sh</a> scripts.</p>
|
||
<p>Cody also disabled the optimiser because the author stated that for
|
||
clang the levels [0123s] work okay but with GCC (6) they only said level
|
||
0 works, suggesting that with some versions of GCC it might not be
|
||
correct with levels != 0 and since 0 works with clang that’s okay.
|
||
Similarly, the same for C standards tested: <code>gnu17</code> was not
|
||
tested but <code>gnu11</code> was so the standard was set to
|
||
<code>gnu11</code>.</p>
|
||
<h2 id="yang-readme.md-2"><a name="2019_yang"></a><a
|
||
href="/2019/yang/prog.c">2019/yang</a> (<a
|
||
href="/2019/yang/README.md%5D">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2019/yang/try.sh">try.sh</a> script which also involved slightly
|
||
updating the <a href="/2019/yang/sample_input.txt">sample_input.txt</a>
|
||
file (removed trailing newlines as it resulted in <code>diff</code>
|
||
showing differences when it shouldn’t) and adding the <a
|
||
href="/2019/yang/ioccc.txt">ioccc.txt</a> file.</p>
|
||
<h1 id="section-26"><a name="2020"></a>2020</h1>
|
||
<h2 id="burton-readme.md-1"><a name="2020_burton"></a><a
|
||
href="/2020/burton/prog.c">2020/burton</a> (<a
|
||
href="/2020/burton/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the script <a
|
||
href="/2020/burton/check_be.sh">check_be.sh</a>: it assumed that
|
||
<code>prog_be</code> was in <code>PATH</code> which is unlikely so it
|
||
was changed to <code>./prog_be</code>.</p>
|
||
<p>Cody also improved the <code>make test</code> rule (which uses
|
||
<code>check_be.sh</code> and the Little Endian counterpart) so that it
|
||
shows that the files are identical rather than showing nothing at
|
||
all.</p>
|
||
<p>Cody also added the <a href="/2020/burton/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="carlini-readme.md"><a name="2020_carlini"></a><a
|
||
href="/2020/carlini/prog.c">2020/carlini</a> (<a
|
||
href="/2020/carlini/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2020/carlini/try.sh">try.sh</a> script which although at first
|
||
glance might not appear to have a point, it actually does, namely
|
||
showing how you can automate play and then reminding you to actually
|
||
play for real, with a friend, whether that’s real or imagined.</p>
|
||
<h2 id="endoh2-readme.md-5"><a name="2020_endoh2"></a><a
|
||
href="/2020/endoh2/prog.c">2020/endoh2</a> (<a
|
||
href="/2020/endoh2/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> copied the files from the spoiler.zip file
|
||
(from his copy during the preview period) that was password protected
|
||
with a password that was no longer known.</p>
|
||
<p>He also added the <a href="/2020/endoh2/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="endoh3-readme.md-6"><a name="2020_endoh3"></a><a
|
||
href="/2020/endoh3/prog.c">2020/endoh3</a> (<a
|
||
href="/2020/endoh3/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> fixed the script <a
|
||
href="/2020/endoh3/run_clock.sh">run_clock.sh</a> which gave a funny
|
||
error when running it:</p>
|
||
<div class="sourceCode" id="cb74"><pre
|
||
class="sourceCode sh"><code class="sourceCode bash"><span id="cb74-1"><a href="#cb74-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> ./run_clock.sh</span>
|
||
<span id="cb74-2"><a href="#cb74-2" aria-hidden="true" tabindex="-1"></a><span class="ex">-bash:</span> ./run_clock.sh: cannot execute: required file not found</span></code></pre></div>
|
||
<p>If run from within vim a different error message occurred:</p>
|
||
<pre><code>/bin/bash: ./run_clock.sh: /usr/bin/end: bad interpreter: No such file or directory</code></pre>
|
||
<p>though this was only noticed later on after it was fixed.</p>
|
||
<p>What was wrong? A typo in the shebang which had
|
||
<code>/usr/bin/end</code> instead of <code>/usr/bin/env</code>. Anyone
|
||
who knows Cody would know that he’d zoom in on that quite quick.</p>
|
||
<p>Also if <code>clock</code> did not exist and one tried to run the
|
||
script it would make an invalid <code>clock.c</code> which meant it
|
||
could not compile so it now runs <code>make clock</code> first.</p>
|
||
<p>Cody also reported (during the preview period of 2020) for some
|
||
systems (at some point?) like macOS the use of <code>make clock</code>
|
||
would not work due possibly to a timing issue so <a
|
||
href="#yusuke">Yusuke</a> changed it to compile the <a
|
||
href="/2020/endoh3/clock.c">clock.c</a> file directly (this might have
|
||
been fixed in the Makefile later on but it doesn’t hurt to keep it in
|
||
and this way it isn’t a problem in any system). How Cody remembers this
|
||
minor detail more than three years ago is something that many people
|
||
might wonder but he also once told us that if someone moves something of
|
||
his even a millimetre from where it was he knows it so he might be
|
||
called unusual (and he argues, with pride, eccentric :-) ) :-)</p>
|
||
<p>Cody also added the <a
|
||
href="/2020/endoh3/run_clock.alt.sh">run_clock.alt.sh</a> script which
|
||
is analogous to the <a href="/2020/endoh3/run_clock.sh">run_clock.sh</a>
|
||
but for the alt code provided by the author, Yusuke.</p>
|
||
<h2 id="ferguson1-readme.md"><a name="2020_ferguson1"></a><a
|
||
href="/2020/ferguson1/prog.c">2020/ferguson1</a> (<a
|
||
href="/2020/ferguson1/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a>, with intentional irony here :-), fixed
|
||
formatting, links and typos in various files.</p>
|
||
<p>He improved the <a href="/2020/ferguson1/termcaps.c">termcaps.c test
|
||
utility</a>, bug fixed <a href="/2020/ferguson1/play.sh">play.sh</a>,
|
||
fixed other scripts and the Makefile, changed some files to be markdown
|
||
(and fixed problems that he caused in doing so :-) ), fixed typos and
|
||
formatting and he also fixed some issues that occurred when files were
|
||
renamed to <code>.md</code> from <code>.markdown</code>.</p>
|
||
<p>Most importantly he also added some corrections to the vital <a
|
||
href="/2020/ferguson1/chocolate-cake.md">Double layered chocolate fudge
|
||
cake recipe</a> :-)</p>
|
||
<p>Yes the irony here is as rich as the chocolate cake: the question is
|
||
do you know how rich it is? If not and you like chocolate I (that is
|
||
Cody :-) ) highly recommend you give it a go! :-) You’re welcome to ask
|
||
me questions if you wish and I encourage you to do so as the cake is
|
||
quite picky!</p>
|
||
<h2 id="ferguson2-readme.md"><a name="2020_ferguson2"></a><a
|
||
href="/2020/ferguson2/prog.c">2020/ferguson2</a> (<a
|
||
href="/2020/ferguson2/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a>, with intentional irony here :-), fixed
|
||
formatting, links and typos in various files.</p>
|
||
<p>He also added the <a href="/2020/ferguson2/try.sh">try.sh</a>
|
||
script.</p>
|
||
<p>He also added the <a
|
||
href="/2020/ferguson2/README.md#alternate-code">alt code</a> and the <a
|
||
href="/2020/ferguson2/try.alt.sh">try.alt.sh</a> script.</p>
|
||
<p>The try scripts involved the addition of a text file, <a
|
||
href="/2020/ferguson2/key.txt">key.txt</a> which has the key of the file
|
||
the judges added in <a
|
||
href="/2020/ferguson2/try.this.txt">try.this.txt</a> which itself was
|
||
based on something the author (Cody :-) ) submitted in the first
|
||
place.</p>
|
||
<p>He also fixed some issues that occurred when files were renamed to
|
||
<code>.md</code> from <code>.markdown</code>.</p>
|
||
<p>Most importantly he also added some corrections to the vital <a
|
||
href="/2020/ferguson2/chocolate-cake.md">Double layered chocolate fudge
|
||
cake recipe</a>, enciphered though it is :-)</p>
|
||
<p>Yes the irony here is as rich as the chocolate cake: the question is
|
||
do you know how rich it is? If not and you like chocolate I (that is
|
||
Cody :-) ) highly recommend you give it a go! :-) You’re welcome to ask
|
||
me questions if you wish and I encourage you to do so as the cake is
|
||
quite picky!</p>
|
||
<h2 id="giles-readme.md-1"><a name="2020_giles"></a><a
|
||
href="/2020/giles/prog.c">2020/giles</a> (<a
|
||
href="/2020/giles/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2020/giles/try.sh">try.sh</a> script. This script does the
|
||
conversion of <code>pi.wav</code> (showing the digits) and also converts
|
||
the number for <code>jenny.wav</code> and a number Cody ‘came up with’:
|
||
one that resembles <code>IOCCC 28</code>: <code>10666-28</code>. The
|
||
<code>6</code> is the closest to <code>C</code> in his head even though
|
||
it’s not perfect.</p>
|
||
<p>If <code>play(1)</code> from SoX is not installed the script checks
|
||
for <code>aplay(1)</code>. If neither are installed it warns the user
|
||
about this, linking to the FAQ about it, and tells them they will have
|
||
to play the WAV files manually. Otherwise it’ll use the program to play
|
||
the WAV files (and in one case <code>stdout</code>).</p>
|
||
<h2 id="kurdyukov1-readme.md"><a name="2020_kurdyukov1"></a><a
|
||
href="/2020/kurdyukov1/prog.c">2020/kurdyukov1</a> (<a
|
||
href="/2020/kurdyukov1/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2020/kurdyukov1/try.sh">try.sh</a> script.</p>
|
||
<h2 id="kurdyukov2-readme.md"><a name="2020_kurdyukov2"></a><a
|
||
href="/2020/kurdyukov2/prog.c">2020/kurdyukov2</a> (<a
|
||
href="/2020/kurdyukov2/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2020/kurdyukov2/try.sh">try.sh</a> script.</p>
|
||
<p>Cody also added <code>-L</code>/<code>-I</code> paths to the Makefile
|
||
to let this compile more easily if the user has installed the
|
||
appropriate library with <a href="https://www.macports.org">MacPorts</a>
|
||
(with the default MacPorts prefix <code>/opt/local</code>).</p>
|
||
<p>Cody also fixed the script <a
|
||
href="2020/kurdyukov2/makegif.sh">makegif.sh</a> in a variety of ways:
|
||
shellcheck(1), make sure the program is compiled first (allowing one to
|
||
specify which compiler to use with
|
||
<code>CC=foo ./makegif.sh ...</code>), checking that
|
||
<code>convert(1)</code> is found and that it worked properly (linking to
|
||
the proper FAQ entry if not installed or it fails).</p>
|
||
<h2 id="kurdyukov3-readme.md"><a name="2020_kurdyukov3"></a><a
|
||
href="/2020/kurdyukov3/prog.c">2020/kurdyukov3</a> (<a
|
||
href="/2020/kurdyukov3/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2020/kurdyukov3/try.sh">try.sh</a> script.</p>
|
||
<p>He also added a link that has much more details about this phenomenon
|
||
to the README.md. Naturally he’s one of the ones who can read text even
|
||
if it’s even more jumbled but we know of others too.</p>
|
||
<h2 id="kurdyukov4-readme.md"><a name="2020_kurdyukov4"></a><a
|
||
href="/2020/kurdyukov4/prog.c">2020/kurdyukov4</a> (<a
|
||
href="/2020/kurdyukov4/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2020/kurdyukov4/try.sh">try.sh</a> script.</p>
|
||
<p>Cody also added from <a href="/2019/mills/README.md">2019/mills</a>
|
||
the text file <a
|
||
href="/2020/kurdyukov4/Shakespeare.txt">Shakespeare.txt</a> as we are
|
||
considering to have each entry have a tarball with the entry by
|
||
itself.</p>
|
||
<p>Also, to explain the confusing to most people award, Cody gave a
|
||
quick translation of <code>lámatyávë</code>, which comes from History of
|
||
Middle-earth [HoMe], volume X, Morgoth’s Ring, which he also has (and
|
||
which is part of the 12 volume set by the late Christopher Tolkien, son
|
||
and literary executor and heir to J.R.R. Tolkien).</p>
|
||
<h2 id="otterness-readme.md"><a name="2020_otterness"></a><a
|
||
href="/2020/otterness/prog.c">2020/otterness</a> (<a
|
||
href="/2020/otterness/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the MIDI files <a
|
||
href="/2020/otterness/cvikl.mid">cvikl.mid</a> and <a
|
||
href="/2020/otterness/entertainer.mid">entertainer.mid</a> from the URLs
|
||
we suggested so that one need not download them and to make sure they
|
||
can always be obtained even if the domain or link goes dead.</p>
|
||
<p>Cody also added the <a href="/2020/otterness/try.sh">try.sh</a>
|
||
script.</p>
|
||
<h2 id="tsoj-readme.md"><a name="2020_tsoj"></a><a
|
||
href="/2020/tsoj/prog.c">2020/tsoj</a> (<a
|
||
href="/2020/tsoj/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added <a
|
||
href="/2020/tsoj/README.md#alternate-code">alternate code</a> that will
|
||
feel more at home for vi users. One might still end up cursing (see the
|
||
README.md file) but probably a lot less :-)</p>
|
||
<h2 id="yang-readme.md-3"><a name="2020_yang"></a><a
|
||
href="/2020/yang/prog.c">2020/yang</a> (<a
|
||
href="/2020/yang/README.md">README.md</a>)</h2>
|
||
<p><a href="#cody">Cody</a> added the <a
|
||
href="/2020/yang/try.sh">try.sh</a> script.</p>
|
||
<p>Cody also added a make rule (<code>make cppp</code>) for the author’s
|
||
provided C++ code that can preprocess the generated output to make them
|
||
more acceptable to typical compilers. See the README.md for more
|
||
details.</p>
|
||
<h1 id="general-thanks"><a name="general_thanks"></a>General thanks</h1>
|
||
<h2
|
||
id="makefiles-fixes-and-improvements"><a name="makefiles_fixes_improvements"></a>Makefiles
|
||
fixes and improvements</h2>
|
||
<p><a href="#cody">Cody</a> fixed the top level Makefile
|
||
<code>all</code> rule which had a stray <code>fi;</code> without an
|
||
<code>if</code> so the rule failed entirely.</p>
|
||
<p>Cody also made a variety of other changes in all the Makefiles,
|
||
sometimes to get an entry to work, all noted above, but he also
|
||
<strong>improved them all</strong> in at least one or two ways. Some of
|
||
the changes made are below.</p>
|
||
<p>Cody changed the <code>LIBS</code> variable to <code>LDFLAGS</code>
|
||
as that is the standard variable. This simplifies compiling without
|
||
having to modify the Makefile which can be useful if something changes
|
||
or if someone is trying to fix an entry but forgets to change the
|
||
Makefile or even if they don’t want to make a change due to a temporary
|
||
test. These would of course depend on the compiler invocation but since
|
||
<code>LDFLAGS</code> is standard it is more likely to be used by default
|
||
so no need to check the Makefiles.</p>
|
||
<p>Sometimes there were bad characters or rules that caused the entry to
|
||
fail to compile or not work in some way.</p>
|
||
<p>Where useful he added some notes to the Makefiles during compilation
|
||
to let one know of certain problems or features that matter for instance
|
||
having to disable the optimiser or enabling (in one case)
|
||
<code>-g</code>.</p>
|
||
<p>Also, rather than check <code>$(CC)</code> for exact matches of
|
||
<code>gcc</code> or <code>clang</code> it now is that if
|
||
<code>$(CC)</code> contains <code>gcc</code> or contains
|
||
<code>clang</code> then the specific actions related to the specific
|
||
compiler will be done (priority is gcc then clang). This is useful
|
||
because it’s not guaranteed that the compiler names for <code>gcc</code>
|
||
or <code>clang</code> will be exactly that; in macOS for instance it can
|
||
happen that they are in fact different names especially if one installs
|
||
them from something like <a href="https://www.macports.org">MacPorts</a>
|
||
or possibly <a href="https://brew.sh">Homebrew</a>.</p>
|
||
<p>There were some other fixes as well including mass typo fixes in the
|
||
Makefiles (though that usually does not mean it is worth a thank you
|
||
note it might be worth noting in this case). Other times it was enabling
|
||
or disabling the optimiser to fix an entry, sometimes causing other
|
||
problems that also had to be fixed, a good example being <a
|
||
href="#1986marshall-readmemd">1986/marshall</a> (see the <a
|
||
href="/1986/marshall/compilers.md">compilers.md</a> for the amusing
|
||
details and all that had to be done to fix it).</p>
|
||
<p>There was a ‘problem’ where <code>${MAKE}</code> was
|
||
<code>$(MAKE)</code>: this doesn’t break anything but it is inconsistent
|
||
with the rest of the <code>${foo}</code> tools even if by tradition it
|
||
is <code>$(MAKE)</code>.</p>
|
||
<p>Cody also added missing variables like <code>BASH</code> and
|
||
<code>PDFLATEX</code> to the <a href="/var.mk">var.mk</a> file and
|
||
removed another that was deemed problematic or undesired. Other variable
|
||
names had typos in them.</p>
|
||
<p>A comment was missing for the <code>diff_alt_orig</code> rule in all
|
||
the Makefiles and this, along with many other fixes and changes to the
|
||
Makefiles were made by Cody’s <a
|
||
href="https://github.com/xexyl/sgit">sgit tool</a> but many other
|
||
changes he did manually.</p>
|
||
<h2
|
||
id="consistency-improvements"><a name="consistency_improvements"></a>Consistency
|
||
improvements</h2>
|
||
<p><a href="#cody">Cody</a>, being the IOCCC’s resident corrections
|
||
officer :-) (and a fine one at that, we think :-) ), made many, many
|
||
typ0 (… :-) ) fixes throughout the README.md files, scripts, other data
|
||
files, Makefiles (see above) etc.</p>
|
||
<p>He also updated the formatting of the README.md files (after renaming
|
||
the old files to README.md) to proper markdown.</p>
|
||
<p>Where possible he made the presentation of the entries much more
|
||
consistent across the entries of all the years as well as other files.
|
||
This is not possible for everything (the remarks of authors, for
|
||
instance, cannot be and should not be made consistent but adding
|
||
markdown where necessary in the remarks is).</p>
|
||
<p>A lot of these fixes were done with his <a
|
||
href="https://github.com/xexyl/sgit">sgit tool</a> as well but many were
|
||
done manually too.</p>
|
||
<h2 id="thank-you-honor-roll"><a name="thank_you_honor_roll"></a>Thank
|
||
you honor roll</h2>
|
||
<p>There are a number of people who have contributed to several thousand
|
||
changes, fixes and important improvements and one who has literally (or
|
||
numerically :-) ) contributed thousands, that we wish to thank.</p>
|
||
<h3 id="authors">Authors</h3>
|
||
<p>A good number of the <a
|
||
href="https://www.ioccc.org/authors.html">wining entries of the
|
||
IOCCC</a> tested, identified and helped correct and/or improve the
|
||
write-ups of fellow IOCCC entries for the year that they won. The list
|
||
of those entries is too long to mention: nevertheless the <a
|
||
href="https://www.ioccc.org/judges.html">IOCCC judges</a> <strong>VERY
|
||
MUCH APPRECIATE</strong> those who helped improve the presentation of
|
||
their fellow IOCCC entries.</p>
|
||
<h3 id="cody-boone-ferguson"><a name="cody"></a>Cody Boone Ferguson</h3>
|
||
<p>We call out the extensive contributions of <a
|
||
href="https://www.ioccc.org/authors.html#Cody_Boone_Ferguson">Cody Boone
|
||
Ferguson</a> who is responsible for most of the improvements and fixes
|
||
including many <strong>EXTREMELY HARD bug fixes</strong> like <a
|
||
href="/thanks-for-help.md#1988_phillipps">1988/phillipps</a>, <a
|
||
href="/thanks-for-help.md#1992_vern">1992/vern</a>, <a
|
||
href="/thanks-for-help.md#2001_anonymous">2001/anonymous</a>, <a
|
||
href="/thanks-for-help.md#2004_burley">2004/burley</a> and <a
|
||
href="/thanks-for-help.md#2005_giljade">2005/giljade</a>, making entries
|
||
like <a href="/thanks-for-help.md#1985_sicherman">1985/sicherman</a> and
|
||
<a href="/thanks-for-help.md#1986_wall">1986/wall</a> not need
|
||
<code>-traditional-cpp</code> (all <strong>EXTREMELY HARD</strong>),
|
||
fixing entries to work with clang (some <strong>EXTREMELY HARD</strong>
|
||
like <a href="/thanks-for-help.md#1991_dds">1991/dds</a>) or as much as
|
||
possible (<a href="/thanks-for-help.md#1989_westley">1989/westley</a>, a
|
||
true masterpiece that is <strong>INCREDIBLY HARD, <em>MUCH MORE SO</em>
|
||
than any other fix!</strong>), porting entries to macOS (some
|
||
<strong>EXTREMELY HARD</strong> like <a
|
||
href="/thanks-for-help.md#1998_schweikh1">1998/schweikh1</a>, fixing
|
||
code like <a
|
||
href="/thanks-for-help.md#2001_herrmann2">2001/herrmann2</a> to work in
|
||
both 32-bit/64-bit which <em>can be</em> <strong>EXTREMELY
|
||
HARD</strong>, providing alternate code where useful/necessary,
|
||
improving <strong>ALL <em>Makefiles</em></strong>, writing scripts to
|
||
greatly simplify running many of the entries and writing <a
|
||
href="https://github.com/xexyl/sgit">sgit</a> to easily run
|
||
<code>sed</code> on files in the repo to help build the website.</p>
|
||
<p>Cody Boone Ferguson also used one of his own tools to detect many
|
||
dead links. While the tool was not perfect it went a long way to uncover
|
||
a good number of bad, broken or otherwise invalid links. It was a very
|
||
laborious task to copy and paste problematic links into the <a
|
||
href="https://web.archive.org">Internet Wayback Machine</a> in an effort
|
||
to try and find otherwise lost content. A good number of links that now
|
||
refer to something in the <a href="https://web.archive.org">Internet
|
||
Wayback Machine</a> replace bad, broken, or otherwise invalid links are
|
||
thanks to Cody’s efforts! Another tool he wrote detected inconsistent
|
||
award titles in the README files and CSV file (that he generated from
|
||
the SQL file).</p>
|
||
<p><strong>THANK YOU VERY MUCH</strong> for your extensive efforts in
|
||
helping improve the IOCCC presentation of past IOCCC entries and fixing
|
||
almost all past entries for modern systems!</p>
|
||
<h3 id="yusuke-endoh"><a name="yusuke"></a>Yusuke Endoh</h3>
|
||
<p><a href="https://www.ioccc.org/authors.html#Yusuke_Endoh">Yusuke
|
||
Endoh</a> supplied a number of important bug fixes to a number of past
|
||
IOCCC entries. Some of those fixes were <strong>EXTREMELY TECHNICALLY
|
||
CHALLENGING</strong> such as <a
|
||
href="/thanks-for-help.md#1989_robison">1989/robison</a>, <a
|
||
href="/thanks-for-help.md#1990_cmills">1990/cmills</a>, <a
|
||
href="/thanks-for-help.md#1992_lush">1992/lush</a> and <a
|
||
href="/thanks-for-help.md#2001_ctk">2001/ctk</a>. <strong>THANK YOU VERY
|
||
MUCH</strong> for your help!</p>
|
||
<h2 id="did-we-neglect-to-credit-you"><a name="neglect"></a>Did we
|
||
neglect to credit you?</h2>
|
||
<p>If you submitted a fix to an entry for which you are not the author,
|
||
and your fix is accepted (in part or as a whole), we would be happy to
|
||
add you to this <a href="#thank_you_honor_roll">honor roll list</a>.</p>
|
||
<p>If you believe we incorporated one of your fixes to an IOCCC winning
|
||
entry (that you are not the author of) for which we neglected to mention
|
||
in this file, please <a href="contact.html">contact the IOCCC</a> so
|
||
that we may correct the record.</p>
|
||
|
||
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||
|
||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
|
||
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
|
||
<!-- START: this line starts content from: inc/end-row.default.html -->
|
||
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/end-row.default.html -->
|
||
<!-- START: this line starts content from: inc/footer.default.html -->
|
||
|
||
<div class="footer">
|
||
<hr>
|
||
<h2>Coda</h2>
|
||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2Flocation.html">Nu HTML check this web page</a></p>
|
||
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/footer.default.html -->
|
||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||
|
||
</body>
|
||
</html>
|
||
|
||
<!-- END: this line ends content from: inc/bottom.default.html -->
|