force use of pandoc version >= 3.1.12.2

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

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

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

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

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

No files matched your search

+127 -168
View File
@@ -129,10 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Philip_Blakely">Philip
Blakely</a><br> Location: <a href="../../location.html#GB">GB</a> -
<em>United Kingdom of Great Britain and Northern Ireland</em>
(<em>United Kingdom</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Philip_Blakely">Philip Blakely</a><br>
Location: <a href="../../location.html#GB">GB</a> - <em>United Kingdom of Great Britain and Northern Ireland</em> (<em>United Kingdom</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -149,112 +148,100 @@ Blakely</a><br> Location: <a href="../../location.html#GB">GB</a> -
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<p>For those who have a lot of time, try:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./blakely</span> <span class="op">&lt;</span> t0_3.dat</span></code></pre></div>
<p>though one might or might not need to kill it, depending on your
boredom threshold.</p>
<p>though one might or might not need to kill it, depending on your boredom
threshold.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This program plays <a
href="https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life">Life</a>
(see also <a href="https://conwaylife.com">here</a>), computes Pi to 16
digits if given its own source as input, and allows to check if your
garden is a <a
href="http://en.wikipedia.org/wiki/Garden_of_Eden_%28cellular_automaton%29">Garden
of Eden</a>, all in one source.</p>
<p>If you have enough time to spare, put the plan of your garden in a
text file, and run:</p>
<p>This program plays <a href="https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life">Life</a>
(see also <a href="https://conwaylife.com">here</a>), computes Pi to 16 digits
if given its own source as input, and allows to check if your garden
is a <a href="http://en.wikipedia.org/wiki/Garden_of_Eden_%28cellular_automaton%29">Garden of Eden</a>, all in one source.</p>
<p>If you have enough time to spare, put the plan of your garden in a text file,
and run:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./blakely</span> <span class="at">-</span> <span class="op">&lt;</span> garden.txt</span></code></pre></div>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This program uses a well-known algorithm in order to display pi to
fifteen decimal places. The source-layout itself demonstrates the
importance of using the correct amount of whitespace in code and the
clear superiority of spaces over tabs.</p>
<p>This program uses a well-known algorithm in order to display pi to fifteen
decimal places. The source-layout itself demonstrates the importance of using
the correct amount of whitespace in code and the clear superiority of spaces
over tabs.</p>
<p>In order to see the main feature of the code, type:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./blakely</span> <span class="op">&lt;</span> blakely.c</span></code></pre></div>
<p>and wait for about four seconds before using Ctrl-C (or whatever) to
end the program. The results are best viewed in a terminal window at
least 60 characters high and wide. Alternatively, redirect the output to
a separate file (killing when necessary).</p>
<p>and wait for about four seconds before using Ctrl-C (or whatever) to end the program. The
results are best viewed in a terminal window at least 60 characters
high and wide. Alternatively, redirect the output to a separate file
(killing when necessary).</p>
<h3 id="overview">Overview</h3>
<p>The program emulates John Conway’s cellular automaton known as “<a
href="https://conwaylife.com">The Game of Life</a>”, using standard
input as a starting grid. The layout of the source-code is such that it
evolves to a digital representation of the first 15 decimal places of pi
after 4 time steps. This was setup using the other feature of the
program which can be demonstrated as follows:</p>
<p>The program emulates John Conway’s cellular automaton known as “<a href="https://conwaylife.com">The Game of
Life</a>”, using standard input as a starting grid. The
layout of the source-code is such that it evolves to a digital representation of
the first 15 decimal places of pi after 4 time steps. This was setup using the
other feature of the program which can be demonstrated as follows:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./blakely</span> <span class="at">-</span> <span class="op">&lt;</span> 3.dat</span></code></pre></div>
<p>The program will first display the grid given in <a
href="3.dat">3.dat</a>, and then three more grids (taking a few minutes
to display the last). Waiting for any more grids will take a substantial
amount of time. The final grid has been put into <a
href="evolve_to_3.dat">evolve_to_3.dat</a>, and if you type</p>
<p>The program will first display the grid given in <a href="3.dat">3.dat</a>, and then three
more grids (taking a few minutes to display the last). Waiting for any more
grids will take a substantial amount of time. The final grid has been put into
<a href="evolve_to_3.dat">evolve_to_3.dat</a>, and if you type</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./blakely</span> <span class="op">&lt;</span> evolve_to_3.dat</span></code></pre></div>
<p>then the 3 will reappear after three time steps.</p>
<p>As should now be clear, this use of the program will attempt to
evolve a given setup backwards in time according to the Life rules. The
resulting grid is clearly not necessarily unique. The program will
evolve backwards given <em>any</em> single command line option.</p>
<p>As should now be clear, this use of the program will attempt to evolve a given setup
backwards in time according to the Life rules. The resulting grid is clearly not
necessarily unique. The program will evolve backwards given <em>any</em> single command
line option.</p>
<p>When evolving forwards, the code can only be stopped by killing the
program. In the reverse direction, the code can either be killed, or
will stop if it is unable to find a grid that will evolve to the current
layout correctly. This can be seen with the sample grid <a
href="t0_3.dat">t0_3.dat</a>, which evolves backwards by only two
time-steps.</p>
will stop if it is unable to find a grid that will evolve to the
current layout correctly. This can be seen with the sample grid
<a href="t0_3.dat">t0_3.dat</a>, which evolves backwards by only two time-steps.</p>
<h3 id="input-file-format">Input file format</h3>
<p>The input files must encode a square grid, where a space is a dead
cell, and any other character (except a newline) is a living cell. Each
line must be the same length, and end with a single newline character
<code>\n</code> (ASCII 10), including the last line. When designing
grids, it may help to type full-stops (dots) in place of spaces, and do
a global replace afterwards. Any deviation from this format will cause
errors in the output.</p>
<p>The input files must encode a square grid, where a space is a dead cell, and any
other character (except a newline) is a living cell. Each line must be the same
length, and end with a single newline character <code>\n</code> (ASCII 10), including the
last line. When designing grids, it may help to type full-stops (dots) in place
of spaces, and do a global replace afterwards. Any deviation from this format
will cause errors in the output.</p>
<h3 id="limitations">Limitations</h3>
<p>This is only an approximation to the original Life, as it takes place
on a finite grid, with borders that are automatically killed off before
each time step. However, when evolving backwards, the resulting grids
will not cause any cells on the boundaries to come alive. As the display
is performed before killing off the borders, some boundary cells may
sometimes appear to be alive, but not be treated as such for the
following time-step, although any living cells on the right border will
never be displayed.</p>
<p>The maximum grid size is currently 99 by 99 (exceeding this will
cause a segfault), but changing the two <code>9802</code>s to
<code>MAX_SIZE*MAX_SIZE+1</code> will solve this, although some
reformatting of the code might have to be done to allow larger
numbers.</p>
on a finite grid, with borders that are automatically killed off
before each time step. However, when evolving backwards, the resulting
grids will not cause any cells on the boundaries to come alive.
As the display is performed before killing off the borders, some
boundary cells may sometimes appear to be alive, but not be treated as
such for the following time-step, although any living cells on the
right border will never be displayed.</p>
<p>The maximum grid size is currently 99 by 99 (exceeding this will cause a
segfault), but changing the two <code>9802</code>s to <code>MAX_SIZE*MAX_SIZE+1</code> will
solve this, although some reformatting of the code might have to be done to allow
larger numbers.</p>
<h3 id="compiler-warningsassumptions">Compiler warnings/assumptions</h3>
<p>When compiled with the <code>-Wall -pedantic -ansi</code> options of
gcc, some warnings suggesting extra parentheses occur (not necessary for
anyone fully conversant with operator precedence). There is one unused
variable, <code>v</code>, but unnamed function parameters are not
permitted in ANSI C, so naming it is necessary, and gcc no longer warns
about its existence, although earlier versions do.</p>
<p>Since the program calculates ASCII character values for display, an
ASCII based system is required to run it. Also, as mentioned above, any
system that uses anything other than a plain <code>\n</code> to end a
line will cause problems when reading in files.</p>
<p>When compiled with the <code>-Wall -pedantic -ansi</code> options of gcc, some warnings
suggesting extra parentheses occur (not necessary for anyone fully conversant
with operator precedence). There is one unused variable, <code>v</code>, but unnamed
function parameters are not permitted in ANSI C, so naming it is necessary, and
gcc no longer warns about its existence, although earlier versions do.</p>
<p>Since the program calculates ASCII character values for display, an ASCII based
system is required to run it. Also, as mentioned above, any system that uses
anything other than a plain <code>\n</code> to end a line will cause problems when reading
in files.</p>
<h3 id="obfuscation">Obfuscation</h3>
<p>Given the finely-tuned layout required to evolve into pi, this is one
of the main obfuscations used in the code. However, running the code
through the preprocessor, expanding the <code>#define</code>s, and
applying GNU’s indent, although making the location of functions and
statements clear, by no means makes the code entirely clear. Note that
expanding out the <code>#define</code>s does not take the program over
the character limit. The main reason for these is to do with the layout,
since there are few places that keywords or tokens of over 2 characters
can be fitted, and requiring the first few lines to be
<code>#include</code>s would cause similar problems.</p>
<p>Given the finely-tuned layout required to evolve into pi, this is one of the
main obfuscations used in the code. However, running the code through the
preprocessor, expanding the <code>#define</code>s, and applying GNU’s indent, although
making the location of functions and statements clear, by no means makes the
code entirely clear. Note that expanding out the <code>#define</code>s does not take the
program over the character limit. The main reason for these is to do with the
layout, since there are few places that keywords or tokens of over 2
characters can be fitted, and requiring the first few lines to be <code>#include</code>s
would cause similar problems.</p>
<p>Other obfuscations used are:</p>
<ul>
<li>Use of the classic <code>2[a]</code> syntax to access the third
element of the array <code>a</code>.</li>
<li>Use of the classic <code>2[a]</code> syntax to access the third element of the
array <code>a</code>.</li>
<li>Nested ternary operators, combined with shortcut evaluation being
required for correct operation.</li>
<li>Use of the comma operator to embed operations inside one
another.</li>
<li>Use of the comma operator to embed operations inside one another.</li>
<li>Calculation of ASCII codes.</li>
<li>Needlessly recursive functions.</li>
<li>Use of bitwise-operations.</li>
<li>Storing a variable whose value could easily be found from
another.</li>
<li>Storing a variable whose value could easily be found from another.</li>
<li>Use of <code>goto</code>s to emulate a <code>for</code> loop.</li>
</ul>
<h3 id="algorithm">Algorithm</h3>
@@ -264,112 +251,84 @@ know, a brute-force method is the only viable automatic approach for
general grids, although more intelligent algorithms would be possible
given more space.</p>
<p>The program starts with an empty “trial” grid and, starting from the
top-left, tries all possibilities for the neighbours of the current cell
that will cause the cell to evolve to the required state. It then
proceeds to the right and down. Thus, it only ever needs to look at the
cells below and to the right when testing. However, the already defined
cells above and/or to the left of the cell may mean that there are no
possibilities that will give the correct state, in which case the code
backtracks and tries other possibilities on previous cells. The program
knows it has a valid grid if it gets to the last cell. If it cannot find
a valid grid, the program exits.</p>
top-left, tries all possibilities for the neighbours of the current
cell that will cause the cell to evolve to the required state. It then
proceeds to the right and down. Thus, it only ever needs to look at
the cells below and to the right when testing. However, the already
defined cells above and/or to the left of the cell may mean that there
are no possibilities that will give the correct state, in which case
the code backtracks and tries other possibilities on previous
cells. The program knows it has a valid grid if it gets to the last
cell. If it cannot find a valid grid, the program exits.</p>
<p>Since this uses brute-force, it can be very slow. (In fact, the
various obfuscations have, at least for the gcc compiler, caused a
substantial slowdown.)</p>
various obfuscations have, at least for the gcc compiler,
caused a substantial slowdown.)</p>
<h3 id="program-layout">Program layout</h3>
<p>The “calculation” of pi was chosen purely because algorithms to find
pi are numerous, but the <a
href="https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life">Game of
Life</a> is rarely (if ever?) used for this purpose. Also, separate
digits made determining the layout somewhat easier.</p>
<p>Deriving the layout was the most complicated part of the program. As
is clear from the final layout featuring pi, the grid was divided into
sixteen squares, and layouts that would evolve to each of the nine
digits required were found. (This used the three-by-five digit-layout
embedded in, at first, a nine-by-nine grid, then in larger grids, until
fifteen-by-fifteen was reached.) The fifteen-by-fifteen grids give
enough blank cells around them that the digits will not collide when
evolving.</p>
<p>The “calculation” of pi was chosen purely because algorithms to find pi are
numerous, but the <a href="https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life">Game of
Life</a> is rarely (if
ever?) used for this purpose. Also, separate digits made determining the layout
somewhat easier.</p>
<p>Deriving the layout was the most complicated part of the program. As is clear
from the final layout featuring pi, the grid was divided into sixteen squares,
and layouts that would evolve to each of the nine digits required were found.
(This used the three-by-five digit-layout embedded in, at first, a nine-by-nine
grid, then in larger grids, until fifteen-by-fifteen was reached.) The
fifteen-by-fifteen grids give enough blank cells around them that the digits
will not collide when evolving.</p>
<p>However, this did not allow for sufficient characters to fit the code
into. Therefore it was necessary to add some regions that would quickly
die off without expanding to collide with the digits’ evolution. Groups
of cells such as singletons, pairs, and larger groups like</p>
into. Therefore it was necessary to add some regions that would quickly die off
without expanding to collide with the digits’ evolution.
Groups of cells such as singletons, pairs, and larger groups like</p>
<pre><code>* * * * * * * * * *
*****************
* * * * * * * * * *</code></pre>
<p>were useful in this regard.</p>
<p>Other problems were keywords which need to be all in one string,
keywords requiring space after them, and multi-character tokens. Some of
these problems were dealt with by using the <code>#define</code>s and
<code>#include</code>s given in the build-script, as there was no way to
have sufficient separate lines in the code to do this without causing
many difficulties. Some rejigging of the grid’s layout as the code was
fitted into its format was also done, resorting to trial-and-improvement
in some cases. Occasional use of constructs such as <code>f -= -3</code>
was made as <code>f += 3</code> could not be fitted into the required
format. The fact that the borders would be killed off immediately was
also helpful.</p>
<p>Other problems were keywords which need to be all in one
string, keywords requiring space after them, and
multi-character tokens. Some of these problems were dealt with by
using the <code>#define</code>s and <code>#include</code>s given in the build-script, as there
was no way to have sufficient separate lines in the code to do this
without causing many difficulties. Some rejigging of the grid’s layout
as the code was fitted into its format was also done, resorting to
trial-and-improvement in some cases. Occasional use of constructs such
as <code>f -= -3</code> was made as <code>f += 3</code> could not be fitted into the required format.
The fact that the borders would be killed off immediately was also helpful.</p>
<p>It should be noted that evolving a full 60-by-60 grid backwards using
this code would probably take us at least up to the heat-death of the
universe.</p>
<p>The command <code>./blakely - &lt; blakely.c</code> is therefore
<em>not</em> recommended.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<p>The command <code>./blakely - &lt; blakely.c</code> is therefore <em>not</em> recommended.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-2011blakely"><a name="inventory"></a>Inventory for
2011/blakely</h1>
<h1 id="inventory-for-2011blakely"><a name="inventory"></a>Inventory for 2011/blakely</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/blakely/blakely.c">blakely.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/blakely/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/blakely/blakely.orig.c">blakely.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/blakely/3.dat">3.dat</a>
- input data</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/blakely/evolve_to_3.dat">evolve_to_3.dat</a>
- input data</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/blakely/t0_3.dat">t0_3.dat</a>
- input data</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/blakely/try.sh">try.sh</a>
- how to run</li>
<li><a href="2011_blakely.tar.bz2">2011_blakely.tar.bz2</a> - download
entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/blakely/blakely.c">blakely.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/blakely/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/blakely/blakely.orig.c">blakely.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/blakely/3.dat">3.dat</a> - input data</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/blakely/evolve_to_3.dat">evolve_to_3.dat</a> - input data</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/blakely/t0_3.dat">t0_3.dat</a> - input data</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/blakely/try.sh">try.sh</a> - how to run</li>
<li><a href="2011_blakely.tar.bz2">2011_blakely.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/blakely/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/blakely/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/blakely/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/blakely/.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/2011/blakely/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2011/blakely/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->