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:
1 parent
9eb7a54e9f
commit
b0b212acb1
402 files changed
+37061
-55132
No files matched your search
+79
-114
@@ -129,9 +129,9 @@
|
||||
|
||||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||||
<ul>
|
||||
<li>Name: <a href="../../authors.html#Brian_Westley">Brian
|
||||
Westley</a><br> Location: <a href="../../location.html#US">US</a> -
|
||||
<em>United States of America</em> (<em>United States</em>) <br><br></li>
|
||||
<li>Name: <a href="../../authors.html#Brian_Westley">Brian Westley</a><br>
|
||||
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
|
||||
<br><br></li>
|
||||
</ul>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
|
||||
@@ -144,17 +144,14 @@ Westley</a><br> Location: <a href="../../location.html#US">US</a> -
|
||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||
<p>The current status of this entry is:</p>
|
||||
<pre><code>STATUS: known bug - please help us fix</code></pre>
|
||||
<p>For more detailed information see <a
|
||||
href="../../bugs.html#1989_westley">1989 westley bugs</a>.</p>
|
||||
<p>For more detailed information see <a href="../../bugs.html#1989_westley">1989 westley bugs</a>.</p>
|
||||
<h2 id="try">Try:</h2>
|
||||
<p>Try compiling and running the 4 resulting programs like:</p>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./compile.sh</span></span></code></pre></div>
|
||||
<p>If you need to specify an alternate compiler path, say because your
|
||||
default compiler is clang (or in the case of macOS gcc is clang) you can
|
||||
do so like:</p>
|
||||
<p>If you need to specify an alternate compiler path, say because your default
|
||||
compiler is clang (or in the case of macOS gcc is clang) you can do so like:</p>
|
||||
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="va">CC</span><span class="op">=</span>/opt/local/bin/gcc-mp-12 <span class="ex">./compile.sh</span></span></code></pre></div>
|
||||
<p>If you wish to delay the script or remove the delay you can do so
|
||||
like:</p>
|
||||
<p>If you wish to delay the script or remove the delay you can do so like:</p>
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="va">DELAY</span><span class="op">=</span>2 <span class="ex">./compile.sh</span></span></code></pre></div>
|
||||
<p>Finally try:</p>
|
||||
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./westley</span></span>
|
||||
@@ -166,141 +163,109 @@ like:</p>
|
||||
“<code>Hello, world!\n</code>”. Can you find how to do it?</p>
|
||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||
<p>This is a filter. If it is run with no arguments, it copies
|
||||
<code>stdin</code> to <code>stdout</code>. With one argument, it ROT13’s
|
||||
<code>stdin</code> to <code>stdout</code>. With two arguments, it
|
||||
reverses <code>stdin</code> to <code>stdout</code>. With three
|
||||
arguments, it does both. It requires the ASCII character set, with all
|
||||
characters being in <code>0..255</code>, and <code>EOF</code> must be
|
||||
<code>-1</code>. Also requires two’s complement (I think).</p>
|
||||
<code>stdin</code> to <code>stdout</code>. With one argument, it ROT13’s <code>stdin</code> to
|
||||
<code>stdout</code>. With two arguments, it reverses <code>stdin</code> to <code>stdout</code>. With
|
||||
three arguments, it does both. It requires the ASCII character
|
||||
set, with all characters being in <code>0..255</code>, and <code>EOF</code> must be <code>-1</code>.
|
||||
Also requires two’s complement (I think).</p>
|
||||
<p>The source code will run if ROT13’ed and/or reversed, using a
|
||||
different algorithm for each version (hereafter referred to as
|
||||
<code>ver0</code> (original), <code>ver1</code> (ROT13),
|
||||
<code>ver2</code> (reversed), and <code>ver3</code> (ROT13 and
|
||||
reversed)).</p>
|
||||
<p>When compiling these versions, one needs to define
|
||||
<code>trgpune</code> in the compile line (which the Makefile now has).
|
||||
Example:</p>
|
||||
<code>ver0</code> (original), <code>ver1</code> (ROT13), <code>ver2</code> (reversed), and <code>ver3</code>
|
||||
(ROT13 and reversed)).</p>
|
||||
<p>When compiling these versions, one needs to define <code>trgpune</code>
|
||||
in the compile line (which the Makefile now has). Example:</p>
|
||||
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cc</span> <span class="at">-Dtrgpune</span><span class="op">=</span>putchar ver3.c <span class="at">-o</span> ver3</span></code></pre></div>
|
||||
<p><code>trgpune</code> is the ROT13 of <code>getchar()</code>, so
|
||||
<code>getchar()</code> and <code>putchar()</code> are exchanged in the
|
||||
ROT13 counterpart. It is easy to see that this is unavoidable. I must
|
||||
have a <code>#define</code> for a library function; otherwise I would
|
||||
have an unidentified extern for the ROT13 version. If I then define this
|
||||
function, it won’t link in the library version for the ORIGINAL code,
|
||||
since my definition will supersede the library function. Hence, the
|
||||
<p><code>trgpune</code> is the ROT13 of <code>getchar()</code>, so <code>getchar()</code> and <code>putchar()</code>
|
||||
are exchanged in the ROT13 counterpart. It is easy to see that
|
||||
this is unavoidable. I must have a <code>#define</code> for a library
|
||||
function; otherwise I would have an unidentified extern for the
|
||||
ROT13 version. If I then define this function, it won’t link
|
||||
in the library version for the ORIGINAL code, since my
|
||||
definition will supersede the library function. Hence, the
|
||||
compiler option gives me <code>putchar()</code>, and allows me to use
|
||||
<code>getchar()</code>. I pass a dummy argument to
|
||||
<code>getchar()</code> to eliminate “variable number of args” from lint
|
||||
(unless it checks against the library). Otherwise, all versions of lint
|
||||
complain that <code>main()</code> returns random value & constant in
|
||||
conditional context (when I check for ROT13 version).</p>
|
||||
<p><code>ver0</code> and <code>ver1</code> use a range check and a
|
||||
calculation to do ROT13, while <code>ver2</code> and <code>ver3</code>
|
||||
use table lookup. All versions contain <code>main()</code> and its ROT13
|
||||
function, <code>znva()</code>. <code>ver0</code>/<code>ver1</code>
|
||||
(<code>ver2</code>/<code>ver3</code>) are (of course) syntactically
|
||||
identical, since the syntax is in the non-alphabetic characters.
|
||||
However, since one program starts at <code>main()</code> while it’s
|
||||
ROT13 counterpart starts at <code>znva()</code>, <code>znva()</code>
|
||||
<code>getchar()</code>. I pass a dummy argument to <code>getchar()</code> to eliminate
|
||||
“variable number of args” from lint (unless it checks against
|
||||
the library). Otherwise, all versions of lint complain that <code>main()</code>
|
||||
returns random value & constant in conditional context (when I
|
||||
check for ROT13 version).</p>
|
||||
<p><code>ver0</code> and <code>ver1</code> use a range check and a calculation to do ROT13,
|
||||
while <code>ver2</code> and <code>ver3</code> use table lookup. All versions contain
|
||||
<code>main()</code> and its ROT13 function, <code>znva()</code>. <code>ver0</code>/<code>ver1</code> (<code>ver2</code>/<code>ver3</code>) are
|
||||
(of course) syntactically identical, since the syntax is in the
|
||||
non-alphabetic characters. However, since one program starts
|
||||
at <code>main()</code> while it’s ROT13 counterpart starts at <code>znva()</code>, <code>znva()</code>
|
||||
calls main (<code>znva()</code> is also used for output).</p>
|
||||
<p>All versions use recursion to work. If the program is NOT reversing
|
||||
it’s output, it prints out the (possibly ROT13’d) character before
|
||||
recursing, otherwise it prints it out afterward (or doesn’t recurse at
|
||||
all when <code>EOF</code> is reached). Since most of this code is
|
||||
identical, it is put into <code>znva()</code> and called with a first
|
||||
parameter of 0 as a flag (as <code>main()</code>, it’s first argument
|
||||
(argc) must be at least one).</p>
|
||||
<p>I can’t use any flow control. If I used <code>if()</code>, I would
|
||||
have a function <code>vs()</code> to define in the ROT13 version. But a
|
||||
function called <code>vs()</code> turns into a function called
|
||||
<code>if()</code> in the original, so it can’t be done. Therefore, I
|
||||
do:</p>
|
||||
<p>All versions use recursion to work. If the program is NOT
|
||||
reversing it’s output, it prints out the (possibly ROT13’d)
|
||||
character before recursing, otherwise it prints it out
|
||||
afterward (or doesn’t recurse at all when <code>EOF</code> is reached).
|
||||
Since most of this code is identical, it is put into <code>znva()</code> and
|
||||
called with a first parameter of 0 as a flag (as <code>main()</code>, it’s
|
||||
first argument (argc) must be at least one).</p>
|
||||
<p>I can’t use any flow control. If I used <code>if()</code>, I would have a
|
||||
function <code>vs()</code> to define in the ROT13 version. But a function
|
||||
called <code>vs()</code> turns into a function called <code>if()</code> in the original,
|
||||
so it can’t be done. Therefore, I do:</p>
|
||||
<div class="sourceCode" id="cb8"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a>expr1 <span class="op">&&</span> expr2 <span class="op">&&</span> <span class="op">(</span>expr3<span class="op">=</span>etc<span class="op">);</span></span></code></pre></div>
|
||||
<p>which is the same as:</p>
|
||||
<div class="sourceCode" id="cb9"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="op">(</span>expr1 <span class="op">&&</span> expr2<span class="op">)</span> expr3<span class="op">=</span>etc<span class="op">;</span></span></code></pre></div>
|
||||
<p>A/UX on the Macintosh doesn’t get this right; it evaluates ALL
|
||||
expressions if they aren’t in an assignment or conditional statement.
|
||||
This might warrant a warning, since other compilers may do this. I found
|
||||
MANY compilers botched:</p>
|
||||
expressions if they aren’t in an assignment or conditional
|
||||
statement. This might warrant a warning, since other compilers
|
||||
may do this. I found MANY compilers botched:</p>
|
||||
<div class="sourceCode" id="cb10"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a>expr1 <span class="op">&&</span> <span class="op">(</span>expr2<span class="op">,</span>expr3<span class="op">);</span></span></code></pre></div>
|
||||
<p><code>expr2</code> was OFTEN evaluated even if <code>expr1</code> was
|
||||
false. I removed such statements to make it more portable.</p>
|
||||
<p><code>expr2</code> was OFTEN evaluated even if <code>expr1</code> was false. I removed
|
||||
such statements to make it more portable.</p>
|
||||
<h3 id="variable-names-worth-noting">Variable names worth noting</h3>
|
||||
<p><code>irk</code> and <code>vex</code> are ROT13 pairs and are
|
||||
synonyms.</p>
|
||||
<p><code>Near</code> and <code>Arne</code> are ROT13 pairs and are
|
||||
anagrams.</p>
|
||||
<p><code>NOON</code> and <code>ABBA</code> are ROT13 pairs and are
|
||||
palindromes.</p>
|
||||
<p><code>tang</code> and <code>gnat</code> are both ROT13 and palindrome
|
||||
pairs!</p>
|
||||
<p><code>irk</code> and <code>vex</code> are ROT13 pairs and are synonyms.</p>
|
||||
<p><code>Near</code> and <code>Arne</code> are ROT13 pairs and are anagrams.</p>
|
||||
<p><code>NOON</code> and <code>ABBA</code> are ROT13 pairs and are palindromes.</p>
|
||||
<p><code>tang</code> and <code>gnat</code> are both ROT13 and palindrome pairs!</p>
|
||||
<p>–</p>
|
||||
<p>Normally (!), a reversible C program is done thus:</p>
|
||||
<div class="sourceCode" id="cb11"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="co">/**/</span> forward code <span class="co">/*/ edoc drawkcab /**/</span></span></code></pre></div>
|
||||
<p>If your compiler nests comments, it will get this wrong. However, I
|
||||
have made some bits of the code palindromic, (or different, but
|
||||
reversible) so it is more like:</p>
|
||||
<p>If your compiler nests comments, it will get this wrong.
|
||||
However, I have made some bits of the code palindromic,
|
||||
(or different, but reversible) so it is more like:</p>
|
||||
<div class="sourceCode" id="cb12"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="co">/**/</span>forward<span class="co">/*//**/</span> palindromic <span class="co">/**//*/drawkcab/**/</span></span></code></pre></div>
|
||||
<p>The code can therefore be interlaced. There are eight such
|
||||
palindromic bits. You can find them within the
|
||||
<p>The code can therefore be interlaced. There are eight
|
||||
such palindromic bits. You can find them within the
|
||||
<code>/*//**/ /**//*/</code> pairs.</p>
|
||||
<p>The body of the code of <code>ver0</code> and <code>ver1</code> is a
|
||||
large lumpy <code>K</code> (for Kernighan); the code of
|
||||
<code>ver2</code> and <code>ver3</code> is a flat-topped and lumpier
|
||||
<code>R</code> (for Ritchie). Judicious use of spaces and tabs helped
|
||||
here. It barely fits on an 80x24 screen. Squint. Note that the code must
|
||||
start with a blank line, or the reversed version will lack a terminating
|
||||
newline.</p>
|
||||
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
|
||||
License:</h2>
|
||||
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
|
||||
Reserved. You are free to share and adapt this file under the terms of
|
||||
this license:</p>
|
||||
<p>The body of the code of <code>ver0</code> and <code>ver1</code> is a large lumpy <code>K</code> (for
|
||||
Kernighan); the code of <code>ver2</code> and <code>ver3</code> is a flat-topped and
|
||||
lumpier <code>R</code> (for Ritchie). Judicious use of spaces and tabs
|
||||
helped here. It barely fits on an 80x24 screen. Squint. Note
|
||||
that the code must start with a blank line, or the reversed version
|
||||
will lack a terminating newline.</p>
|
||||
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
|
||||
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
|
||||
You are free to share and adapt this file under the terms of this license:</p>
|
||||
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
|
||||
<p>For more information, see:
|
||||
https://creativecommons.org/licenses/by-sa/4.0/</p>
|
||||
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
|
||||
|
||||
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||||
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
|
||||
|
||||
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
|
||||
|
||||
<h1 id="inventory-for-1989westley"><a name="inventory"></a>Inventory for
|
||||
1989/westley</h1>
|
||||
<h1 id="inventory-for-1989westley"><a name="inventory"></a>Inventory for 1989/westley</h1>
|
||||
<p><a href="#top">Jump to top</a></p>
|
||||
<h2 id="primary-files">Primary files</h2>
|
||||
<ul>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/westley.c">westley.c</a>
|
||||
- entry source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/Makefile">Makefile</a>
|
||||
- entry Makefile</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/westley.orig.c">westley.orig.c</a>
|
||||
- original source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/compile.sh">compile.sh</a>
|
||||
- generate and compile versions</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/try.sh">try.sh</a>
|
||||
- how to run</li>
|
||||
<li><a href="1989_westley.tar.bz2">1989_westley.tar.bz2</a> - download
|
||||
entry source</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/westley.c">westley.c</a> - entry source</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/Makefile">Makefile</a> - entry Makefile</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/westley.orig.c">westley.orig.c</a> - original source</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/compile.sh">compile.sh</a> - generate and compile versions</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/try.sh">try.sh</a> - how to run</li>
|
||||
<li><a href="1989_westley.tar.bz2">1989_westley.tar.bz2</a> - download entry source</li>
|
||||
</ul>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<ul>
|
||||
<li><a href="index.html">index.html</a> - entry home page</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/.entry.json">.entry.json</a>
|
||||
- description of entry in JSON</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/.gitignore">.gitignore</a>
|
||||
- list of files that should not be committed under git</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/.entry.json">.entry.json</a> - description of entry in JSON</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
|
||||
<li><a href=".path">.path</a> - directory path from top directory</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/README.md">README.md</a>
|
||||
- markdown source for index.html</li>
|
||||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1989/westley/README.md">README.md</a> - markdown source for index.html</li>
|
||||
</ul>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
|
||||
|
||||
Reference in new issue
Block a user