build index.html for all winners

Updated manifest as per recent file changes.

Updated winner `.winner.json` to reflect the manifest changes.

Added [bin/all_run.sh](bin/all_run.sh) tool to run a command over
all winning entries.

These tools had slight improvements in the help usage message:

* bin/gen-author.sh VERSION="1.3.1 2024-01-16"
* bin/gen-inventory.sh VERSION="1.0.1 2024-01-16"
* bin/pandoc_wrapper.sh VERSION="1.3.1 2024-01-16"
* bin/subst.default.sh VERSION="1.1.1 2024-01-16"
* bin/subst.winner-index.sh VERSION="1.1.1 2024-01-16"

The `bin/readme2index.sh` tool was improved so that
if the `index.html` file exists and the tool forms
the exact same content, then the file `index.html`
file is NOT touched.

* bin/readme2index.sh VERSION="1.1 2024-01-16"

We used the following command to generate `index.html` files
for all winning entries:

```sh
bin/all_run.sh -v 3 bin/readme2index.sh
```

NOTE: We have not (yet) built HTML files above the winner directory
level (e.g., no year level nor top level HTML), nor have be built
non-index HTML files for winners.

NOTE: By default we are running `pandoc(1)` with:

```
--fail-if-warnings=true
```

This means that any problems with markdown to HTML
generates an error.  This is done to be sure that
the HTML conversion is clean.

We had to fix the following `README.md` files:

* `2000/rince/README.md`

The reference [^2] was never used.  We made a guess that [^2] applies
to the same spot as [^1].  Perhaps there is a better spot where
[^2] applies?

NOTE: For every reference, there MUST be some place where that
reference is used.

* 2012/vik/README.md

The string "$...$" is assumed to be a TeX encoded string.

NOTE: Every "$..$" needs to be backslashed as in "\$..\$".

* 2018/burton1/README.md

The reference [2] was duplicated.  We changed the
second [2] to [3].

NOTE: Every reference needs to have a unique number.

* 2020/carlini/README.md

The string "$...$" is assumed to be a TeX encoded string.

NOTE: Every "$..$" needs to be backslashed as in "\$..\$".

We also found 2 errors in the `author/author_handle.json` file set:

* author/Anonymous_2001.json

The `author/Anonymous_2001.json` file was missing.

* author/Jari_Arkko.json

The winner ID for `1989_jar.1` had a typo.
This commit is contained in:
Landon Curt Noll committed 2024-01-17 00:32:39 -08:00
1 parent 893cd915b6
commit c1466f5165
350 files changed
+95242 -4217

No files matched your search

