add hack-a-round for language specified markdown code blocks

When language is specified in a markdown code block such as:

````
```c
    printf("Hello, world!\n");
```
````

is used, the resulting HTML as produced by `pandoc(1)` combined
with our revised `ioccc.css` is not intent the code block well.

A temporary "_hack-a-round_" is to turn the "markdown code language
specifier" into an HTML comment.  For example:

````
```<!---c-->
    printf("Hello, world!\n");
```
````

This commits turns off existing markdown code language specifiers
for now, while preserving our ability to restore them in the future
when a better  "_hack-a-round_" to the "markdown code language
specifier" problem is found.

The HTML impact if this "_hack-a-round_" is to produce HTML that
looks like this:

```
<pre class="&lt;!---c--&gt;"><code> .. </code></pre>
```

We might be able to create a complex set of classes for each markdown
code language (there won't be very many) in `ioccc.css`, or we might
find a more general CSS (or maybe `pandoc(1)`?) solution.

For now, this hack-a-round will have to do.
This commit is contained in:
Landon Curt Noll committed 2024-04-04 14:50:38 -07:00
1 parent 3919df50fb
commit b66c79254a
700 files changed
+7052 -7056

No files matched your search

+3 -3
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make all
```
@@ -12,7 +12,7 @@ program. See the [Alternate code](#alternate-code) section below for details.
## Try:
```sh
```<!---sh-->
./applin
```
@@ -25,7 +25,7 @@ with this entry.
### Alternate build:
```sh
```<!---sh-->
make alt
```
+3 -3
View File
@@ -141,18 +141,18 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.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> all</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make all</code></pre>
<p>A smaller version, originally called <code>zsmall.c</code> (and still exists as such, as
the source of the alt code), of <a href="applin.c">applin.c</a>, can be found in
<a href="applin.alt.c">applin.alt.c</a>. Your machine may have an easier time with this
program. See the <a href="#alternate-code">Alternate code</a> section below for details.</p>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./applin</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./applin</code></pre>
<h2 id="alternate-code">Alternate code:</h2>
<p>As noted above a smaller version can be used in case your <code>cpp</code> has a hard time
with this entry.</p>
<h3 id="alternate-build">Alternate build:</h3>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> alt</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make alt</code></pre>
<p>Use <code>applin.alt</code> as you would <code>applin</code> above.</p>
<h4 id="history-about-the-smaller-version">History about the smaller version:</h4>
<p>Way back in 1988 ..</p>
+3 -3
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make all
```
@@ -18,13 +18,13 @@ For more detailed information see [1988 dale bugs](../../bugs.html#1988_dale).
## Try:
```sh
```<!---sh-->
./try.sh
```
Observe that three of the commands in the script are:
```sh
```<!---sh-->
./dale these files are in this directory: *
./dale $(printf "the following files exist in this directory:\n%s\n" *)
./dale "$(printf "the following files exist in this directory:\n%s\n" *)"
+5 -5
View File
@@ -141,17 +141,17 @@ Location: <a href="../../location.html#AU">AU</a> - <em>Commonwealth of Australi
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.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> all</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make all</code></pre>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#1988_dale">1988 dale bugs</a>.</p>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<p>Observe that three of the commands in the script are:</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">./dale</span> these files are in this directory: <span class="pp">*</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./dale</span> <span class="va">$(</span><span class="bu">printf</span> <span class="st">&quot;the following files exist in this directory:\n%s\n&quot;</span> <span class="pp">*</span><span class="va">)</span></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./dale</span> <span class="st">&quot;</span><span class="va">$(</span><span class="bu">printf</span> <span class="st">&quot;the following files exist in this directory:\n%s\n&quot;</span> <span class="pp">*</span><span class="va">)</span><span class="st">&quot;</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./dale these files are in this directory: *
./dale $(printf &quot;the following files exist in this directory:\n%s\n&quot; *)
./dale &quot;$(printf &quot;the following files exist in this directory:\n%s\n&quot; *)&quot;</code></pre>
<p>As the script asks what do the last two do and why do they do it? Why do they
differ in format from the first command? Finally how can you get the more likely
desired behaviour?</p>
+5 -5
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make all
```
@@ -11,7 +11,7 @@ code](#alternate-code) below.
## To use:
```sh
```<!---sh-->
./isaak
```
@@ -21,7 +21,7 @@ code](#alternate-code) below.
The original version of this code is in [isaak.alt.c](isaak.alt.c).
The original entry starts with the line:
```c
```<!---c-->
main(){};
```
@@ -37,7 +37,7 @@ compile.
### Alternate build:
```sh
```<!---sh-->
make alt
```
@@ -64,7 +64,7 @@ due to the fact that BSD style systems have an `sprintf(3)` that returns a `char
*`. Due to the above problems, we placed the output of this program in the
file: isaak.encode. To read this file do.
```sh
```<!---sh-->
uudecode < isaak.encode
cat isaak.output
```
+6 -6
View File
@@ -141,16 +141,16 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></l
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.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> all</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make all</code></pre>
<p>There is an alternate version, the original, that can’t be compiled in modern
systems but can be if you have an old enough compiler. See <a href="#alternate-code">Alternate
code</a> below.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./isaak</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./isaak</code></pre>
<h2 id="alternate-code">Alternate code:</h2>
<p>The original version of this code is in <a href="isaak.alt.c">isaak.alt.c</a>.
The original entry starts with the line:</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> main<span class="op">(){};</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> main(){};</code></pre>
<p>This works on some systems. Why? Note that <code>#include &lt;stdio.h&gt;</code> is given on
the last line. Why is this needed? Note the unusual calls to <code>sprintf(3)</code>.</p>
<p>This version also relied on being able to define <code>#define</code> to something else and
@@ -158,7 +158,7 @@ using that macro for <code>#define</code>.</p>
<p>This version will not likely work on modern systems if you can even get it to
compile.</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>
<pre class="&lt;!---sh--&gt;"><code> make alt</code></pre>
<p>Use <code>isaak.alt</code> as you would <code>isaak</code> above.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>The program relies heavily on ASCII. Don’t even think of running it on
@@ -173,8 +173,8 @@ from a single macro (e.g., <code>"O/**/O"</code> creates either <code>++</code>
<p>NOTE: Most System V machines were not be able to execute this program correctly
due to the fact that BSD style systems have an <code>sprintf(3)</code> that returns a <code>char *</code>. Due to the above problems, we placed the output of this program in the
file: isaak.encode. To read this file do.</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">uudecode</span> <span class="op">&lt;</span> isaak.encode</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">cat</span> isaak.output</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> uudecode &lt; isaak.encode
cat isaak.output</code></pre>
<p>Since this was fixed, this file is not strictly necessary. See the
<a href="isaak.alt.c">isaak.alt.c</a> for the original source.</p>
<p>FYI: We are likely to be more strict about portability in the future.</p>
+7 -7
View File
@@ -1,13 +1,13 @@
## To build:
```sh
```<!---sh-->
make
```
## To use:
```sh
```<!---sh-->
./litmaath some text
```
@@ -17,7 +17,7 @@ code](#alternate-code) section below.
## Try:
```sh
```<!---sh-->
./litmaath eschew obfuscation
```
@@ -31,7 +31,7 @@ a file.
### Alternate build:
```sh
```<!---sh-->
make alt
```
@@ -40,7 +40,7 @@ Use `litmaath.alt` as you would `litmaath` above.
### Alternate try:
```sh
```<!---sh-->
./litmaath.alt six was afraid of seven because seven eight nine
```
@@ -50,7 +50,7 @@ Use `litmaath.alt` as you would `litmaath` above.
Note the unusual structure:
```c
```<!---c-->
while (<condition>)
;
```
@@ -66,7 +66,7 @@ could make the body of the `while` loop an `fprintf` with interesting
variables like:
```c
```<!---c-->
fprintf(stderr,
"argv=%lo *argv=%lo **argv=%c argv[1]=%lo *argv[1]=%c argc=%d\n",
(long) argv, (long) *argv, *argv && **argv ? **argv : '@',
+11 -11
View File
@@ -141,26 +141,26 @@ Location: <a href="../../location.html#CH">CH</a> - <em>Swiss Confederation</em>
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.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>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./litmaath</span> some text</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./litmaath some text</code></pre>
<p>There is an alternate version provided. See the <a href="#alternate-code">Alternate
code</a> section below.</p>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./litmaath</span> eschew obfuscation</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./litmaath eschew obfuscation</code></pre>
<h2 id="alternate-code">Alternate code:</h2>
<p>This alternate code, added to help understand the entry and for fun, is code
that we suggested at the time of the entry publication but which we never put in
a file.</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>
<pre class="&lt;!---sh--&gt;"><code> make alt</code></pre>
<p>Use <code>litmaath.alt</code> as you would <code>litmaath</code> above.</p>
<h3 id="alternate-try">Alternate try:</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">./litmaath.alt</span> six was afraid of seven because seven eight nine</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./litmaath.alt six was afraid of seven because seven eight nine</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Note the unusual structure:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a> <span class="cf">while</span> <span class="op">(&lt;</span>condition<span class="op">&gt;)</span></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a> <span class="op">;</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> while (&lt;condition&gt;)
;</code></pre>
<p>Did you notice that the body is empty?</p>
<p>Furthermore, it’s interesting to note that only two variables are
used to achieve everything.</p>
@@ -168,10 +168,10 @@ used to achieve everything.</p>
two small strings as arguments, and follow the program closely. One
could make the body of the <code>while</code> loop an <code>fprintf</code> with interesting
variables like:</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> fprintf<span class="op">(</span>stderr<span class="op">,</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;argv=</span><span class="sc">%lo</span><span class="st"> *argv=</span><span class="sc">%lo</span><span class="st"> **argv=</span><span class="sc">%c</span><span class="st"> argv[1]=</span><span class="sc">%lo</span><span class="st"> *argv[1]=</span><span class="sc">%c</span><span class="st"> argc=</span><span class="sc">%d\n</span><span class="st">&quot;</span><span class="op">,</span></span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a> <span class="op">(</span><span class="dt">long</span><span class="op">)</span> argv<span class="op">,</span> <span class="op">(</span><span class="dt">long</span><span class="op">)</span> <span class="op">*</span>argv<span class="op">,</span> <span class="op">*</span>argv <span class="op">&amp;&amp;</span> <span class="op">**</span>argv <span class="op">?</span> <span class="op">**</span>argv <span class="op">:</span> <span class="ch">&#39;@&#39;</span><span class="op">,</span></span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a> <span class="op">(</span><span class="dt">long</span><span class="op">)</span> argv<span class="op">[</span><span class="dv">1</span><span class="op">],</span> argv<span class="op">[</span><span class="dv">1</span><span class="op">]</span> <span class="op">&amp;&amp;</span> <span class="op">*</span>argv<span class="op">[</span><span class="dv">1</span><span class="op">]</span> <span class="op">?</span> <span class="op">*</span>argv<span class="op">[</span><span class="dv">1</span><span class="op">]</span> <span class="op">:</span> <span class="ch">&#39;@&#39;</span><span class="op">,</span> argc<span class="op">);</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> fprintf(stderr,
&quot;argv=%lo *argv=%lo **argv=%c argv[1]=%lo *argv[1]=%c argc=%d\n&quot;,
(long) argv, (long) *argv, *argv &amp;&amp; **argv ? **argv : &#39;@&#39;,
(long) argv[1], argv[1] &amp;&amp; *argv[1] ? *argv[1] : &#39;@&#39;, argc);</code></pre>
<p>… which is what the <a href="#alternate-code">alternate code</a> is.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>No remarks were provided by the author.</p>
+1 -1
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make all
```
+1 -1
View File
@@ -141,7 +141,7 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></l
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.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> all</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make all</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Compile and run without parameters.</p>
<p>The program is smaller than even the ‘compressed’ form of its output,
+3 -3
View File
@@ -1,13 +1,13 @@
## To build:
```sh
```<!---sh-->
make all
```
## Try:
```sh
```<!---sh-->
./reddy
char *(*(fun[16])();
char *(*(*(*(*(*fun[32])))))();
@@ -15,7 +15,7 @@
What happens if you input, and what you do about it?
```c
```<!---c-->
char *(*(*(*(*(*fun[32])))))());
```
+5 -5
View File
@@ -141,13 +141,13 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></l
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.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> all</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make all</code></pre>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./reddy</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">char</span> <span class="pp">*(*(</span>fun<span class="pp">[</span><span class="ss">16</span><span class="pp">])</span>(<span class="pp">)</span><span class="kw">;</span></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">char</span> <span class="pp">*(*(*(*(*(*</span>fun<span class="pp">[</span><span class="ss">32</span><span class="pp">])))))</span><span class="er">(</span><span class="kw">);</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./reddy
char *(*(fun[16])();
char *(*(*(*(*(*fun[32])))))();</code></pre>
<p>What happens if you input, and what you do about it?</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="dt">char</span> <span class="op">*(*(*(*(*(*</span>fun<span class="op">[</span><span class="dv">32</span><span class="op">])))))());</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> char *(*(*(*(*(*fun[32])))))());</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This is a somewhat restricted version of a useful program that has been
posted to Usenet. What is unusual is what it is able to do so much
+4 -4
View File
@@ -1,20 +1,20 @@
## To build:
```sh
```<!---sh-->
make all
```
## Try:
```sh
```<!---sh-->
./robison 80 10
./robison 40 16
```
The first and second parameters are optional. You might also try:
```sh
```<!---sh-->
./robison 80 2 # <--- can you find the bug?
./robison 80 -246
```
@@ -24,7 +24,7 @@ The first and second parameters are optional. You might also try:
The following might make an interesting benchmark:
```sh
```<!---sh-->
./robison 100
```
+6 -6
View File
@@ -141,16 +141,16 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.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> all</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make all</code></pre>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./robison</span> 80 10</span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./robison</span> 40 16</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./robison 80 10
./robison 40 16</code></pre>
<p>The first and second parameters are optional. You might also try:</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">./robison</span> 80 2 <span class="co"># &lt;--- can you find the bug?</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./robison</span> 80 <span class="at">-246</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./robison 80 2 # &lt;--- can you find the bug?
./robison 80 -246</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>The following might make an interesting benchmark:</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">./robison</span> 100</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./robison 100</code></pre>
<p>[Amdahl 5890-300E with System V cc: 8.40 seconds]</p>
<p>We suggest that you C pre-process and perhaps C-beautify this program.
All is not what it may appear to be in this program. Why does a <code>whi1e</code>
+6 -6
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make clobber all
```
@@ -12,7 +12,7 @@ code](#alternate-code) section below.
## To use:
```sh
```<!---sh-->
./spinellis
```
@@ -21,7 +21,7 @@ EOF (typically ctrl-d).
Now run again:
```sh
```<!---sh-->
./spinellis
```
@@ -33,7 +33,7 @@ For clang or compilers that won't read from `/dev/tty`, we provide this version.
### Alternate build:
```sh
```<!---sh-->
make clobber alt
```
@@ -42,7 +42,7 @@ and follow the instructions.
### Alternate use:
```sh
```<!---sh-->
./spinellis.alt
```
@@ -51,7 +51,7 @@ EOF (typically ctrl-d).
Now run again:
```sh
```<!---sh-->
./spinellis.alt
```
+6 -6
View File
@@ -141,27 +141,27 @@ Location: <a href="../../location.html#GR">GR</a> - <em>Hellenic Republic</em> (
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.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> clobber all</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make clobber all</code></pre>
<p>and follow the instructions this will give you.</p>
<p>If your compiler will not read from <code>/dev/tty</code> see the <a href="#alternate-code">Alternate
code</a> section below.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./spinellis</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./spinellis</code></pre>
<p>Type in or copy paste some C code, perhaps from <a href="input.txt">input.txt</a>, and send
EOF (typically ctrl-d).</p>
<p>Now run again:</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">./spinellis</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./spinellis</code></pre>
<h2 id="alternate-code">Alternate code:</h2>
<p>For clang or compilers that won’t read from <code>/dev/tty</code>, we provide this version.</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> clobber alt</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make clobber alt</code></pre>
<p>and follow the instructions.</p>
<h3 id="alternate-use">Alternate use:</h3>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./spinellis.alt</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./spinellis.alt</code></pre>
<p>Type in or copy paste some C code, perhaps from <a href="input.txt">input.txt</a>, and send
EOF (typically ctrl-d).</p>
<p>Now run again:</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">./spinellis.alt</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./spinellis.alt</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>We enjoyed this entry this year; however in the future programs must be able to
be compiled from within a Makefile without the need of human intervention.</p>
+8 -8
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make all
```
@@ -11,13 +11,13 @@ might wish to do so.
## Try:
```sh
```<!---sh-->
./westley
```
Also try:
```sh
```<!---sh-->
./try.sh
```
@@ -31,7 +31,7 @@ This version is the original which might not work as you expect nowadays.
### Alternate build:
```sh
```<!---sh-->
make alt
```
@@ -41,7 +41,7 @@ This version is the original which might not work as you expect nowadays.
To see if your compiler has the problem described in the Judges' remarks below,
try:
```sh
```<!---sh-->
./westley.alt
```
@@ -52,7 +52,7 @@ Does it show the same output as `westley`?
Your compiler must parse
```c
```<!---c-->
#define _ -a
-_
```
@@ -62,7 +62,7 @@ conforming ANSI C Preprocessors may object to this: for such
compilers, you can elide the non-standard token-pasting requirement
by changing the #define line to:
```c
```<!---c-->
#define _ F-->00||F-OO--;
```
@@ -71,7 +71,7 @@ code is the original.
You might enjoy looking at the output of:
```sh
```<!---sh-->
cc -E westley.alt.c
```
+9 -9
View File
@@ -141,37 +141,37 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.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> all</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make all</code></pre>
<p>NOTE: this version is a fixed version for modern C compilers. See the <a href="#alternate-code">Alternate
code</a> section below for how to use the original and why one
might wish to do so.</p>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./westley</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./westley</code></pre>
<p>Also try:</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">./try.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<p>to show the code with followed by the result so you can truly see the magic.</p>
<h2 id="alternate-code">Alternate code:</h2>
<p>This version is the original which might not work as you expect nowadays.</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>
<pre class="&lt;!---sh--&gt;"><code> make alt</code></pre>
<h3 id="alternate-use">Alternate use:</h3>
<p>To see if your compiler has the problem described in the Judges’ remarks below,
try:</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">./westley.alt</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./westley.alt</code></pre>
<p>Does it show the same output as <code>westley</code>?</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Your compiler must parse</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define _ </span><span class="op">-</span><span class="pp">a</span></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a> <span class="op">-</span>_</span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> #define _ -a
-_</code></pre>
<p>as <code>--a</code> and not <code>-(-a)</code> or some other tokenized form. Some strictly
conforming ANSI C Preprocessors may object to this: for such
compilers, you can elide the non-standard token-pasting requirement
by changing the #define line to:</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="pp">#define _ F</span><span class="op">--&gt;</span><span class="bn">00</span><span class="op">||</span><span class="pp">F</span><span class="op">-</span><span class="pp">OO</span><span class="op">--;</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> #define _ F--&gt;00||F-OO--;</code></pre>
<p>This is what the modified code in <a href="westley.c">westley.c</a> does whereas the alt
code is the original.</p>
<p>You might enjoy looking at the output of:</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="fu">cc</span> <span class="at">-E</span> westley.alt.c</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> cc -E westley.alt.c</code></pre>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>No remarks were provided by the author.</p>
<!--