+379 -13
View File
@@ -1,4 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- START: two lines up starts content from: inc/top.default.html -->
<!-- -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
@@ -6,27 +8,391 @@
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<!-- -->
<!-- file: 2001/dgbeards/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
<html lang="en">
<!-- END: this line ends content from: inc/top.default.html -->
<!-- -->
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
<!-- -->
<!-- START: this line starts content from: inc/head.default.html -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2001 dgbeards</title>
<meta name="description" content="IOCCC year: 2001 IOCCC winner: dgbeards winner index page">
<meta name="keywords" content="IOCCC,2001,dgbeards,winner index page">
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2001/dgbeards</title>
<meta name="description" content="2001 IOCCC winner dgbeards">
<meta name="keywords" content="IOCCC, 2001, IOCCC 2001, IOCCC winner, dgbeards">
</head>
<!-- END: this line ends content from: inc/head.default.html -->
<!-- START: this line starts content from: inc/body.default.html -->
<body>
<h1>2001 dgbeards</h1>
<!-- END: this line ends content from: inc/body.default.html -->
<!-- START: this line starts content from: inc/header.default.html -->
<p>XXX - fake content until readme2index is working - XXX</p>
<div class="header">
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
<h1>The International Obfuscated C Code Contest</h1>
<h2>2001/dgbeards</h2>
</div>
<hr style="width:50%;text-align:left;margin-left:0">
<!-- END: this line ends content from: inc/header.default.html -->
<!-- START: this line starts content from: inc/topnav.mid.html -->
<!-- Start Nu Html Checker -->
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2001%2Fdgbeards%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2001/dgbeards/index.html</a></p>
<!-- End Nu Html Checker -->
<div class="topnav">
<a class="Left" href="../ctk/index.html">&larr; ctk</a>
<a class="Left" href="../index.html">&uarr; 2001 &uarr;</a>
<a class="Left" href="../herrmann1/index.html">herrmann1 &rarr;</a>
<a class="Right" href="#inventory">Inventory</a>
</div>
<!-- END: this line ends content from: inc/topnav.mid.html -->
<!-- START: this line starts content from: inc/begin-row.default.html -->
<div class="row">
<!-- END: this line ends content from: inc/begin-row.default.html -->
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
<div class="leftcolumn">
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/sidenav.default.html -->
<div class="sidenav">
<a href="#content">Jump to contents</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
<a href="/temp-test-ioccc/winners.html">People who have won</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
<a href="/temp-test-ioccc/faq.html">FAQ</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/bugs.html">Bugs &amp; (mis)features</a>
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
</div>
<hr>
<div class="sidenav">
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
</div>
<hr>
<div class="sidenav">
<a href="#top">Jump to top</a>
</div>
<!-- END: this line ends content from: inc/sidenav.default.html -->
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
<div class="rightcolumn">
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/before-content.default.html -->
<a name="content"></a>
<!-- END: this line ends content from: inc/before-content.default.html -->
<!-- START: this line starts content generated by: bin/gen-author.sh -->
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
href="/temp-test-ioccc/winners.html#Doug_Beardsley">Doug
Beardsley</a><br> Location: <a
href="/temp-test-ioccc/location.html#US">US</a></p>
<!-- END: next line ends content generated by: bin/gen-author.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<p>There is an alternate version based on the author’s remarks. See <a
href="#alternate-code">alternate code</a> below for more details.</p>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code>STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a
href="/bugs.md#2001-dgbeards">2001 dgbeards in bugs.md</a>.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./dgbeards</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>The author provided a way to speed it up a bit and also how to make
it so it doesn’t crash on losing. The idea that it crashes on losing was
too good to lose but this alternate version has the former change. If
you wish to remove this you can look at the author’s remarks and make
the change.</p>
<h3 id="alternate-build">Alternate build:</h3>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./dgbeards.alt</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<p>See if you can figure out how to make the computer always lose (‘win’
:-) ). It’s a very simple thing to do. Read the author’s remarks for
clues.</p>
<p>This game crashes if it loses.</p>
<p>This is supposed to happen. As is written in the <a
href="http://catb.org/jargon/html/F/feature.html">The Jargon
File</a>:</p>
<pre><code>That&#39;s not a bug, that&#39;s a feature.</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This is probably the worst AI we’ve ever seen. So, then, why did the
entry win? Because it’s <em>trying</em> to lose.</p>
<p>This is also one of the first chess games we’ve seen.</p>
<p>Of particular interest is the author’s decision that the program
should crash if it loses. I’ve played chess with a lot of people like
that, and I appreciate the realism.</p>
<p>BTW: if your goal is to lose and you do does that mean you win? :-)
What does winning mean in a game you’re supposed to lose at?</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="faq">FAQ</h3>
<h4 id="q-what-does-this-program-do">Q: What does this program do?</h4>
<p>A: It lets the user play two player or single player games of <a
href="https://en.wikipedia.org/wiki/Losing_chess">suicide chess</a>.
Suicide Chess (also known as Losing Chess) is a variant of normal chess.
It is played on the same board and uses the same pieces. Here is a list
of the differences:</p>
<ol type="1">
<li><p>The object of the game is to get to a position where you have no
legal moves. This is usually accomplished by losing all of your pieces.
Sometimes, the game can end when you still have some pawns on the board,
but they are blocked and cannot move. The general rule is if a player
has no legal moves, the game is over. The winner is the player with
fewer pieces on the board. This is almost always the same player that
had no moves, but not always.</p></li>
<li><p>In suicide chess, piece captures are compulsory. If a player can
capture an opponent’s piece, he is required to do so. If he can capture
more than one of the opponent’s pieces or can capture one piece with
more than one of his own pieces, he can choose which capture to
play.</p></li>
<li><p>The king is not significant. There is no concept of check and the
king can be captured.</p></li>
<li><p>Because of rule 3, pawns are allowed to promote to a
king.</p></li>
<li><p>Castling is not allowed.</p></li>
</ol>
<h4 id="q-how-do-you-use-this-program">Q: How do you use this
program?</h4>
<p>A: The program is fairly straightforward. When you start the program,
it displays the opening position for a game of suicide chess and waits
for user input. Commands are as follows:</p>
<ul>
<li><code>quit</code> quits the program</li>
<li><code>g</code> causes the computer to make a move</li>
</ul>
<p>Moves are represented by the long algebraic notation for the move.
For those not familiar with long algebraic notation, a move consists of
a square to move from followed by a square to move to. Squares are
denoted by a letter and a number. The letter specifies the column or
file of the square and the number specifies the row rank. Files are
named from left to right by the letters <code>A</code> - <code>H</code>.
Rows are numbered from bottom to top with the numbers <code>1</code> -
<code>8</code>. A sample move from the opening position is
<code>E2E3</code>. This means to move a piece from square
<code>E2</code> to <code>E3</code>. From the opening position, this
corresponds to moving the king pawn forward one square. This is
generally to be considered one of the best opening moves in suicide
chess. All moves, captures and otherwise, are represented with this
notation. A special case is pawn promotion moves. They use the same
notation followed by an <code>=</code> and a letter representing the
piece to promote to. The letters are <code>R</code>, <code>N</code> ,
<code>B</code>, <code>Q</code>, <code>K</code> representing rook,
knight, bishop, queen, and king respectively. The letters must be upper
case.</p>
<p>You can also specify a command line argument of a single digit to
change the search depth of the program. If no argument is specified, it
defaults to a depth of 3.</p>
<h4 id="q-are-there-any-limitations-in-your-program">Q: Are there any
limitations in your program?</h4>
<p>A: Yes. The first of the limitations is that you can only play legal
moves according to the rules of suicide chess. En passant captures are
not recognized. They are rarely encountered in suicide chess and when
they do happen, they usually do not change the outcome of the game. As
mentioned above, castling is not allowed either.</p>
<p>It also does not detect the end of the game. It can see sure wins or
losses several moves ahead, but does not announce the end of a game or
the winner. Given the existing code it is easy to do this, but it was
deemed unnecessary fluff.</p>
<h4 id="q-what-is-the-playing-strength-of-this-program">Q: What is the
playing strength of this program?</h4>
<p>A: Playing strength is a relative term. Relative to other computer
programs that play suicide chess, it is about the bottom. There is one
freeware program in existence called <code>kenny</code> that this
program can beat, but that is about it.</p>
<p>Suicide chess is a very tactical game. Most humans who do not have
any experience in suicide chess will lose to this program. The <a
href="http://www.freechess.org">Free Internet Chess Server</a> is a free
online chess server that supports suicide chess. This server keeps track
of ratings. The human ratings for suicide chess range from 1000 to about
2400. This program would probably be rated somewhere around 1700-1900.
It is better than most players, but will get destroyed by experienced
human opponents.</p>
<p>This program searches to a fixed depth of 3 <a
href="https://en.wikipedia.org/wiki/Ply_(game_theory)">ply</a>. Because
it does not search very deep, it performs very poorly in quiet strategic
positions. In such positions, it will often just shuffle pieces around
aimlessly until a tactical exchange presents itself.</p>
<p>A small amount of randomness has been added to make the program a
more interesting opponent. To avoid a call to <code>srand(3)</code>,
<code>rand(3)</code> and the extra code for the required include files,
the <code>time(3)</code> function is used as the source of random data.
It is a slow function, and since it is executed inside the search loop,
there is a significant performance decrease. To make it faster, replace
the <code>time(3)</code> call with <code>rand(3)</code> and add the line
<code>srand(time(0));</code> to the beginning of <code>main()</code>. I
used the more inefficient <code>time(3)</code> function to illustrate a
different (and somewhat obfuscated?) way of generating random
numbers.</p>
<h4 id="q-why-is-this-program-obfuscated">Q: Why is this program
obfuscated?</h4>
<p>A: Here are several reasons:</p>
<p>First, without preprocessing, the code is not easy to read. The
preprocessor is used to compress the code and obfuscate it. The main
obstacle to entering this program is the source code size limit. This is
the reason that the preprocessor was used so liberally. It is one of the
best ways to compress C source code.</p>
<p>Second, when possible, variables in the program were made global.
Their names are not descriptive and they are used for a variety of
purposes throughout the program. Because of this, it is difficult to
determine exactly what the code does even after preprocessing and
beautifying the code.</p>
<p>Third, all function names are a single character and are obviously
not descriptive of they’re actual purpose. Again this serves the dual
purpose of compression and obfuscation.</p>
<p>Fourth, most string variables have been encoded. This encoding serves
to obfuscate the program as well as reduce the number of countable
characters and get the program under the size limit of this year’s
IOCCC. There are some places where other simple encoding methods are
used to hide the real purpose of strings. These layers of obscurity
cannot be penetrated by just preprocessing and beautifying the
program.</p>
<p>Fifth, various small obfuscations have been used in places all over
the program. Short circuit evaluation is used as a substitute for
<code>if()</code> statements in some places. The ternary operator is
used. In the author’s opinion, use of the ternary operator is almost
always a strong argument for employee turnover.</p>
<p>Last, if you have succeeded in wading through the previous layers of
obfuscation, you are confronted by the fact that the game that it
implements is an obscure game. Casual inspection of the program might
lead one to believe that it is an implementation of classic chess, but
this is not so.</p>
<h4 id="q-what-about-the-compiler-warnings">Q: What about the compiler
warnings?</h4>
<p>A: When compiled with <code>gcc -Wall</code>, the compiler generated
the following warnings:</p>
<pre><code>suggest parentheses around + or - in operand of &amp;
array subscript has type &#39;char&#39;
return type defaults to &#39;int&#39;
control reaches end of non-void function
value computed is not used</code></pre>
<p>The <code>value computed is not used</code> warning happens because I
use the <code>&amp;&amp;</code> operator and take advantage of short
circuit evaluation instead of using an <code>if()</code> statement.</p>
<p>The <code>suggest parentheses...</code> warnings are given because of
expressions that depend on operator precedence details in the C
language. Eliminating these warnings would reduce obfuscation.</p>
<p>The other warnings are there because it would require more code to
eliminate them and that can’t be done given the size limit.</p>
<h4 id="q-why-does-this-program-crash-when-it-loses">Q: Why does this
program crash when it loses?</h4>
<p>A: What better way to admit defeat? The author thought this was
appropriate sportsmanship for a program of this genre and can think of
no worse job than trying to find an elusive bug in an intentionally
obfuscated program.</p>
<p>[Judge’s note: This was followed by a description of the bug, and the
comment:]</p>
<p>Note, if this program wins, the author thinks it would be good to
leave this information out of the remarks and encourage others to try
and figure it out for themselves.</p>
<p>[Should you be too lazy (or time-efficient or affected by ‘real life’
:-) ) to figure it out yourself, here’s the author’s fix.]</p>
<p>This bug can be fixed in a number of ways, but there is a way that
adds only one byte to the source code. In the statement
<code>s=(e=-V(n-1,o))&gt;s?Y=G,e:s;</code> change the <code>&gt;</code>
to a <code>&gt;=</code> and the bug will be gone.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
<h1 id="inventory-for-2001dgbeards"><a name="inventory"></a>Inventory
for 2001/dgbeards</h1>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a href="index.html">index.html</a> - winner home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2001/dgbeards/dgbeards.c">dgbeards.c</a>
- winning source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2001/dgbeards/Makefile">Makefile</a>
- winner Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2001/dgbeards/dgbeards.alt.c">dgbeards.alt.c</a>
- alternative source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2001/dgbeards/dgbeards.orig.c">dgbeards.orig.c</a>
- original source</li>
<li><a href="2001_dgbeards.tar.bz2">2001_dgbeards.tar.bz2</a> - download
winning source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2001/dgbeards/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2001/dgbeards/.winner.json">.winner.json</a>
- description of winner in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2001/dgbeards/README.md">README.md</a>
- markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
<!-- START: this line starts content from: inc/after-content.default.html -->
<!-- END: this line ends content from: inc/after-content.default.html -->
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
</div>
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
<!-- START: this line starts content from: inc/end-row.default.html -->
</div>
<!-- END: this line ends content from: inc/end-row.default.html -->
<!-- START: this line starts content from: inc/footer.default.html -->
<div class="footer">
<hr>
<h2>Coda</h2>
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2001%2Fdgbeards%2Findex.html">Nu HTML check this web page</a></p>
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
</div>
<!-- END: this line ends content from: inc/footer.default.html -->
<!-- START: this line starts content from: inc/bottom.default.html -->
</body>
</html>
<!-- END: this line ends content from: inc/bottom.default.html -->