improved indentation and whitespace for markdown code blocks

All code blocks in markdown have been intended by at least 4 spaces.

We add `--tab-stop=8` to all `pandoc(1)` executions in order to set
a better tab stop indentation, especially for tab intended code blocks.

Changed `bin/pandoc-wrapper.sh` VERSION from "1.5.3 2024-03-26"
to "1.6 2024-03-31".

Fixed `1991/brnstnd/sorta.README.md` so that the sorta code
is code blocks.

Removed unneeded paragraph group in copyright in `inc/footer.default.html`.

Fixed excess whitespace after list Author on entry `index.html` page.

Changed `bin/output-index-author.sh` VERSION from "1.5.2 2024-03-26"
to "1.6 2024-03-31".

Performed `make www` to perform the above and test under macOS.

TODO: Fix the problem of the initial line of code being extra intended.
TODO: Fix excess whitespace around code that is inline.
This commit is contained in:
Landon Curt Noll committed 2024-04-01 04:48:48 -07:00
1 parent b84c27ce02
commit a996f8d2b8
734 files changed
+16723 -16963

No files matched your search

+4 -4
View File
@@ -1,14 +1,14 @@
## To build:
```sh
make all
make all
```
## To use:
```sh
./anonymous
./anonymous
```
@@ -23,7 +23,7 @@ as the alternate code. See below for the tattoo side-by-side with the code.
### Alternate build:
```sh
make alt
make alt
```
@@ -32,7 +32,7 @@ make alt
NOTE: this version might not work on some systems like macOS.
```sh
./anonymous.alt
./anonymous.alt
```
+5 -6
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Anonymous_1984">Anonymous 1984</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,19 +141,19 @@ 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>
<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>
<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">./anonymous</span></span></code></pre></div>
<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">./anonymous</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>The original version of this entry was added, by request,
in order to show the code that was turned into the
<a href="https://web.archive.org/web/20070120220721/https://thomasscovell.com/tattoo.php">tattoo</a>,
as the alternate code. See below for the tattoo side-by-side with the code.</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>
<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>
<h3 id="alternate-use">Alternate use:</h3>
<p>NOTE: this version might not work on some systems like macOS.</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">./anonymous.alt</span></span></code></pre></div>
<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">./anonymous.alt</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>The author was too embarrassed that they could write such trash, so I
promised to protect their identity. I will say that the author of this
+8 -8
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make all
make all
```
NOTE: there is an [alternate version](#alternate-code) which will only work if
@@ -14,7 +14,7 @@ The original code was fixed in 2023 to not require this.
The current status of this entry is:
```
STATUS: INABIAF - please **DO NOT** fix
STATUS: INABIAF - please **DO NOT** fix
```
For more detailed information see [1984 decot bugs](../../bugs.html#1984_decot).
@@ -23,7 +23,7 @@ For more detailed information see [1984 decot bugs](../../bugs.html#1984_decot).
## To use:
```sh
./decot
./decot
```
@@ -37,14 +37,14 @@ can use this version.
### Alternate build:
```sh
make alt
make alt
```
### Alternate use:
```sh
./decot.alt
./decot.alt
```
@@ -62,13 +62,13 @@ Some new (in 1984) compilers disliked line 15 of the original source, so we
changed it from:
```c
for(signal=0;*k * x * __FILE__ *i;) do {
for(signal=0;*k * x * __FILE__ *i;) do {
```
to:
```c
for(signal=0;*k *x * __FILE__ *i;) do {
for(signal=0;*k *x * __FILE__ *i;) do {
```
To see what we mean look at the [original source file](decot.orig.c). The
@@ -76,7 +76,7 @@ To see what we mean look at the [original source file](decot.orig.c). The
fixed version has instead:
```c
for(signal=0;*k *= * __FILE__ *i;) do {
for(signal=0;*k *= * __FILE__ *i;) do {
```
+9 -10
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Dave_Decot">Dave Decot</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,24 +141,24 @@ 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>
<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>
<p>NOTE: there is an <a href="#alternate-code">alternate version</a> which will only work if
you have an old enough compiler or a compiler that supports <code>-traditional-cpp</code>.
The original code was fixed in 2023 to not require this.</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>
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#1984_decot">1984 decot bugs</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">./decot</span></span></code></pre></div>
<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">./decot</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>This alternate code, the original, requires a compiler that supports
<code>-traditional-cpp</code> or an old enough compiler. If you have such a compiler you
can use 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> alt</span></code></pre></div>
<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">./decot.alt</span></span></code></pre></div>
<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">./decot.alt</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This program prints out what looks like a fragment of C code.</p>
<p>Is this a <strong>bug</strong> or is this a <strong>feature</strong>? To help choose
@@ -167,13 +166,13 @@ the judges offer this one comment: understand remarks!</p>
<h3 id="historical-remarks">Historical remarks:</h3>
<p>Some new (in 1984) compilers disliked line 15 of the original source, so we
changed it from:</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">for</span><span class="op">(</span>signal<span class="op">=</span><span class="dv">0</span><span class="op">;*</span>k <span class="op">*</span> x <span class="op">*</span> __FILE__ <span class="op">*</span>i<span class="op">;)</span> <span class="cf">do</span> <span class="op">{</span></span></code></pre></div>
<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">for</span><span class="op">(</span>signal<span class="op">=</span><span class="dv">0</span><span class="op">;*</span>k <span class="op">*</span> x <span class="op">*</span> __FILE__ <span class="op">*</span>i<span class="op">;)</span> <span class="cf">do</span> <span class="op">{</span></span></code></pre></div>
<p>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="cf">for</span><span class="op">(</span>signal<span class="op">=</span><span class="dv">0</span><span class="op">;*</span>k <span class="op">*</span>x <span class="op">*</span> __FILE__ <span class="op">*</span>i<span class="op">;)</span> <span class="cf">do</span> <span class="op">{</span></span></code></pre></div>
<div class="sourceCode" id="cb7"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span><span class="op">(</span>signal<span class="op">=</span><span class="dv">0</span><span class="op">;*</span>k <span class="op">*</span>x <span class="op">*</span> __FILE__ <span class="op">*</span>i<span class="op">;)</span> <span class="cf">do</span> <span class="op">{</span></span></code></pre></div>
<p>To see what we mean look at the <a href="decot.orig.c">original source file</a>. The
<a href="decot.alt.c">alternate code</a> is the version that has this modification. The
fixed version has instead:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span><span class="op">(</span>signal<span class="op">=</span><span class="dv">0</span><span class="op">;*</span>k <span class="op">*=</span> <span class="op">*</span> __FILE__ <span class="op">*</span>i<span class="op">;)</span> <span class="cf">do</span> <span class="op">{</span></span></code></pre></div>
<div class="sourceCode" id="cb8"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span><span class="op">(</span>signal<span class="op">=</span><span class="dv">0</span><span class="op">;*</span>k <span class="op">*=</span> <span class="op">*</span> __FILE__ <span class="op">*</span>i<span class="op">;)</span> <span class="cf">do</span> <span class="op">{</span></span></code></pre></div>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>No remarks were provided by the author.</p>
<!--
+10 -10
View File
@@ -1,14 +1,14 @@
## To build:
```sh
make all
make all
```
## To use:
```sh
./laman <positive number>
./laman <positive number>
```
@@ -18,11 +18,11 @@ The program accepts ONE POSITIVE number. Seeing is believing, so try things
like:
```sh
./try.sh
./try.sh
./laman 4
./laman 9
./laman 16
./laman 4
./laman 9
./laman 16
```
This code should run you in circles.
@@ -34,15 +34,15 @@ Some new compilers (in 1984) dislike lines 6 and 10 of the source, so we changed
them from:
```c
;++f)a[ b<<5|c] =d++,b+ =e;for( f=0;f<O
<<5|c]^ =a[b<<5 |c]^=a[ (k-(b+1 ))<<5|c]
;++f)a[ b<<5|c] =d++,b+ =e;for( f=0;f<O
<<5|c]^ =a[b<<5 |c]^=a[ (k-(b+1 ))<<5|c]
```
to:
```c
;++f)a[ b<<5|c] =d++,b+= e;for( f=0;f<O
<<5|c]^= a[b<<5 |c]^=a[ (k-(b+1 ))<<5|c]
;++f)a[ b<<5|c] =d++,b+= e;for( f=0;f<O
<<5|c]^= a[b<<5 |c]^=a[ (k-(b+1 ))<<5|c]
```
I hope you have a C beautifier!
+11 -12
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Mike_Laman">Mike Laman</a><br>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<br><br></li>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,26 +141,26 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</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> all</span></code></pre></div>
<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>
<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">./laman</span> <span class="op">&lt;</span>positive number<span class="op">&gt;</span></span></code></pre></div>
<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">./laman</span> <span class="op">&lt;</span>positive number<span class="op">&gt;</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<p>The program accepts ONE POSITIVE number. Seeing is believing, so try things
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">./try.sh</span></span>
<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>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./laman</span> 4</span>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a><span class="ex">./laman</span> 9</span>
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a><span class="ex">./laman</span> 16</span></code></pre></div>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./laman</span> 4</span>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">./laman</span> 9</span>
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a> <span class="ex">./laman</span> 16</span></code></pre></div>
<p>This code should run you in circles.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Some new compilers (in 1984) dislike lines 6 and 10 of the source, so we changed
them from:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="op">;++</span>f<span class="op">)</span>a<span class="op">[</span> b<span class="op">&lt;&lt;</span><span class="dv">5</span><span class="op">|</span>c<span class="op">]</span> <span class="op">=</span>d<span class="op">++,</span>b<span class="op">+</span> <span class="op">=</span>e<span class="op">;</span><span class="cf">for</span><span class="op">(</span> f<span class="op">=</span><span class="dv">0</span><span class="op">;</span>f<span class="op">&lt;</span>O</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="op">&lt;&lt;</span><span class="dv">5</span><span class="op">|</span>c<span class="op">]^</span> <span class="op">=</span>a<span class="op">[</span>b<span class="op">&lt;&lt;</span><span class="dv">5</span> <span class="op">|</span>c<span class="op">]^=</span>a<span class="op">[</span> <span class="op">(</span>k<span class="op">-(</span>b<span class="op">+</span><span class="dv">1</span> <span class="op">))&lt;&lt;</span><span class="dv">5</span><span class="op">|</span>c<span class="op">]</span></span></code></pre></div>
<div class="sourceCode" id="cb4"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="op">;++</span>f<span class="op">)</span>a<span class="op">[</span> b<span class="op">&lt;&lt;</span><span class="dv">5</span><span class="op">|</span>c<span class="op">]</span> <span class="op">=</span>d<span class="op">++,</span>b<span class="op">+</span> <span class="op">=</span>e<span class="op">;</span><span class="cf">for</span><span class="op">(</span> f<span class="op">=</span><span class="dv">0</span><span class="op">;</span>f<span class="op">&lt;</span>O</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="op">&lt;&lt;</span><span class="dv">5</span><span class="op">|</span>c<span class="op">]^</span> <span class="op">=</span>a<span class="op">[</span>b<span class="op">&lt;&lt;</span><span class="dv">5</span> <span class="op">|</span>c<span class="op">]^=</span>a<span class="op">[</span> <span class="op">(</span>k<span class="op">-(</span>b<span class="op">+</span><span class="dv">1</span> <span class="op">))&lt;&lt;</span><span class="dv">5</span><span class="op">|</span>c<span class="op">]</span></span></code></pre></div>
<p>to:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="op">;++</span>f<span class="op">)</span>a<span class="op">[</span> b<span class="op">&lt;&lt;</span><span class="dv">5</span><span class="op">|</span>c<span class="op">]</span> <span class="op">=</span>d<span class="op">++,</span>b<span class="op">+=</span> e<span class="op">;</span><span class="cf">for</span><span class="op">(</span> f<span class="op">=</span><span class="dv">0</span><span class="op">;</span>f<span class="op">&lt;</span>O</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="op">&lt;&lt;</span><span class="dv">5</span><span class="op">|</span>c<span class="op">]^=</span> a<span class="op">[</span>b<span class="op">&lt;&lt;</span><span class="dv">5</span> <span class="op">|</span>c<span class="op">]^=</span>a<span class="op">[</span> <span class="op">(</span>k<span class="op">-(</span>b<span class="op">+</span><span class="dv">1</span> <span class="op">))&lt;&lt;</span><span class="dv">5</span><span class="op">|</span>c<span class="op">]</span></span></code></pre></div>
<div class="sourceCode" id="cb5"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="op">;++</span>f<span class="op">)</span>a<span class="op">[</span> b<span class="op">&lt;&lt;</span><span class="dv">5</span><span class="op">|</span>c<span class="op">]</span> <span class="op">=</span>d<span class="op">++,</span>b<span class="op">+=</span> e<span class="op">;</span><span class="cf">for</span><span class="op">(</span> f<span class="op">=</span><span class="dv">0</span><span class="op">;</span>f<span class="op">&lt;</span>O</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> <span class="op">&lt;&lt;</span><span class="dv">5</span><span class="op">|</span>c<span class="op">]^=</span> a<span class="op">[</span>b<span class="op">&lt;&lt;</span><span class="dv">5</span> <span class="op">|</span>c<span class="op">]^=</span>a<span class="op">[</span> <span class="op">(</span>k<span class="op">-(</span>b<span class="op">+</span><span class="dv">1</span> <span class="op">))&lt;&lt;</span><span class="dv">5</span><span class="op">|</span>c<span class="op">]</span></span></code></pre></div>
<p>I hope you have a C beautifier!</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>No remarks were provided by the author.</p>
+87 -88
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make alt
make alt
```
NOTE: the original code will not work on any system other than
@@ -16,7 +16,7 @@ the original version.
The current status of this entry is:
```
STATUS: INABIAF - please **DO NOT** fix
STATUS: INABIAF - please **DO NOT** fix
```
For more detailed information see [1984 mullender bugs](../../bugs.html#1984_mullender).
@@ -25,7 +25,7 @@ For more detailed information see [1984 mullender bugs](../../bugs.html#1984_mul
## To use:
```sh
./mullender.alt [microseconds]
./mullender.alt [microseconds]
```
Hit ctrl-c/intr to exit the program.
@@ -49,13 +49,13 @@ which is probably not as uncommon as you think :-).
## Try:
```sh
./mullender.alt
./mullender.alt
./mullender.alt 5000 # wait for 5000 microseconds and see what happens
./mullender.alt 5000 # wait for 5000 microseconds and see what happens
./mullender.alt 20000 # wait for 20000 microseconds and see what happens
./mullender.alt 20000 # wait for 20000 microseconds and see what happens
./mullender.alt 100000 # wait for 100000 microseconds and see what happens
./mullender.alt 100000 # wait for 100000 microseconds and see what happens
```
What happens if you hit enter after it reaches the end of the line? Why? What
@@ -73,14 +73,14 @@ machine dependent code was discouraged.
### Original build:
```sh
make all
make all
```
### Original use:
```sh
./mullender
./mullender
```
@@ -138,19 +138,19 @@ Repo](https://github.com/dspinellis/unix-history-repo/tree/Research-Release).
```sh
make gentab
make gentab
```
### gentab use:
```sh
./gentab file
./gentab file
```
### gentab try:
```sh
./gentab gentab > g.c
./gentab gentab > g.c
```
NOTE: it is highly unlikely that you will be able to run the output of `gentab`
@@ -285,18 +285,18 @@ We both knew [PDP-11](https://en.wikipedia.org/wiki/PDP-11) assembly so that was
no problem. The assembly code we came up with is as follows:
```asm
pdp:
mov pc,r4
tst -(r4)
sub $9, r4
mov r4,0f
mov $1, r0
sys 4; 0:0; 9
mov $1000, r2
1:
sys 55
sob r2,1b
br pdp
pdp:
mov pc,r4
tst -(r4)
sub $9, r4
mov r4,0f
mov $1, r0
sys 4; 0:0; 9
mov $1000, r2
1:
sys 55
sob r2,1b
br pdp
```
This is not the code we originally wrote, but it is the code that we ultimately
@@ -332,26 +332,26 @@ program that we came up with is as follows:
```asm
vax: .word 0400 + (pdp - vax) / 2 - 1
1:
pushl $9
pushal str
pushl $1
calls $3, write
cvtwl $32767, r2
vax: .word 0400 + (pdp - vax) / 2 - 1
1:
pushl $9
pushal str
pushl $1
calls $3, write
cvtwl $32767, r2
2:
decl r2
jneq 2b
jbr 1b
2:
decl r2
jneq 2b
jbr 1b
write: .word 0
chmk $4
ret
write: .word 0
chmk $4
ret
str: .ascii " :-)\b\b\b\b"
str: .ascii " :-)\b\b\b\b"
pdp: .word 4548, 3044, 58820, 9, 4407, 6, 5568, 1, 35076, 0, 9, 5570, 512, 35117, 32386, 496
pdp: .word 4548, 3044, 58820, 9, 4407, 6, 5568, 1, 35076, 0, 9, 5570, 512, 35117, 32386, 496
```
The first word (after the label `vax`) is the
@@ -390,60 +390,59 @@ extracted the machine code from the object file.
compiled in modern systems.
```c
\#include <stdio.h>
\#include <a.out.h>
#include <stdio.h>
#include <a.out.h>
main(argc, argv) char **argv;
{
register FILE *fp;
register short pos = 0, c, n;
register char *fmt;
if (argc != 2) {
fprintf (stderr, "Usage: %s file\n", argv[0]);
exit (1);
}
if ((fp = fopen(argv[1], "r")) == NULL) {
fprintf(stderr, "%s: can't open %s\n", argv[0], argv[1]);
exit(2);
}
fseek (fp, (long) sizeof (struct exec), 0);
printf("/* portable between VAX and PDP11 */\n\n");
printf ("short main[] = {\n");
for (;;) {
if (pos == 0)
printf("\t");
c=getc(fp) & 0377;
if (feof(fp)) break;
n = getc(fp) << 8|c;
switch (rand() % 5) {
case 0:
case 1:
fmt = "%d"; break;
case 2:
fmt = "%u"; break;
case 3:
fmt = "0%o"; break;
case 4:
fmt = "0x%x"; break;
main(argc, argv) char **argv;
{
register FILE *fp;
register short pos = 0, c, n;
register char *fmt;
if (argc != 2) {
fprintf (stderr, "Usage: %s file\n", argv[0]);
exit (1);
}
if (32 <= n && n < 127 && (rand() % 4)) fmt = "'%c'";
printf(n < 8 ? "%d" : fmt, n);
printf(",");
if (pos++ == 8) {
printf("\n");
pos = 0;
if ((fp = fopen(argv[1], "r")) == NULL) {
fprintf(stderr, "%s: can't open %s\n", argv[0], argv[1]);
exit(2);
}
else printf(" ");
printf("};\n");
fseek (fp, (long) sizeof (struct exec), 0);
printf("/* portable between VAX and PDP11 */\n\n");
printf ("short main[] = {\n");
for (;;) {
if (pos == 0)
printf("\t");
c=getc(fp) & 0377;
if (feof(fp)) break;
n = getc(fp) << 8|c;
switch (rand() % 5) {
case 0:
case 1:
fmt = "%d"; break;
case 2:
fmt = "%u"; break;
case 3:
fmt = "0%o"; break;
case 4:
fmt = "0x%x"; break;
}
if (32 <= n && n < 127 && (rand() % 4)) fmt = "'%c'";
printf(n < 8 ? "%d" : fmt, n);
printf(",");
if (pos++ == 8) {
printf("\n");
pos = 0;
}
else printf(" ");
printf("};\n");
}
}
}
```
As can be seen, there is a slight preference for decimal, and also a character
+87 -88
View File
@@ -135,8 +135,7 @@
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#Sjoerd_Mullender">Sjoerd Mullender</a><br>
Location: <a href="../../location.html#NL">NL</a> - <em>Kingdom of the Netherlands</em> (<em>Netherlands</em>)
<br><br></li>
Location: <a href="../../location.html#NL">NL</a> - <em>Kingdom of the Netherlands</em> (<em>Netherlands</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -145,7 +144,7 @@ Location: <a href="../../location.html#NL">NL</a> - <em>Kingdom of the Netherlan
<!-- 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> alt</span></code></pre></div>
<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> alt</span></code></pre></div>
<p>NOTE: the original code will not work on any system other than
<a href="https://en.wikipedia.org/wiki/VAX-11">VAX-11</a> and
<a href="https://en.wikipedia.org/wiki/PDP-11">PDP-11</a> and this is why we encourage you
@@ -153,10 +152,10 @@ to use the alt version instead. See <a href="#original-code">original code</a> b
the original version.</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>
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#1984_mullender">1984 mullender bugs</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">./mullender.alt</span> <span class="pp">[</span><span class="ss">microseconds</span><span class="pp">]</span></span></code></pre></div>
<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">./mullender.alt</span> <span class="pp">[</span><span class="ss">microseconds</span><span class="pp">]</span></span></code></pre></div>
<p>Hit ctrl-c/intr to exit the program.</p>
<p>The default microseconds is 190000 as this is approximately how long it slept in
the original entry but it can be no lower than 5000 as any lower doesn’t work
@@ -170,13 +169,13 @@ overflow!</p>
<p>BTW: is there such a thing as too fast a CPU ? :-) Actually yes for certain code
which is probably not as uncommon as you think :-).</p>
<h2 id="try">Try:</h2>
<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">./mullender.alt</span></span>
<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">./mullender.alt</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./mullender.alt</span> 5000 <span class="co"># wait for 5000 microseconds and see what happens</span></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./mullender.alt</span> 5000 <span class="co"># wait for 5000 microseconds and see what happens</span></span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a><span class="ex">./mullender.alt</span> 20000 <span class="co"># wait for 20000 microseconds and see what happens</span></span>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a> <span class="ex">./mullender.alt</span> 20000 <span class="co"># wait for 20000 microseconds and see what happens</span></span>
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a><span class="ex">./mullender.alt</span> 100000 <span class="co"># wait for 100000 microseconds and see what happens</span></span></code></pre></div>
<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a> <span class="ex">./mullender.alt</span> 100000 <span class="co"># wait for 100000 microseconds and see what happens</span></span></code></pre></div>
<p>What happens if you hit enter after it reaches the end of the line? Why? What
happens after some time of waiting?</p>
<h2 id="original-code">Original code:</h2>
@@ -185,9 +184,9 @@ happens after some time of waiting?</p>
<a href="https://en.wikipedia.org/wiki/PDP-11">PDP-11</a>. In the following years, 1985 on,
machine dependent code was discouraged.</p>
<h3 id="original-build">Original build:</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="fu">make</span> all</span></code></pre></div>
<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="fu">make</span> all</span></code></pre></div>
<h3 id="original-use">Original use:</h3>
<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">./mullender</span></span></code></pre></div>
<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">./mullender</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Without question, this C program is the one of the most obfuscated C program
that has ever been received! Like all great contest entries, it resulted in a
@@ -226,11 +225,11 @@ in the <em>fabulous</em> <a href="https://github.com/dspinellis/unix-history-rep
Repo</a>.</p>
<h3 id="gentab-build">gentab build:</h3>
<p><code>gentab.c</code> can be built like:</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">make</span> gentab</span></code></pre></div>
<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">make</span> gentab</span></code></pre></div>
<h3 id="gentab-use">gentab use:</h3>
<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">./gentab</span> file</span></code></pre></div>
<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">./gentab</span> file</span></code></pre></div>
<h3 id="gentab-try">gentab try:</h3>
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./gentab</span> gentab <span class="op">&gt;</span> g.c</span></code></pre></div>
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./gentab</span> gentab <span class="op">&gt;</span> g.c</span></code></pre></div>
<p>NOTE: it is highly unlikely that you will be able to run the output of <code>gentab</code>
but it should at least compile.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
@@ -334,18 +333,18 @@ simple.</p>
<a href="https://en.wikipedia.org/wiki/Programmed_Data_Processor">PDP</a> code in assembly.
We both knew <a href="https://en.wikipedia.org/wiki/PDP-11">PDP-11</a> assembly so that was
no problem. The assembly code we came up with is as follows:</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode asm"><code class="sourceCode fasm"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="fu">pdp:</span></span>
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a> <span class="bu">mov</span> pc<span class="op">,</span>r4</span>
<span id="cb11-3"><a href="#cb11-3" aria-hidden="true" tabindex="-1"></a> tst <span class="op">-(</span>r4<span class="op">)</span></span>
<span id="cb11-4"><a href="#cb11-4" aria-hidden="true" tabindex="-1"></a> <span class="bu">sub</span> <span class="op">$</span><span class="bn">9</span><span class="op">,</span> r4</span>
<span id="cb11-5"><a href="#cb11-5" aria-hidden="true" tabindex="-1"></a> <span class="bu">mov</span> r4<span class="op">,</span><span class="fl">0</span><span class="bn">f</span></span>
<span id="cb11-6"><a href="#cb11-6" aria-hidden="true" tabindex="-1"></a> <span class="bu">mov</span> <span class="op">$</span><span class="bn">1</span><span class="op">,</span> r0</span>
<span id="cb11-7"><a href="#cb11-7" aria-hidden="true" tabindex="-1"></a> sys <span class="dv">4</span><span class="co">; 0:0; 9</span></span>
<span id="cb11-8"><a href="#cb11-8" aria-hidden="true" tabindex="-1"></a> <span class="bu">mov</span> <span class="op">$</span><span class="bn">1000</span><span class="op">,</span> r2</span>
<span id="cb11-9"><a href="#cb11-9" aria-hidden="true" tabindex="-1"></a>1:</span>
<span id="cb11-10"><a href="#cb11-10" aria-hidden="true" tabindex="-1"></a> sys <span class="dv">55</span></span>
<span id="cb11-11"><a href="#cb11-11" aria-hidden="true" tabindex="-1"></a> sob r2<span class="op">,</span><span class="bn">1b</span></span>
<span id="cb11-12"><a href="#cb11-12" aria-hidden="true" tabindex="-1"></a> br pdp</span></code></pre></div>
<div class="sourceCode" id="cb11"><pre class="sourceCode asm"><code class="sourceCode fasm"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">pdp:</span></span>
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a> <span class="bu">mov</span> pc<span class="op">,</span>r4</span>
<span id="cb11-3"><a href="#cb11-3" aria-hidden="true" tabindex="-1"></a> tst <span class="op">-(</span>r4<span class="op">)</span></span>
<span id="cb11-4"><a href="#cb11-4" aria-hidden="true" tabindex="-1"></a> <span class="bu">sub</span> <span class="op">$</span><span class="bn">9</span><span class="op">,</span> r4</span>
<span id="cb11-5"><a href="#cb11-5" aria-hidden="true" tabindex="-1"></a> <span class="bu">mov</span> r4<span class="op">,</span><span class="fl">0</span><span class="bn">f</span></span>
<span id="cb11-6"><a href="#cb11-6" aria-hidden="true" tabindex="-1"></a> <span class="bu">mov</span> <span class="op">$</span><span class="bn">1</span><span class="op">,</span> r0</span>
<span id="cb11-7"><a href="#cb11-7" aria-hidden="true" tabindex="-1"></a> sys <span class="dv">4</span><span class="co">; 0:0; 9</span></span>
<span id="cb11-8"><a href="#cb11-8" aria-hidden="true" tabindex="-1"></a> <span class="bu">mov</span> <span class="op">$</span><span class="bn">1000</span><span class="op">,</span> r2</span>
<span id="cb11-9"><a href="#cb11-9" aria-hidden="true" tabindex="-1"></a> 1:</span>
<span id="cb11-10"><a href="#cb11-10" aria-hidden="true" tabindex="-1"></a> sys <span class="dv">55</span></span>
<span id="cb11-11"><a href="#cb11-11" aria-hidden="true" tabindex="-1"></a> sob r2<span class="op">,</span><span class="bn">1b</span></span>
<span id="cb11-12"><a href="#cb11-12" aria-hidden="true" tabindex="-1"></a> br pdp</span></code></pre></div>
<p>This is not the code we originally wrote, but it is the code that we ultimately
used in the program. The string to be printed is shared by the
<a href="https://en.wikipedia.org/wiki/VAX">VAX</a> and the
@@ -374,26 +373,26 @@ VAX <a href="https://en.wikipedia.org/wiki/Assembly_language">assembly</a>, we w
VAX code in C and massaged the
<a href="https://en.wikipedia.org/wiki/Compiler">compiler</a> output. The VAX assembly
program that we came up with is as follows:</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode asm"><code class="sourceCode fasm"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="fu">vax:</span> .<span class="dt">word</span> <span class="dv">0400</span> <span class="op">+</span> <span class="op">(</span>pdp <span class="op">-</span> vax<span class="op">)</span> <span class="op">/</span> <span class="dv">2</span> <span class="op">-</span> <span class="dv">1</span></span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a>1:</span>
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a> pushl <span class="op">$</span><span class="bn">9</span></span>
<span id="cb12-4"><a href="#cb12-4" aria-hidden="true" tabindex="-1"></a> pushal str</span>
<span id="cb12-5"><a href="#cb12-5" aria-hidden="true" tabindex="-1"></a> pushl <span class="op">$</span><span class="bn">1</span></span>
<span id="cb12-6"><a href="#cb12-6" aria-hidden="true" tabindex="-1"></a> calls <span class="op">$</span><span class="bn">3</span><span class="op">,</span> write</span>
<span id="cb12-7"><a href="#cb12-7" aria-hidden="true" tabindex="-1"></a> cvtwl <span class="op">$</span><span class="bn">32767</span><span class="op">,</span> r2</span>
<div class="sourceCode" id="cb12"><pre class="sourceCode asm"><code class="sourceCode fasm"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">vax:</span> .<span class="dt">word</span> <span class="dv">0400</span> <span class="op">+</span> <span class="op">(</span>pdp <span class="op">-</span> vax<span class="op">)</span> <span class="op">/</span> <span class="dv">2</span> <span class="op">-</span> <span class="dv">1</span></span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a> 1:</span>
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a> pushl <span class="op">$</span><span class="bn">9</span></span>
<span id="cb12-4"><a href="#cb12-4" aria-hidden="true" tabindex="-1"></a> pushal str</span>
<span id="cb12-5"><a href="#cb12-5" aria-hidden="true" tabindex="-1"></a> pushl <span class="op">$</span><span class="bn">1</span></span>
<span id="cb12-6"><a href="#cb12-6" aria-hidden="true" tabindex="-1"></a> calls <span class="op">$</span><span class="bn">3</span><span class="op">,</span> write</span>
<span id="cb12-7"><a href="#cb12-7" aria-hidden="true" tabindex="-1"></a> cvtwl <span class="op">$</span><span class="bn">32767</span><span class="op">,</span> r2</span>
<span id="cb12-8"><a href="#cb12-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb12-9"><a href="#cb12-9" aria-hidden="true" tabindex="-1"></a>2:</span>
<span id="cb12-10"><a href="#cb12-10" aria-hidden="true" tabindex="-1"></a> decl r2</span>
<span id="cb12-11"><a href="#cb12-11" aria-hidden="true" tabindex="-1"></a> jneq <span class="dv">2</span><span class="er">b</span></span>
<span id="cb12-12"><a href="#cb12-12" aria-hidden="true" tabindex="-1"></a> jbr <span class="bn">1b</span></span>
<span id="cb12-9"><a href="#cb12-9" aria-hidden="true" tabindex="-1"></a> 2:</span>
<span id="cb12-10"><a href="#cb12-10" aria-hidden="true" tabindex="-1"></a> decl r2</span>
<span id="cb12-11"><a href="#cb12-11" aria-hidden="true" tabindex="-1"></a> jneq <span class="dv">2</span><span class="er">b</span></span>
<span id="cb12-12"><a href="#cb12-12" aria-hidden="true" tabindex="-1"></a> jbr <span class="bn">1b</span></span>
<span id="cb12-13"><a href="#cb12-13" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb12-14"><a href="#cb12-14" aria-hidden="true" tabindex="-1"></a><span class="fu">write:</span> .<span class="dt">word</span> <span class="dv">0</span></span>
<span id="cb12-15"><a href="#cb12-15" aria-hidden="true" tabindex="-1"></a> chmk <span class="op">$</span><span class="bn">4</span></span>
<span id="cb12-16"><a href="#cb12-16" aria-hidden="true" tabindex="-1"></a> <span class="cf">ret</span></span>
<span id="cb12-14"><a href="#cb12-14" aria-hidden="true" tabindex="-1"></a> <span class="fu">write:</span> .<span class="dt">word</span> <span class="dv">0</span></span>
<span id="cb12-15"><a href="#cb12-15" aria-hidden="true" tabindex="-1"></a> chmk <span class="op">$</span><span class="bn">4</span></span>
<span id="cb12-16"><a href="#cb12-16" aria-hidden="true" tabindex="-1"></a> <span class="cf">ret</span></span>
<span id="cb12-17"><a href="#cb12-17" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb12-18"><a href="#cb12-18" aria-hidden="true" tabindex="-1"></a><span class="fu">str:</span> .ascii <span class="st">&quot; :-)\b\b\b\b&quot;</span></span>
<span id="cb12-18"><a href="#cb12-18" aria-hidden="true" tabindex="-1"></a> <span class="fu">str:</span> .ascii <span class="st">&quot; :-)\b\b\b\b&quot;</span></span>
<span id="cb12-19"><a href="#cb12-19" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb12-20"><a href="#cb12-20" aria-hidden="true" tabindex="-1"></a><span class="fu">pdp:</span> .<span class="dt">word</span> <span class="dv">4548</span><span class="op">,</span> <span class="dv">3044</span><span class="op">,</span> <span class="dv">58820</span><span class="op">,</span> <span class="dv">9</span><span class="op">,</span> <span class="dv">4407</span><span class="op">,</span> <span class="dv">6</span><span class="op">,</span> <span class="dv">5568</span><span class="op">,</span> <span class="dv">1</span><span class="op">,</span> <span class="dv">35076</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">9</span><span class="op">,</span> <span class="dv">5570</span><span class="op">,</span> <span class="dv">512</span><span class="op">,</span> <span class="dv">35117</span><span class="op">,</span> <span class="dv">32386</span><span class="op">,</span> <span class="dv">496</span></span></code></pre></div>
<span id="cb12-20"><a href="#cb12-20" aria-hidden="true" tabindex="-1"></a> <span class="fu">pdp:</span> .<span class="dt">word</span> <span class="dv">4548</span><span class="op">,</span> <span class="dv">3044</span><span class="op">,</span> <span class="dv">58820</span><span class="op">,</span> <span class="dv">9</span><span class="op">,</span> <span class="dv">4407</span><span class="op">,</span> <span class="dv">6</span><span class="op">,</span> <span class="dv">5568</span><span class="op">,</span> <span class="dv">1</span><span class="op">,</span> <span class="dv">35076</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">9</span><span class="op">,</span> <span class="dv">5570</span><span class="op">,</span> <span class="dv">512</span><span class="op">,</span> <span class="dv">35117</span><span class="op">,</span> <span class="dv">32386</span><span class="op">,</span> <span class="dv">496</span></span></code></pre></div>
<p>The first word (after the label <code>vax</code>) is the
<a href="https://en.wikipedia.org/wiki/Programmed_Data_Processor">PDP</a> <a href="https://en.wikipedia.org/wiki/Branch_(computer_science)">branch
instruction</a>.
@@ -427,59 +426,59 @@ extracted the machine code from the object file.</p>
<p>NOTE from judges: see <a href="gentab.c">gentab.c</a> for a copy of this file that can be
compiled in modern systems.</p>
</blockquote>
<div class="sourceCode" id="cb13"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a>\#include <span class="op">&lt;</span>stdio<span class="op">.</span>h<span class="op">&gt;</span></span>
<span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a>\#include <span class="op">&lt;</span>a<span class="op">.</span>out<span class="op">.</span>h<span class="op">&gt;</span></span>
<div class="sourceCode" id="cb13"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a> <span class="pp">#include </span><span class="im">&lt;stdio.h&gt;</span></span>
<span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a> <span class="pp">#include </span><span class="im">&lt;a.out.h&gt;</span></span>
<span id="cb13-3"><a href="#cb13-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb13-4"><a href="#cb13-4" aria-hidden="true" tabindex="-1"></a>main<span class="op">(</span>argc<span class="op">,</span> argv<span class="op">)</span> <span class="dt">char</span> <span class="op">**</span>argv<span class="op">;</span></span>
<span id="cb13-5"><a href="#cb13-5" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span>
<span id="cb13-6"><a href="#cb13-6" aria-hidden="true" tabindex="-1"></a> <span class="dt">register</span> <span class="dt">FILE</span> <span class="op">*</span>fp<span class="op">;</span></span>
<span id="cb13-7"><a href="#cb13-7" aria-hidden="true" tabindex="-1"></a> <span class="dt">register</span> <span class="dt">short</span> pos <span class="op">=</span> <span class="dv">0</span><span class="op">,</span> c<span class="op">,</span> n<span class="op">;</span></span>
<span id="cb13-8"><a href="#cb13-8" aria-hidden="true" tabindex="-1"></a> <span class="dt">register</span> <span class="dt">char</span> <span class="op">*</span>fmt<span class="op">;</span></span>
<span id="cb13-9"><a href="#cb13-9" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span>argc <span class="op">!=</span> <span class="dv">2</span><span class="op">)</span> <span class="op">{</span></span>
<span id="cb13-10"><a href="#cb13-10" aria-hidden="true" tabindex="-1"></a> fprintf <span class="op">(</span>stderr<span class="op">,</span> <span class="st">&quot;Usage: </span><span class="sc">%s</span><span class="st"> file</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">,</span> argv<span class="op">[</span><span class="dv">0</span><span class="op">]);</span></span>
<span id="cb13-11"><a href="#cb13-11" aria-hidden="true" tabindex="-1"></a> exit <span class="op">(</span><span class="dv">1</span><span class="op">);</span></span>
<span id="cb13-12"><a href="#cb13-12" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span>
<span id="cb13-4"><a href="#cb13-4" aria-hidden="true" tabindex="-1"></a> main<span class="op">(</span>argc<span class="op">,</span> argv<span class="op">)</span> <span class="dt">char</span> <span class="op">**</span>argv<span class="op">;</span></span>
<span id="cb13-5"><a href="#cb13-5" aria-hidden="true" tabindex="-1"></a> <span class="op">{</span></span>
<span id="cb13-6"><a href="#cb13-6" aria-hidden="true" tabindex="-1"></a> <span class="dt">register</span> <span class="dt">FILE</span> <span class="op">*</span>fp<span class="op">;</span></span>
<span id="cb13-7"><a href="#cb13-7" aria-hidden="true" tabindex="-1"></a> <span class="dt">register</span> <span class="dt">short</span> pos <span class="op">=</span> <span class="dv">0</span><span class="op">,</span> c<span class="op">,</span> n<span class="op">;</span></span>
<span id="cb13-8"><a href="#cb13-8" aria-hidden="true" tabindex="-1"></a> <span class="dt">register</span> <span class="dt">char</span> <span class="op">*</span>fmt<span class="op">;</span></span>
<span id="cb13-9"><a href="#cb13-9" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span>argc <span class="op">!=</span> <span class="dv">2</span><span class="op">)</span> <span class="op">{</span></span>
<span id="cb13-10"><a href="#cb13-10" aria-hidden="true" tabindex="-1"></a> fprintf <span class="op">(</span>stderr<span class="op">,</span> <span class="st">&quot;Usage: </span><span class="sc">%s</span><span class="st"> file</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">,</span> argv<span class="op">[</span><span class="dv">0</span><span class="op">]);</span></span>
<span id="cb13-11"><a href="#cb13-11" aria-hidden="true" tabindex="-1"></a> exit <span class="op">(</span><span class="dv">1</span><span class="op">);</span></span>
<span id="cb13-12"><a href="#cb13-12" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span>
<span id="cb13-13"><a href="#cb13-13" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb13-14"><a href="#cb13-14" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">((</span>fp <span class="op">=</span> fopen<span class="op">(</span>argv<span class="op">[</span><span class="dv">1</span><span class="op">],</span> <span class="st">&quot;r&quot;</span><span class="op">))</span> <span class="op">==</span> NULL<span class="op">)</span> <span class="op">{</span></span>
<span id="cb13-15"><a href="#cb13-15" aria-hidden="true" tabindex="-1"></a> fprintf<span class="op">(</span>stderr<span class="op">,</span> <span class="st">&quot;</span><span class="sc">%s</span><span class="st">: can&#39;t open </span><span class="sc">%s\n</span><span class="st">&quot;</span><span class="op">,</span> argv<span class="op">[</span><span class="dv">0</span><span class="op">],</span> argv<span class="op">[</span><span class="dv">1</span><span class="op">]);</span></span>
<span id="cb13-16"><a href="#cb13-16" aria-hidden="true" tabindex="-1"></a> exit<span class="op">(</span><span class="dv">2</span><span class="op">);</span></span>
<span id="cb13-17"><a href="#cb13-17" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span>
<span id="cb13-14"><a href="#cb13-14" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">((</span>fp <span class="op">=</span> fopen<span class="op">(</span>argv<span class="op">[</span><span class="dv">1</span><span class="op">],</span> <span class="st">&quot;r&quot;</span><span class="op">))</span> <span class="op">==</span> NULL<span class="op">)</span> <span class="op">{</span></span>
<span id="cb13-15"><a href="#cb13-15" aria-hidden="true" tabindex="-1"></a> fprintf<span class="op">(</span>stderr<span class="op">,</span> <span class="st">&quot;</span><span class="sc">%s</span><span class="st">: can&#39;t open </span><span class="sc">%s\n</span><span class="st">&quot;</span><span class="op">,</span> argv<span class="op">[</span><span class="dv">0</span><span class="op">],</span> argv<span class="op">[</span><span class="dv">1</span><span class="op">]);</span></span>
<span id="cb13-16"><a href="#cb13-16" aria-hidden="true" tabindex="-1"></a> exit<span class="op">(</span><span class="dv">2</span><span class="op">);</span></span>
<span id="cb13-17"><a href="#cb13-17" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span>
<span id="cb13-18"><a href="#cb13-18" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb13-19"><a href="#cb13-19" aria-hidden="true" tabindex="-1"></a> fseek <span class="op">(</span>fp<span class="op">,</span> <span class="op">(</span><span class="dt">long</span><span class="op">)</span> <span class="kw">sizeof</span> <span class="op">(</span><span class="kw">struct</span> exec<span class="op">),</span> <span class="dv">0</span><span class="op">);</span></span>
<span id="cb13-20"><a href="#cb13-20" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">&quot;/* portable between VAX and PDP11 */</span><span class="sc">\n\n</span><span class="st">&quot;</span><span class="op">);</span></span>
<span id="cb13-21"><a href="#cb13-21" aria-hidden="true" tabindex="-1"></a> printf <span class="op">(</span><span class="st">&quot;short main[] = {</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">);</span></span>
<span id="cb13-22"><a href="#cb13-22" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span> <span class="op">(;;)</span> <span class="op">{</span></span>
<span id="cb13-23"><a href="#cb13-23" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span>pos <span class="op">==</span> <span class="dv">0</span><span class="op">)</span></span>
<span id="cb13-24"><a href="#cb13-24" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">&quot;</span><span class="sc">\t</span><span class="st">&quot;</span><span class="op">);</span></span>
<span id="cb13-19"><a href="#cb13-19" aria-hidden="true" tabindex="-1"></a> fseek <span class="op">(</span>fp<span class="op">,</span> <span class="op">(</span><span class="dt">long</span><span class="op">)</span> <span class="kw">sizeof</span> <span class="op">(</span><span class="kw">struct</span> exec<span class="op">),</span> <span class="dv">0</span><span class="op">);</span></span>
<span id="cb13-20"><a href="#cb13-20" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">&quot;/* portable between VAX and PDP11 */</span><span class="sc">\n\n</span><span class="st">&quot;</span><span class="op">);</span></span>
<span id="cb13-21"><a href="#cb13-21" aria-hidden="true" tabindex="-1"></a> printf <span class="op">(</span><span class="st">&quot;short main[] = {</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">);</span></span>
<span id="cb13-22"><a href="#cb13-22" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span> <span class="op">(;;)</span> <span class="op">{</span></span>
<span id="cb13-23"><a href="#cb13-23" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span>pos <span class="op">==</span> <span class="dv">0</span><span class="op">)</span></span>
<span id="cb13-24"><a href="#cb13-24" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">&quot;</span><span class="sc">\t</span><span class="st">&quot;</span><span class="op">);</span></span>
<span id="cb13-25"><a href="#cb13-25" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb13-26"><a href="#cb13-26" aria-hidden="true" tabindex="-1"></a> c<span class="op">=</span>getc<span class="op">(</span>fp<span class="op">)</span> <span class="op">&amp;</span> <span class="bn">0377</span><span class="op">;</span></span>
<span id="cb13-27"><a href="#cb13-27" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span>feof<span class="op">(</span>fp<span class="op">))</span> <span class="cf">break</span><span class="op">;</span></span>
<span id="cb13-28"><a href="#cb13-28" aria-hidden="true" tabindex="-1"></a> n <span class="op">=</span> getc<span class="op">(</span>fp<span class="op">)</span> <span class="op">&lt;&lt;</span> <span class="dv">8</span><span class="op">|</span>c<span class="op">;</span></span>
<span id="cb13-26"><a href="#cb13-26" aria-hidden="true" tabindex="-1"></a> c<span class="op">=</span>getc<span class="op">(</span>fp<span class="op">)</span> <span class="op">&amp;</span> <span class="bn">0377</span><span class="op">;</span></span>
<span id="cb13-27"><a href="#cb13-27" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span>feof<span class="op">(</span>fp<span class="op">))</span> <span class="cf">break</span><span class="op">;</span></span>
<span id="cb13-28"><a href="#cb13-28" aria-hidden="true" tabindex="-1"></a> n <span class="op">=</span> getc<span class="op">(</span>fp<span class="op">)</span> <span class="op">&lt;&lt;</span> <span class="dv">8</span><span class="op">|</span>c<span class="op">;</span></span>
<span id="cb13-29"><a href="#cb13-29" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb13-30"><a href="#cb13-30" aria-hidden="true" tabindex="-1"></a> <span class="cf">switch</span> <span class="op">(</span>rand<span class="op">()</span> <span class="op">%</span> <span class="dv">5</span><span class="op">)</span> <span class="op">{</span></span>
<span id="cb13-31"><a href="#cb13-31" aria-hidden="true" tabindex="-1"></a> <span class="cf">case</span> <span class="dv">0</span><span class="op">:</span></span>
<span id="cb13-32"><a href="#cb13-32" aria-hidden="true" tabindex="-1"></a> <span class="cf">case</span> <span class="dv">1</span><span class="op">:</span></span>
<span id="cb13-33"><a href="#cb13-33" aria-hidden="true" tabindex="-1"></a> fmt <span class="op">=</span> <span class="st">&quot;</span><span class="sc">%d</span><span class="st">&quot;</span><span class="op">;</span> <span class="cf">break</span><span class="op">;</span></span>
<span id="cb13-34"><a href="#cb13-34" aria-hidden="true" tabindex="-1"></a> <span class="cf">case</span> <span class="dv">2</span><span class="op">:</span></span>
<span id="cb13-35"><a href="#cb13-35" aria-hidden="true" tabindex="-1"></a> fmt <span class="op">=</span> <span class="st">&quot;</span><span class="sc">%u</span><span class="st">&quot;</span><span class="op">;</span> <span class="cf">break</span><span class="op">;</span></span>
<span id="cb13-36"><a href="#cb13-36" aria-hidden="true" tabindex="-1"></a> <span class="cf">case</span> <span class="dv">3</span><span class="op">:</span></span>
<span id="cb13-37"><a href="#cb13-37" aria-hidden="true" tabindex="-1"></a> fmt <span class="op">=</span> <span class="st">&quot;0</span><span class="sc">%o</span><span class="st">&quot;</span><span class="op">;</span> <span class="cf">break</span><span class="op">;</span></span>
<span id="cb13-38"><a href="#cb13-38" aria-hidden="true" tabindex="-1"></a> <span class="cf">case</span> <span class="dv">4</span><span class="op">:</span></span>
<span id="cb13-39"><a href="#cb13-39" aria-hidden="true" tabindex="-1"></a> fmt <span class="op">=</span> <span class="st">&quot;0x</span><span class="sc">%x</span><span class="st">&quot;</span><span class="op">;</span> <span class="cf">break</span><span class="op">;</span></span>
<span id="cb13-40"><a href="#cb13-40" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span>
<span id="cb13-30"><a href="#cb13-30" aria-hidden="true" tabindex="-1"></a> <span class="cf">switch</span> <span class="op">(</span>rand<span class="op">()</span> <span class="op">%</span> <span class="dv">5</span><span class="op">)</span> <span class="op">{</span></span>
<span id="cb13-31"><a href="#cb13-31" aria-hidden="true" tabindex="-1"></a> <span class="cf">case</span> <span class="dv">0</span><span class="op">:</span></span>
<span id="cb13-32"><a href="#cb13-32" aria-hidden="true" tabindex="-1"></a> <span class="cf">case</span> <span class="dv">1</span><span class="op">:</span></span>
<span id="cb13-33"><a href="#cb13-33" aria-hidden="true" tabindex="-1"></a> fmt <span class="op">=</span> <span class="st">&quot;</span><span class="sc">%d</span><span class="st">&quot;</span><span class="op">;</span> <span class="cf">break</span><span class="op">;</span></span>
<span id="cb13-34"><a href="#cb13-34" aria-hidden="true" tabindex="-1"></a> <span class="cf">case</span> <span class="dv">2</span><span class="op">:</span></span>
<span id="cb13-35"><a href="#cb13-35" aria-hidden="true" tabindex="-1"></a> fmt <span class="op">=</span> <span class="st">&quot;</span><span class="sc">%u</span><span class="st">&quot;</span><span class="op">;</span> <span class="cf">break</span><span class="op">;</span></span>
<span id="cb13-36"><a href="#cb13-36" aria-hidden="true" tabindex="-1"></a> <span class="cf">case</span> <span class="dv">3</span><span class="op">:</span></span>
<span id="cb13-37"><a href="#cb13-37" aria-hidden="true" tabindex="-1"></a> fmt <span class="op">=</span> <span class="st">&quot;0</span><span class="sc">%o</span><span class="st">&quot;</span><span class="op">;</span> <span class="cf">break</span><span class="op">;</span></span>
<span id="cb13-38"><a href="#cb13-38" aria-hidden="true" tabindex="-1"></a> <span class="cf">case</span> <span class="dv">4</span><span class="op">:</span></span>
<span id="cb13-39"><a href="#cb13-39" aria-hidden="true" tabindex="-1"></a> fmt <span class="op">=</span> <span class="st">&quot;0x</span><span class="sc">%x</span><span class="st">&quot;</span><span class="op">;</span> <span class="cf">break</span><span class="op">;</span></span>
<span id="cb13-40"><a href="#cb13-40" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span>
<span id="cb13-41"><a href="#cb13-41" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb13-42"><a href="#cb13-42" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span><span class="dv">32</span> <span class="op">&lt;=</span> n <span class="op">&amp;&amp;</span> n <span class="op">&lt;</span> <span class="dv">127</span> <span class="op">&amp;&amp;</span> <span class="op">(</span>rand<span class="op">()</span> <span class="op">%</span> <span class="dv">4</span><span class="op">))</span> fmt <span class="op">=</span> <span class="st">&quot;&#39;</span><span class="sc">%c</span><span class="st">&#39;&quot;</span><span class="op">;</span></span>
<span id="cb13-43"><a href="#cb13-43" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span>n <span class="op">&lt;</span> <span class="dv">8</span> <span class="op">?</span> <span class="st">&quot;</span><span class="sc">%d</span><span class="st">&quot;</span> <span class="op">:</span> fmt<span class="op">,</span> n<span class="op">);</span></span>
<span id="cb13-44"><a href="#cb13-44" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">&quot;,&quot;</span><span class="op">);</span></span>
<span id="cb13-45"><a href="#cb13-45" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span>pos<span class="op">++</span> <span class="op">==</span> <span class="dv">8</span><span class="op">)</span> <span class="op">{</span></span>
<span id="cb13-46"><a href="#cb13-46" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">&quot;</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">);</span></span>
<span id="cb13-47"><a href="#cb13-47" aria-hidden="true" tabindex="-1"></a> pos <span class="op">=</span> <span class="dv">0</span><span class="op">;</span></span>
<span id="cb13-48"><a href="#cb13-48" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span>
<span id="cb13-49"><a href="#cb13-49" aria-hidden="true" tabindex="-1"></a> <span class="cf">else</span> printf<span class="op">(</span><span class="st">&quot; &quot;</span><span class="op">);</span></span>
<span id="cb13-42"><a href="#cb13-42" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span><span class="dv">32</span> <span class="op">&lt;=</span> n <span class="op">&amp;&amp;</span> n <span class="op">&lt;</span> <span class="dv">127</span> <span class="op">&amp;&amp;</span> <span class="op">(</span>rand<span class="op">()</span> <span class="op">%</span> <span class="dv">4</span><span class="op">))</span> fmt <span class="op">=</span> <span class="st">&quot;&#39;</span><span class="sc">%c</span><span class="st">&#39;&quot;</span><span class="op">;</span></span>
<span id="cb13-43"><a href="#cb13-43" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span>n <span class="op">&lt;</span> <span class="dv">8</span> <span class="op">?</span> <span class="st">&quot;</span><span class="sc">%d</span><span class="st">&quot;</span> <span class="op">:</span> fmt<span class="op">,</span> n<span class="op">);</span></span>
<span id="cb13-44"><a href="#cb13-44" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">&quot;,&quot;</span><span class="op">);</span></span>
<span id="cb13-45"><a href="#cb13-45" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span>pos<span class="op">++</span> <span class="op">==</span> <span class="dv">8</span><span class="op">)</span> <span class="op">{</span></span>
<span id="cb13-46"><a href="#cb13-46" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">&quot;</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">);</span></span>
<span id="cb13-47"><a href="#cb13-47" aria-hidden="true" tabindex="-1"></a> pos <span class="op">=</span> <span class="dv">0</span><span class="op">;</span></span>
<span id="cb13-48"><a href="#cb13-48" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span>
<span id="cb13-49"><a href="#cb13-49" aria-hidden="true" tabindex="-1"></a> <span class="cf">else</span> printf<span class="op">(</span><span class="st">&quot; &quot;</span><span class="op">);</span></span>
<span id="cb13-50"><a href="#cb13-50" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb13-51"><a href="#cb13-51" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">&quot;};</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">);</span></span>
<span id="cb13-52"><a href="#cb13-52" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span>
<span id="cb13-53"><a href="#cb13-53" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
<span id="cb13-51"><a href="#cb13-51" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">&quot;};</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">);</span></span>
<span id="cb13-52"><a href="#cb13-52" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span>
<span id="cb13-53"><a href="#cb13-53" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span></code></pre></div>
<p>As can be seen, there is a slight preference for decimal, and also a character
format is sometimes used, but only if the data is a printable ASCII character.</p>
<p>When we ran this program, we were almost completely satisfied with the result.
+2 -2
View File
@@ -1,14 +1,14 @@
## To build:
```sh
make all
make all
```
## Try:
```sh
./applin
./applin
```
+3 -4
View File
@@ -135,8 +135,7 @@
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#Robert_Heckendorn">Robert Heckendorn</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -145,9 +144,9 @@ 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>
<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>
<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>
<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>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>One liner programs are short but twisted. This “Hello, world!” version
certainly takes its time saying hello.</p>
+5 -5
View File
@@ -1,21 +1,21 @@
## To build:
```sh
make all
make all
```
## To use:
```sh
./august
./august
```
## Try:
```sh
./try.sh
./try.sh
```
If you have the `primes(6)` tool (sometimes part of [BSD
@@ -23,8 +23,8 @@ Games](https://github.com/vattam/BSDGames)) you can see
what of the output in the first `N` (say `15` or `25`) lines are primes:
```sh
./primes.sh # 15
./primes.sh 25
./primes.sh # 15
./primes.sh 25
```
Note that `try.sh` will run this script anyway, telling you where to get
+6 -7
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Lennart_Augustsson">Lennart Augustsson</a><br>
Location: <a href="../../location.html#SE">SE</a> - <em>Kingdom of Sweden</em> (<em>Sweden</em>)
<br><br></li>
Location: <a href="../../location.html#SE">SE</a> - <em>Kingdom of Sweden</em> (<em>Sweden</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,16 +141,16 @@ Location: <a href="../../location.html#SE">SE</a> - <em>Kingdom of Sweden</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> all</span></code></pre></div>
<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>
<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">./august</span></span></code></pre></div>
<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">./august</span></span></code></pre></div>
<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>
<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>If you have the <code>primes(6)</code> tool (sometimes part of <a href="https://github.com/vattam/BSDGames">BSD
Games</a>) you can see
what of the output in the first <code>N</code> (say <code>15</code> or <code>25</code>) lines are primes:</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">./primes.sh</span> <span class="co"># 15</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./primes.sh</span> 25</span></code></pre></div>
<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">./primes.sh</span> <span class="co"># 15</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./primes.sh</span> 25</span></code></pre></div>
<p>Note that <code>try.sh</code> will run this script anyway, telling you where to get
<code>primes(6)</code> if you don’t have it installed, but it will only run with the
default value of 15, rather than trying several different values.</p>
+10 -10
View File
@@ -1,14 +1,14 @@
## To build:
```sh
make alt
make alt
```
## To use:
```sh
./lycklama.alt < some_file
./lycklama.alt < some_file
```
To see why we recommend the alternate version instead of the original version,
@@ -25,13 +25,13 @@ reconfigure it like:
```sh
make SLEEP=700 clobber alt
make SLEEP=700 clobber alt
```
which would set it at 700. Then, whether you use the default value or not, try:
```sh
./try.alt.sh
./try.alt.sh
```
@@ -46,24 +46,24 @@ modern systems.
### Original build:
```sh
make all
make all
```
### Original use:
```sh
./lycklama < some_file
./lycklama < some_file
```
### Original try:
```sh
./lycklama < lycklama.c
./lycklama < lycklama.alt.c
./lycklama < lycklama.orig.c
./lycklama < Makefile
./lycklama < lycklama.c
./lycklama < lycklama.alt.c
./lycklama < lycklama.orig.c
./lycklama < Makefile
```
+11 -12
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Ed_Lycklama">Ed Lycklama</a><br>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<br><br></li>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,9 +141,9 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</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> alt</span></code></pre></div>
<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> alt</span></code></pre></div>
<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">./lycklama.alt</span> <span class="op">&lt;</span> some_file</span></code></pre></div>
<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">./lycklama.alt</span> <span class="op">&lt;</span> some_file</span></code></pre></div>
<p>To see why we recommend the alternate version instead of the original version,
see below and the <a href="#original-code">Original code</a> section.</p>
<h2 id="try">Try:</h2>
@@ -153,23 +152,23 @@ original, slows down the output so that you can see what it looked like back in
This will be more enjoyable. It is slowed down by the <code>usleep(3)</code> library
call with a configurable time to sleep. The default is 500 microseconds but you can
reconfigure it 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="fu">make</span> SLEEP=700 clobber alt</span></code></pre></div>
<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> SLEEP=700 clobber alt</span></code></pre></div>
<p>which would set it at 700. Then, whether you use the default value or not, 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">./try.alt.sh</span></span></code></pre></div>
<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">./try.alt.sh</span></span></code></pre></div>
<h2 id="original-code">Original code:</h2>
<p>As explained above, because modern systems run this entry way too fast to fully
appreciate what it does, we encourage you to first try the alternate version.
After this, however, you might wish to try the original version, fixed for
modern systems.</p>
<h3 id="original-build">Original build:</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="fu">make</span> all</span></code></pre></div>
<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="fu">make</span> all</span></code></pre></div>
<h3 id="original-use">Original use:</h3>
<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">./lycklama</span> <span class="op">&lt;</span> some_file</span></code></pre></div>
<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">./lycklama</span> <span class="op">&lt;</span> some_file</span></code></pre></div>
<h3 id="original-try">Original try:</h3>
<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">./lycklama</span> <span class="op">&lt;</span> lycklama.c</span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./lycklama</span> <span class="op">&lt;</span> lycklama.alt.c</span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./lycklama</span> <span class="op">&lt;</span> lycklama.orig.c</span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a><span class="ex">./lycklama</span> <span class="op">&lt;</span> Makefile</span></code></pre></div>
<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">./lycklama</span> <span class="op">&lt;</span> lycklama.c</span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./lycklama</span> <span class="op">&lt;</span> lycklama.alt.c</span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./lycklama</span> <span class="op">&lt;</span> lycklama.orig.c</span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">./lycklama</span> <span class="op">&lt;</span> Makefile</span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Run the program, redirecting a file into it, and notice how it redisplays it.
The program itself looks like tty noise.</p>
+5 -5
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make all
make all
```
There is alternate code which allows one to change the size of the maze. See
@@ -11,7 +11,7 @@ There is alternate code which allows one to change the size of the maze. See
### To run:
```sh
./shapiro
./shapiro
```
@@ -24,7 +24,7 @@ of the maze. The alt code allows one to easily do this.
### Alternate build:
```sh
make alt
make alt
```
@@ -33,7 +33,7 @@ make alt
If you wish to change the value you can do it like:
```sh
make clobber SIZE=5 alt
make clobber SIZE=5 alt
```
Note that if it is not a number then obviously there will be a compilation
@@ -42,7 +42,7 @@ error. If it's <= 0 || >= 5000 then it is set to 39, the default.
You might also wish to try:
```sh
./try.alt.sh
./try.alt.sh
```
This script will compile the program five times with a random value and then
+6 -7
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Carl_Shapiro">Carl Shapiro</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,23 +141,23 @@ 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>
<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>
<p>There is alternate code which allows one to change the size of the maze. See
<a href="#alternate-code">Alternate code</a> below.</p>
<h3 id="to-run">To run:</h3>
<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">./shapiro</span></span></code></pre></div>
<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">./shapiro</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>The code has a define <code>C</code> set to 39 but this can be modified to change the size
of the maze. The alt code allows one to easily do this.</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>
<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>
<h3 id="alternate-try">Alternate try:</h3>
<p>If you wish to change the value you can do it 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="fu">make</span> clobber SIZE=5 alt</span></code></pre></div>
<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 SIZE=5 alt</span></code></pre></div>
<p>Note that if it is not a number then obviously there will be a compilation
error. If it’s &lt;= 0 || &gt;= 5000 then it is set to 39, the default.</p>
<p>You might also wish to 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">./try.alt.sh</span></span></code></pre></div>
<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">./try.alt.sh</span></span></code></pre></div>
<p>This script will compile the program five times with a random value and then
prompt you in an infinite loop for values to try, exiting only if non-digits are
in the input.</p>
+10 -10
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make all
make all
```
There is another version that will be compiled in case the first fails. This
@@ -12,19 +12,19 @@ more details on it.
## To use:
```sh
./sicherman < file
./sicherman < file
echo foo | ./sicherman
echo foo | ./sicherman
./sicherman
# type or paste some text, making sure to hit enter after each line typed
./sicherman
# type or paste some text, making sure to hit enter after each line typed
```
## Try:
```sh
./try.sh
./try.sh
```
@@ -44,7 +44,7 @@ Although this will be built if the original fails to compile you can do it
manually like:
```sh
make alt
make alt
```
In this case it will be built as `sicherman.alt`.
@@ -53,14 +53,14 @@ In this case it will be built as `sicherman.alt`.
### Alternate use:
```sh
./sicherman.alt < file
./sicherman.alt < file
```
### Alternate try:
```sh
./try.alt.sh
./try.alt.sh
```
@@ -81,7 +81,7 @@ from Richard Stallman: If you think you understand what this code
does, then you don't, so read it again! Explain why:
```sh
./sicherman < sicherman.c | ./sicherman | diff - ./sicherman.c
./sicherman < sicherman.c | ./sicherman | diff - ./sicherman.c
```
results in diff reporting a difference on some machines.
+11 -12
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Col_G_L_Sicherman">Col. G. L. Sicherman</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,19 +141,19 @@ 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>
<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>
<p>There is another version that will be compiled in case the first fails. This
should happen automatically. See <a href="#alternate-code">Alternate code</a> below for
more details on it.</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">./sicherman</span> <span class="op">&lt;</span> file</span>
<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">./sicherman</span> <span class="op">&lt;</span> file</span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="bu">echo</span> foo <span class="kw">|</span> <span class="ex">./sicherman</span></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> foo <span class="kw">|</span> <span class="ex">./sicherman</span></span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="ex">./sicherman</span></span>
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a><span class="co"># type or paste some text, making sure to hit enter after each line typed</span></span></code></pre></div>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a> <span class="ex">./sicherman</span></span>
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a> <span class="co"># type or paste some text, making sure to hit enter after each line typed</span></span></code></pre></div>
<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>
<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>
<h2 id="alternate-code">Alternate code:</h2>
<p>The <a href="sicherman.alt.c">sicherman.alt.c</a> is a slight change in the fixed version
(fixed so it does not require <code>-traditional-cpp</code>) in that it has two args to
@@ -165,12 +164,12 @@ audience.</p>
<h3 id="alternate-build">Alternate build:</h3>
<p>Although this will be built if the original fails to compile you can do it
manually 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="fu">make</span> alt</span></code></pre></div>
<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>
<p>In this case it will be built as <code>sicherman.alt</code>.</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">./sicherman.alt</span> <span class="op">&lt;</span> file</span></code></pre></div>
<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">./sicherman.alt</span> <span class="op">&lt;</span> file</span></code></pre></div>
<h3 id="alternate-try">Alternate try:</h3>
<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">./try.alt.sh</span></span></code></pre></div>
<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">./try.alt.sh</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This program abuses the C preprocessor so much that some <code>cpp</code>s fail to strip
out all of the comments on the first pass! If you were able to understand
@@ -183,7 +182,7 @@ Like the program says, what’s that mean?</p>
on a line. Now enter the letters ‘n’ through ‘z’. But to borrow a quote
from Richard Stallman: If you think you understand what this code
does, then you don’t, so read it again! Explain why:</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">./sicherman</span> <span class="op">&lt;</span> sicherman.c <span class="kw">|</span> <span class="ex">./sicherman</span> <span class="kw">|</span> <span class="fu">diff</span> <span class="at">-</span> ./sicherman.c</span></code></pre></div>
<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">./sicherman</span> <span class="op">&lt;</span> sicherman.c <span class="kw">|</span> <span class="ex">./sicherman</span> <span class="kw">|</span> <span class="fu">diff</span> <span class="at">-</span> ./sicherman.c</span></code></pre></div>
<p>results in diff reporting a difference on some machines.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>No remarks were provided by the author.</p>
+3 -3
View File
@@ -1,21 +1,21 @@
## To build:
```sh
make all
make all
```
## To use:
```sh
./applin
./applin
```
## Try:
```sh
./applin.c
./applin.c
```
+4 -5
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Jack_Applin">Jack Applin</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,11 +141,11 @@ 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>
<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>
<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">./applin</span></span></code></pre></div>
<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>
<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">./applin.c</span></span></code></pre></div>
<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">./applin.c</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>The judges were so amused by this little program that we created an
award just for it. This program is portable to the C and Fortran 77
+3 -3
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make all
make all
```
@@ -10,7 +10,7 @@ make all
The current status of this entry is:
```
STATUS: INABIAF - please **DO NOT** fix
STATUS: INABIAF - please **DO NOT** fix
```
For more detailed information see [1986 august bugs](../../bugs.html#1986_august).
@@ -19,7 +19,7 @@ For more detailed information see [1986 august bugs](../../bugs.html#1986_august
## Try:
```sh
./august
./august
```
+4 -5
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Lennart_Augustsson">Lennart Augustsson</a><br>
Location: <a href="../../location.html#SE">SE</a> - <em>Kingdom of Sweden</em> (<em>Sweden</em>)
<br><br></li>
Location: <a href="../../location.html#SE">SE</a> - <em>Kingdom of Sweden</em> (<em>Sweden</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,13 +141,13 @@ Location: <a href="../../location.html#SE">SE</a> - <em>Kingdom of Sweden</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> all</span></code></pre></div>
<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>
<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>
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#1986_august">1986 august 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">./august</span></span></code></pre></div>
<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">./august</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This program computes a specific mathematical value. Simply compile
and give it an infinite amount of stack space and CPU time. Otherwise
+3 -3
View File
@@ -1,21 +1,21 @@
## To build:
```sh
make all
make all
```
## To use:
```sh
./bright some_file
./bright some_file
```
## Try:
```sh
./try.sh
./try.sh
```
+4 -5
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Walter_Bright">Walter Bright</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,11 +141,11 @@ 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>
<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>
<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">./bright</span> some_file</span></code></pre></div>
<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">./bright</span> some_file</span></code></pre></div>
<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>
<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>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Compile this program and give a filename as an argument.</p>
<p>Mr. Bright exploits the C pre-processor, similar variables and
+4 -4
View File
@@ -1,22 +1,22 @@
## To build:
```sh
make all
make all
```
## To use:
```sh
./hague 2>/dev/null
# enter some text
./hague 2>/dev/null
# enter some text
```
## Try:
```sh
./try.sh
./try.sh
```
Note that you can run the program without feeding it anything and then type in a
+5 -6
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Jim_Hague">Jim Hague</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>
Location: <a href="../../location.html#GB">GB</a> - <em>United Kingdom of Great Britain and Northern Ireland</em> (<em>United Kingdom</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,12 +141,12 @@ Location: <a href="../../location.html#GB">GB</a> - <em>United Kingdom of Great
<!-- 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>
<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>
<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">./hague</span> <span class="dv">2</span><span class="op">&gt;</span>/dev/null</span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="co"># enter some text</span></span></code></pre></div>
<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">./hague</span> <span class="dv">2</span><span class="op">&gt;</span>/dev/null</span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a> <span class="co"># enter some text</span></span></code></pre></div>
<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>
<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>Note that you can run the program without feeding it anything and then type in a
message and line by line it will show the right output. Notice also how certain
characters will print a <code>?</code>.</p>
+2 -2
View File
@@ -1,14 +1,14 @@
## To build:
```sh
make all
make all
```
## Try:
```sh
./holloway
./holloway
```
+3 -4
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Bruce_Holloway">Bruce Holloway</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,9 +141,9 @@ 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>
<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>
<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">./holloway</span></span></code></pre></div>
<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">./holloway</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Believe it or not, this is the old standard “Hello, world” program
performed in a very complex way. The judges and the author defy you
+4 -4
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make all
make all
```
NOTE: we FORCE disable the optimiser due to a funny problem with different
@@ -19,7 +19,7 @@ if nothing else.
## To use:
```sh
./marshall
./marshall
```
@@ -37,14 +37,14 @@ To see if your compiler has the problems noted:
```sh
make alt
make alt
```
### Alternate use:
```sh
./marshall.alt
./marshall.alt
```
Does it work in your system? That is does it not segfault, does it print it only
+4 -4
View File
@@ -162,7 +162,7 @@ because of the call to <code>_exit()</code> (see below).</p>
enable the optimiser clang will generate code that prints the string twice and
dumps core just like before! What about the call to <code>_exit()</code>?</p>
<p>The call was:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>_exit<span class="op">(</span>argv<span class="op">[(</span><span class="dt">int</span><span class="op">)*</span>argc<span class="op">-</span><span class="dv">2</span><span class="op">/</span>cc<span class="op">[</span><span class="dv">1</span><span class="op">*(</span><span class="dt">int</span><span class="op">)*</span>argc<span class="op">]|-</span><span class="dv">1</span><span class="op">&lt;&lt;</span><span class="dv">4</span><span class="op">]);</span></span></code></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> _exit<span class="op">(</span>argv<span class="op">[(</span><span class="dt">int</span><span class="op">)*</span>argc<span class="op">-</span><span class="dv">2</span><span class="op">/</span>cc<span class="op">[</span><span class="dv">1</span><span class="op">*(</span><span class="dt">int</span><span class="op">)*</span>argc<span class="op">]|-</span><span class="dv">1</span><span class="op">&lt;&lt;</span><span class="dv">4</span><span class="op">]);</span></span></code></pre></div>
<p>Changing it to not refer to these variables and just exit 1 and the problems
disappear!</p>
<h3 id="macos">macOS</h3>
@@ -172,9 +172,9 @@ it works fine but if it’s disabled it prints out the string and then enters an
infinite loop!</p>
<p>After we fix the infinite loop if we change the <code>_exit()</code> call in macOS and
disable the optimiser we might get something like:</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> ./marshall</span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">choo</span> choo</span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="ex">Segmentation</span> fault: 11</span></code></pre></div>
<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">$</span> ./marshall</span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">choo</span> choo</span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">Segmentation</span> fault: 11</span></code></pre></div>
<p>Observe how it doesn’t print it twice. But of course it segfaults so it’s not
right either.</p>
<p>If the optimiser is enabled, however, we will see that it works fine before the
+4 -4
View File
@@ -55,7 +55,7 @@ The call was:
```c
_exit(argv[(int)*argc-2/cc[1*(int)*argc]|-1<<4]);
_exit(argv[(int)*argc-2/cc[1*(int)*argc]|-1<<4]);
```
Changing it to not refer to these variables and just exit 1 and the problems
@@ -73,9 +73,9 @@ After we fix the infinite loop if we change the `_exit()` call in macOS and
disable the optimiser we might get something like:
```sh
$ ./marshall
choo choo
Segmentation fault: 11
$ ./marshall
choo choo
Segmentation fault: 11
```
Observe how it doesn't print it twice. But of course it segfaults so it's not
+5 -6
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Eric_Marshall">Eric Marshall</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,7 +141,7 @@ 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>
<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>
<p>NOTE: we FORCE disable the optimiser due to a funny problem with different
compilers and systems. See below and <a href="compilers.html">compilers.html</a> for details.</p>
<p>There is an <a href="#alternate-code">alternate version</a>. The reason is a funny problem:
@@ -153,7 +152,7 @@ might work but the other one would not. We describe this in more detail in
<a href="compilers.html">compilers.html</a> and we encourage you to read it for entertainment
if nothing else.</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">./marshall</span></span></code></pre></div>
<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">./marshall</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>Due to the different <a href="compilers.html">conflicting problems</a> with gcc and clang, we
instead offer the problematic code as an alternate version whereas
@@ -161,9 +160,9 @@ instead offer the problematic code as an alternate version whereas
<code>_exit()</code> commented out, changing the value passed into <code>_exit()</code> to <code>1</code>.</p>
<h3 id="alternate-build">Alternate build:</h3>
<p>To see if your compiler has the problems noted:</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<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>
<h3 id="alternate-use">Alternate use:</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="ex">./marshall.alt</span></span></code></pre></div>
<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">./marshall.alt</span></span></code></pre></div>
<p>Does it work in your system? That is does it not segfault, does it print it only
once and does it not enter an infinite loop? Or more generally does it print the
text exactly once and then exit?</p>
+2 -2
View File
@@ -1,14 +1,14 @@
## To build:
```sh
make all
make all
```
## Try:
```sh
./pawka
./pawka
```
+3 -4
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Michael_H_Pawka">Michael H. Pawka</a><br>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<br><br></li>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,9 +141,9 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</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> all</span></code></pre></div>
<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>
<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">./pawka</span></span></code></pre></div>
<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">./pawka</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>The judges found this entry to be one of hardest to read without the
aid of <code>/lib/cpp</code> and a good editor. When run, the program asks if it
+3 -3
View File
@@ -1,14 +1,14 @@
## To build:
```sh
make all
make all
```
## To use:
```sh
./stein $(printf "\015\015"); echo
./stein $(printf "\015\015"); echo
```
@@ -25,7 +25,7 @@ One some machines, a control-M control-N arg is needed
to get the command to output cleanly:
```sh
./stein $(printf "\014\015"); echo
./stein $(printf "\014\015"); echo
```
Your system may require another set of characters.
+4 -5
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Jan_Stein">Jan Stein</a><br>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<br><br></li>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,9 +141,9 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</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> all</span></code></pre></div>
<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>
<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">./stein</span> <span class="va">$(</span><span class="bu">printf</span> <span class="st">&quot;\015\015&quot;</span><span class="va">)</span><span class="kw">;</span> <span class="bu">echo</span></span></code></pre></div>
<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">./stein</span> <span class="va">$(</span><span class="bu">printf</span> <span class="st">&quot;\015\015&quot;</span><span class="va">)</span><span class="kw">;</span> <span class="bu">echo</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>NOTE: to avoid problems with news and mail, the single line was split
into 3 lines. Join all lines into a single line to recreate
@@ -152,7 +151,7 @@ the original file.</p>
<p>The <code>\015</code> in the above <code>printf(1)</code> command produces a control-N.</p>
<p>One some machines, a control-M control-N arg is needed
to get the command to output cleanly:</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">./stein</span> <span class="va">$(</span><span class="bu">printf</span> <span class="st">&quot;\014\015&quot;</span><span class="va">)</span><span class="kw">;</span> <span class="bu">echo</span></span></code></pre></div>
<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">./stein</span> <span class="va">$(</span><span class="bu">printf</span> <span class="st">&quot;\014\015&quot;</span><span class="va">)</span><span class="kw">;</span> <span class="bu">echo</span></span></code></pre></div>
<p>Your system may require another set of characters.
In time, you will figure out what it does. :-)</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
+2 -2
View File
@@ -1,14 +1,14 @@
## To build:
```sh
make all
make all
```
## To use:
```sh
./wall
./wall
```
+3 -4
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Larry_Wall">Larry Wall</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,9 +141,9 @@ 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>
<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>
<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">./wall</span></span></code></pre></div>
<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">./wall</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>The original version did not have a ‘;’ character in the first line.
This caused a number of System V C pre-preprocessors to gripe about a
+4 -4
View File
@@ -1,23 +1,23 @@
## To build:
```sh
make all
make all
```
## To use:
```sh
some_command | ./biggar | od -c
some_command | ./biggar | od -c
./biggar < file | od -c
./biggar < file | od -c
```
## Try:
```sh
./try.sh
./try.sh
```
+5 -6
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Mark_Biggar">Mark Biggar</a><br>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<br><br></li>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,13 +141,13 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</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> all</span></code></pre></div>
<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>
<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">some_command</span> <span class="kw">|</span> <span class="ex">./biggar</span> <span class="kw">|</span> <span class="fu">od</span> <span class="at">-c</span></span>
<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">some_command</span> <span class="kw">|</span> <span class="ex">./biggar</span> <span class="kw">|</span> <span class="fu">od</span> <span class="at">-c</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./biggar</span> <span class="op">&lt;</span> file <span class="kw">|</span> <span class="fu">od</span> <span class="at">-c</span></span></code></pre></div>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./biggar</span> <span class="op">&lt;</span> file <span class="kw">|</span> <span class="fu">od</span> <span class="at">-c</span></span></code></pre></div>
<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>
<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>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>By changing the compile line you can make this program do anything you
want. This is a very efficient way to transfer source, though it
+4 -4
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make all
make all
```
On System V systems, we had to compile with `-Dindex=strchr`.
@@ -11,7 +11,7 @@ To compile on a 16 bit machine, change 300000 to 30000.
## To use:
```sh
./heckbert col < file
./heckbert col < file
```
where col is the number of columns to fold at and file is the file to fold.
@@ -20,7 +20,7 @@ where col is the number of columns to fold at and file is the file to fold.
## Try:
```sh
./try.sh
./try.sh
```
@@ -29,7 +29,7 @@ where col is the number of columns to fold at and file is the file to fold.
Folding at the wrong length may be equivalent to a "Spindle or Mutilate" operation. For example:
```sh
./heckbert 40 < heckbert.c > ph.c ; make ph ; ./ph 20 < heckbert.c > bar.c ; make bar
./heckbert 40 < heckbert.c > ph.c ; make ph ; ./ph 20 < heckbert.c > bar.c ; make bar
```
Try not to
+5 -6
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Paul_Heckbert">Paul Heckbert</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,17 +141,17 @@ 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>
<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>
<p>On System V systems, we had to compile with <code>-Dindex=strchr</code>.
To compile on a 16 bit machine, change 300000 to 30000.</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">./heckbert</span> col <span class="op">&lt;</span> file</span></code></pre></div>
<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">./heckbert</span> col <span class="op">&lt;</span> file</span></code></pre></div>
<p>where col is the number of columns to fold at and file is the file to fold.</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>
<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>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Folding at the wrong length may be equivalent to a “Spindle or Mutilate” operation. For example:</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">./heckbert</span> 40 <span class="op">&lt;</span> heckbert.c <span class="op">&gt;</span> ph.c <span class="kw">;</span> <span class="fu">make</span> ph <span class="kw">;</span> <span class="ex">./ph</span> 20 <span class="op">&lt;</span> heckbert.c <span class="op">&gt;</span> bar.c <span class="kw">;</span> <span class="fu">make</span> bar</span></code></pre></div>
<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">./heckbert</span> 40 <span class="op">&lt;</span> heckbert.c <span class="op">&gt;</span> ph.c <span class="kw">;</span> <span class="fu">make</span> ph <span class="kw">;</span> <span class="ex">./ph</span> 20 <span class="op">&lt;</span> heckbert.c <span class="op">&gt;</span> bar.c <span class="kw">;</span> <span class="fu">make</span> bar</span></code></pre></div>
<p>Try not to
<a href="https://repository.library.brown.edu/studio/item/bdr:788264/PDF/">Fold, Spindle or Mutilate</a>
files. :-)</p>
+3 -3
View File
@@ -1,21 +1,21 @@
## To build:
```sh
make all
make all
```
## To use:
```sh
./hines file.c
./hines file.c
```
## Try:
```sh
./try.sh
./try.sh
```
+4 -5
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Spencer_Hines">Spencer Hines</a><br>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<br><br></li>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,11 +141,11 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</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> all</span></code></pre></div>
<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>
<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">./hines</span> file.c</span></code></pre></div>
<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">./hines</span> file.c</span></code></pre></div>
<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>
<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>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This program was designed to maximize the bother function for
structured programmers. This program takes <code>goto</code> statements to their
+6 -6
View File
@@ -1,14 +1,14 @@
## To build:
```sh
make all
make all
```
## To use:
```sh
./korn
./korn
```
@@ -30,14 +30,14 @@ Several points are important to understand this program:
characters, or `'h'`, or a string) Consider the fact that:
```c
char *x;
char *x;
```
defines a pointer to a `char` (i.e. an address), and that the `=` assigns
things of compatible types. Since:
```c
x = "have";
x = "have";
```
is legal C, what type of value is `"have"`?
@@ -45,13 +45,13 @@ is legal C, what type of value is `"have"`?
3. Note that the following expressions yield the same value:
```c
x[3] *(x+3) *(3+x)
x[3] *(x+3) *(3+x)
```
since addition is commutative. What can be said about this value?
```c
3[x]
3[x]
```
[David
+7 -8
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#David_Korn">David Korn</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,9 +141,9 @@ 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>
<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>
<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">./korn</span></span></code></pre></div>
<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">./korn</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>The Judges believe that this is the best one line entry ever received.
Compile on a UNIX system, or at least one using a C implementation that
@@ -159,17 +158,17 @@ section right now and see if you are one of the few people who can.</p>
<li><p>What is the value of the symbol <code>"have"</code>? (hint: the value is NOT 4
characters, or <code>'h'</code>, or a string) Consider the fact that:</p></li>
</ol>
<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>x<span class="op">;</span></span></code></pre></div>
<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>x<span class="op">;</span></span></code></pre></div>
<p>defines a pointer to a <code>char</code> (i.e. an address), and that the <code>=</code> assigns
things of compatible types. Since:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>x <span class="op">=</span> <span class="st">&quot;have&quot;</span><span class="op">;</span></span></code></pre></div>
<div class="sourceCode" id="cb4"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> x <span class="op">=</span> <span class="st">&quot;have&quot;</span><span class="op">;</span></span></code></pre></div>
<p>is legal C, what type of value is <code>"have"</code>?</p>
<ol start="3" type="1">
<li>Note that the following expressions yield the same value:</li>
</ol>
<div class="sourceCode" id="cb5"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>x<span class="op">[</span><span class="dv">3</span><span class="op">]</span> <span class="op">*(</span>x<span class="op">+</span><span class="dv">3</span><span class="op">)</span> <span class="op">*(</span><span class="dv">3</span><span class="op">+</span>x<span class="op">)</span></span></code></pre></div>
<div class="sourceCode" id="cb5"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> x<span class="op">[</span><span class="dv">3</span><span class="op">]</span> <span class="op">*(</span>x<span class="op">+</span><span class="dv">3</span><span class="op">)</span> <span class="op">*(</span><span class="dv">3</span><span class="op">+</span>x<span class="op">)</span></span></code></pre></div>
<p>since addition is commutative. What can be said about this value?</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="dv">3</span><span class="op">[</span>x<span class="op">]</span></span></code></pre></div>
<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="dv">3</span><span class="op">[</span>x<span class="op">]</span></span></code></pre></div>
<p><a href="https://news.slashdot.org/story/01/02/06/2030205/david-korn-tells-all">David
Korn</a>’s
<a href="https://en.wikipedia.org/wiki/KornShell">/bin/ksh</a> provides us with a greatly
+5 -5
View File
@@ -1,15 +1,15 @@
## To build:
```sh
make all
make all
```
## To use:
```sh
./lievaart
# enter a level and start playing as described below
./lievaart
# enter a level and start playing as described below
```
@@ -18,8 +18,8 @@ make all
To see what it would have looked like without the size restrictions:
```sh
./lievaart2
# enter a level and start playing as described below
./lievaart2
# enter a level and start playing as described below
```
+6 -7
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Roemer_B_Lievaart">Roemer B. Lievaart</a><br>
Location: <a href="../../location.html#NL">NL</a> - <em>Kingdom of the Netherlands</em> (<em>Netherlands</em>)
<br><br></li>
Location: <a href="../../location.html#NL">NL</a> - <em>Kingdom of the Netherlands</em> (<em>Netherlands</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,14 +141,14 @@ Location: <a href="../../location.html#NL">NL</a> - <em>Kingdom of the Netherlan
<!-- 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>
<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>
<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">./lievaart</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="co"># enter a level and start playing as described below</span></span></code></pre></div>
<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">./lievaart</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a> <span class="co"># enter a level and start playing as described below</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<p>To see what it would have looked like without the size restrictions:</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">./lievaart2</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="co"># enter a level and start playing as described below</span></span></code></pre></div>
<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">./lievaart2</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> <span class="co"># enter a level and start playing as described below</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>We believe that you too will be amazed at just how much power Mr. Lievaart
packed into 1024 bytes!</p>
+12 -12
View File
@@ -1,42 +1,42 @@
## To build:
```sh
make all
```
make all
```
## To use:
```sh
./wall
# enter some numbers
./wall
# enter some numbers
./wall | some_command
# enter some strings or numbers, depending on command
./wall | some_command
# enter some strings or numbers, depending on command
```
## Try:
```sh
./try.sh
./try.sh
```
You may of course run the commands manually and enter text as you wish. For
instance you might try one or both of:
```sh
./wall | bc
./wall | bc
./wall | cat
./wall | cat
```
and enter some input like:
```
x*x
2^x
quit # for the cat version
x*x
2^x
quit # for the cat version
```
which the script does through a pipeline except that here you can enter more
+12 -13
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Larry_Wall">Larry Wall</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,24 +141,24 @@ 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>
<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>
<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">./wall</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="co"># enter some numbers</span></span>
<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">./wall</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a> <span class="co"># enter some numbers</span></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a><span class="ex">./wall</span> <span class="kw">|</span> <span class="ex">some_command</span></span>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="co"># enter some strings or numbers, depending on command</span></span></code></pre></div>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">./wall</span> <span class="kw">|</span> <span class="ex">some_command</span></span>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a> <span class="co"># enter some strings or numbers, depending on command</span></span></code></pre></div>
<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>
<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>You may of course run the commands manually and enter text as you wish. For
instance you might try one or both of:</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">./wall</span> <span class="kw">|</span> <span class="fu">bc</span></span>
<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">./wall</span> <span class="kw">|</span> <span class="fu">bc</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./wall</span> <span class="kw">|</span> <span class="fu">cat</span></span></code></pre></div>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./wall</span> <span class="kw">|</span> <span class="fu">cat</span></span></code></pre></div>
<p>and enter some input like:</p>
<pre><code>x*x
2^x
quit # for the cat version</code></pre>
<pre><code> x*x
2^x
quit # for the cat version</code></pre>
<p>which the script does through a pipeline except that here you can enter more
text if you wish, line by line.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
+2 -2
View File
@@ -1,14 +1,14 @@
## To build:
```sh
make all
make all
```
## To use:
```sh
./westley
./westley
```
+3 -4
View File
@@ -132,8 +132,7 @@
<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>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,9 +141,9 @@ 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>
<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>
<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">./westley</span></span></code></pre></div>
<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>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p><code>putchar()</code> must exist in the C library and not just as a macro.
If it fails to compile, bug your OS/compiler vendor.</p>
+3 -3
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make all
make all
```
A smaller version, originally called `zsmall.c` (and still exists as such, as
@@ -13,7 +13,7 @@ program. See the [Alternate code](#alternate-code) section below for details.
## Try:
```sh
./applin
./applin
```
@@ -26,7 +26,7 @@ with this entry.
### Alternate build:
```sh
make alt
make alt
```
Use `applin.alt` as you would `applin` above.
+4 -5
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Jack_Applin">Jack Applin</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,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>
<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>
<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>
<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>
<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>
<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>
<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>
+6 -6
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make all
make all
```
@@ -10,7 +10,7 @@ make all
The current status of this entry is:
```
STATUS: INABIAF - please **DO NOT** fix
STATUS: INABIAF - please **DO NOT** fix
```
For more detailed information see [1988 dale bugs](../../bugs.html#1988_dale).
@@ -19,15 +19,15 @@ For more detailed information see [1988 dale bugs](../../bugs.html#1988_dale).
## Try:
```sh
./try.sh
./try.sh
```
Observe that three of the commands in the script are:
```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" *)"
./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" *)"
```
As the script asks what do the last two do and why do they do it? Why do they
+7 -8
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Paul_Dale">Paul Dale</a><br>
Location: <a href="../../location.html#AU">AU</a> - <em>Commonwealth of Australia</em> (<em>Australia</em>)
<br><br></li>
Location: <a href="../../location.html#AU">AU</a> - <em>Commonwealth of Australia</em> (<em>Australia</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,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>
<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>
<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>
<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>
<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>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>
<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>
<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>
+6 -6
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make all
make all
```
There is an alternate version, the original, that can't be compiled in modern
@@ -12,7 +12,7 @@ code](#alternate-code) below.
## To use:
```sh
./isaak
./isaak
```
@@ -22,7 +22,7 @@ The original version of this code is in [isaak.alt.c](isaak.alt.c).
The original entry starts with the line:
```c
main(){};
main(){};
```
This works on some systems. Why? Note that `#include <stdio.h>` is given on
@@ -38,7 +38,7 @@ compile.
### Alternate build:
```sh
make alt
make alt
```
Use `isaak.alt` as you would `isaak` above.
@@ -65,8 +65,8 @@ due to the fact that BSD style systems have an `sprintf(3)` that returns a `char
file: isaak.encode. To read this file do.
```sh
uudecode < isaak.encode
cat isaak.output
uudecode < isaak.encode
cat isaak.output
```
Since this was fixed, this file is not strictly necessary. See the
+7 -8
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Mark_Isaak">Mark Isaak</a><br>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<br><br></li>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,16 +141,16 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</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> all</span></code></pre></div>
<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>
<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>
<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>
<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>
<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>
<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
@@ -159,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>
<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>
<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
@@ -174,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>
<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>
<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>
+11 -11
View File
@@ -1,14 +1,14 @@
## To build:
```sh
make
make
```
## To use:
```sh
./litmaath some text
./litmaath some text
```
There is an alternate version provided. See the [Alternate
@@ -18,7 +18,7 @@ code](#alternate-code) section below.
## Try:
```sh
./litmaath eschew obfuscation
./litmaath eschew obfuscation
```
@@ -32,7 +32,7 @@ a file.
### Alternate build:
```sh
make alt
make alt
```
Use `litmaath.alt` as you would `litmaath` above.
@@ -41,7 +41,7 @@ Use `litmaath.alt` as you would `litmaath` above.
### Alternate try:
```sh
./litmaath.alt six was afraid of seven because seven eight nine
./litmaath.alt six was afraid of seven because seven eight nine
```
@@ -51,8 +51,8 @@ Note the unusual structure:
```c
while (<condition>)
;
while (<condition>)
;
```
Did you notice that the body is empty?
@@ -67,10 +67,10 @@ variables like:
```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 : '@',
(long) argv[1], argv[1] && *argv[1] ? *argv[1] : '@', argc);
fprintf(stderr,
"argv=%lo *argv=%lo **argv=%c argv[1]=%lo *argv[1]=%c argc=%d\n",
(long) argv, (long) *argv, *argv && **argv ? **argv : '@',
(long) argv[1], argv[1] && *argv[1] ? *argv[1] : '@', argc);
```
... which is what the [alternate code](#alternate-code) is.
+12 -13
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Maarten_Litmaath">Maarten Litmaath</a><br>
Location: <a href="../../location.html#CH">CH</a> - <em>Swiss Confederation</em> (<em>Switzerland</em>)
<br><br></li>
Location: <a href="../../location.html#CH">CH</a> - <em>Swiss Confederation</em> (<em>Switzerland</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
@@ -169,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>
<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>
<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,7 +1,7 @@
## To build:
```sh
make all
make all
```
+2 -3
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Ian_Phillipps">Ian Phillipps</a><br>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<br><br></li>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,7 +141,7 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</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> all</span></code></pre></div>
<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>
<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,
+5 -5
View File
@@ -1,22 +1,22 @@
## To build:
```sh
make all
make all
```
## Try:
```sh
./reddy
char *(*(fun[16])();
char *(*(*(*(*(*fun[32])))))();
./reddy
char *(*(fun[16])();
char *(*(*(*(*(*fun[32])))))();
```
What happens if you input, and what you do about it?
```c
char *(*(*(*(*(*fun[32])))))());
char *(*(*(*(*(*fun[32])))))());
```
+6 -7
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Gopi_Reddy">Gopi Reddy</a><br>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<br><br></li>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,13 +141,13 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</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> all</span></code></pre></div>
<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>
<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>
<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>
<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>
<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>
<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
+6 -7
View File
@@ -1,22 +1,22 @@
## To build:
```sh
make all
make all
```
## Try:
```sh
./robison 80 10
./robison 40 16
./robison 80 10
./robison 40 16
```
The first and second parameters are optional. You might also try:
```sh
./robison 80 2 # <--- can you find the bug?
./robison 80 -246
./robison 80 2 # <--- can you find the bug?
./robison 80 -246
```
@@ -25,8 +25,7 @@ The first and second parameters are optional. You might also try:
The following might make an interesting benchmark:
```sh
./robison 100
./robison 100
```
[Amdahl 5890-300E with System V cc: 8.40 seconds]
+7 -8
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Arch_D_Robison">Arch D. Robison</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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,7 +1,7 @@
## To build:
```sh
make clobber all
make clobber all
```
and follow the instructions this will give you.
@@ -13,7 +13,7 @@ code](#alternate-code) section below.
## To use:
```sh
./spinellis
./spinellis
```
Type in or copy paste some C code, perhaps from [input.txt](input.txt), and send
@@ -22,7 +22,7 @@ EOF (typically ctrl-d).
Now run again:
```sh
./spinellis
./spinellis
```
@@ -34,7 +34,7 @@ For clang or compilers that won't read from `/dev/tty`, we provide this version.
### Alternate build:
```sh
make clobber alt
make clobber alt
```
and follow the instructions.
@@ -43,7 +43,7 @@ and follow the instructions.
### Alternate use:
```sh
./spinellis.alt
./spinellis.alt
```
Type in or copy paste some C code, perhaps from [input.txt](input.txt), and send
@@ -52,7 +52,7 @@ EOF (typically ctrl-d).
Now run again:
```sh
./spinellis.alt
./spinellis.alt
```
+7 -8
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Diomidis_Spinellis">Diomidis Spinellis</a><br>
Location: <a href="../../location.html#GR">GR</a> - <em>Hellenic Republic</em> (<em>Greece</em>)
<br><br></li>
Location: <a href="../../location.html#GR">GR</a> - <em>Hellenic Republic</em> (<em>Greece</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
+9 -9
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make all
make all
```
NOTE: this version is a fixed version for modern C compilers. See the [Alternate
@@ -12,13 +12,13 @@ might wish to do so.
## Try:
```sh
./westley
./westley
```
Also try:
```sh
./try.sh
./try.sh
```
to show the code with followed by the result so you can truly see the magic.
@@ -32,7 +32,7 @@ This version is the original which might not work as you expect nowadays.
### Alternate build:
```sh
make alt
make alt
```
@@ -42,7 +42,7 @@ To see if your compiler has the problem described in the Judges' remarks below,
try:
```sh
./westley.alt
./westley.alt
```
Does it show the same output as `westley`?
@@ -53,8 +53,8 @@ Does it show the same output as `westley`?
Your compiler must parse
```c
#define _ -a
-_
#define _ -a
-_
```
as `--a` and not `-(-a)` or some other tokenized form. Some strictly
@@ -63,7 +63,7 @@ compilers, you can elide the non-standard token-pasting requirement
by changing the #define line to:
```c
#define _ F-->00||F-OO--;
#define _ F-->00||F-OO--;
```
This is what the modified code in [westley.c](westley.c) does whereas the alt
@@ -72,7 +72,7 @@ code is the original.
You might enjoy looking at the output of:
```sh
cc -E westley.alt.c
cc -E westley.alt.c
```
+10 -11
View File
@@ -132,8 +132,7 @@
<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>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,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>
<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>
<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>
<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>
<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>
<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>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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>No remarks were provided by the author.</p>
<!--
+6 -6
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make all
make all
```
@@ -10,7 +10,7 @@ make all
The current status of this entry is:
```
STATUS: known bug - please help us fix
STATUS: known bug - please help us fix
```
For more detailed information see [1989 fubar bugs](../../bugs.html#1989_fubar).
@@ -19,17 +19,17 @@ For more detailed information see [1989 fubar bugs](../../bugs.html#1989_fubar).
## To use:
```sh
./fubar <number>
./fubar <number>
```
## Try:
```sh
./try.sh # run on 1 - 7
./try.sh # run on 1 - 7
./fubar.sh 2 # run via script
./fubar 2 # run directly
./fubar.sh 2 # run via script
./fubar 2 # run directly
```
+7 -8
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Jay_Vosburgh">Jay Vosburgh</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,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>
<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>
<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>
<pre><code> STATUS: known bug - please help us fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#1989_fubar">1989 fubar bugs</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">./fubar</span> <span class="op">&lt;</span>number<span class="op">&gt;</span></span></code></pre></div>
<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">./fubar</span> <span class="op">&lt;</span>number<span class="op">&gt;</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<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">./try.sh</span> <span class="co"># run on 1 - 7</span></span>
<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">./try.sh</span> <span class="co"># run on 1 - 7</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./fubar.sh</span> 2 <span class="co"># run via script</span></span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a><span class="ex">./fubar</span> 2 <span class="co"># run directly</span></span></code></pre></div>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./fubar.sh</span> 2 <span class="co"># run via script</span></span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">./fubar</span> 2 <span class="co"># run directly</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Run this with a single digit argument (or wait a long time and risk an infinite
loop as described in the <a href="../../bugs.html#1989_fubar">1989 fubar bugs</a> file).</p>
+5 -5
View File
@@ -3,7 +3,7 @@
NOTE: this will run the program itself.
```sh
make clobber all
make clobber all
```
There is an alternate version with a slight difference that you may wish to try.
@@ -13,7 +13,7 @@ See the [Alternate code](#alternate-code) section below for more details.
## To use:
```sh
./jar.1
./jar.1
```
@@ -27,14 +27,14 @@ This alternate code, which prints something slightly different, is provided as w
NOTE: this will run the program itself.
```sh
make clobber alt
make clobber alt
```
### Alternate use:
```sh
./jar.1.alt
./jar.1.alt
```
@@ -44,7 +44,7 @@ On many systems the compiler will not allow you to send the object file to
`/dev/tty`. The author suggested:
```sh
cc -c -o /dev/tty jar.1.c
cc -c -o /dev/tty jar.1.c
```
As a last resort the `jar.1.sh` script provided simulates
+6 -7
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Jari_Arkko">Jari Arkko</a><br>
Location: <a href="../../location.html#SE">SE</a> - <em>Kingdom of Sweden</em> (<em>Sweden</em>)
<br><br></li>
Location: <a href="../../location.html#SE">SE</a> - <em>Kingdom of Sweden</em> (<em>Sweden</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -143,22 +142,22 @@ Location: <a href="../../location.html#SE">SE</a> - <em>Kingdom of Sweden</em> (
<h2 id="to-build">To build:</h2>
<p>NOTE: this will run the program itself.</p>
<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>
<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>
<p>There is an alternate version with a slight difference that you may wish to try.
See the <a href="#alternate-code">Alternate code</a> section below for more details.</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">./jar.1</span></span></code></pre></div>
<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">./jar.1</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>This alternate code, which prints something slightly different, is provided as well.</p>
<h3 id="alternate-build">Alternate build:</h3>
<p>NOTE: this will run the program itself.</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> clobber alt</span></code></pre></div>
<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> clobber alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</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="ex">./jar.1.alt</span></span></code></pre></div>
<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">./jar.1.alt</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>On many systems the compiler will not allow you to send the object file to
<code>/dev/tty</code>. The author suggested:</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="fu">cc</span> <span class="at">-c</span> <span class="at">-o</span> /dev/tty jar.1.c</span></code></pre></div>
<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="fu">cc</span> <span class="at">-c</span> <span class="at">-o</span> /dev/tty jar.1.c</span></code></pre></div>
<p>As a last resort the <code>jar.1.sh</code> script provided simulates
writing the raw binary of the .o file to the terminal.</p>
<p>Abuse of the rules winning entry usually result in a change of the rules.
+25 -25
View File
@@ -1,17 +1,17 @@
## To build:
```sh
make all
make all
```
## To use:
```sh
./jar.2
[enter some lisp]
./jar.2
[enter some lisp]
./jar.2 < some_lisp_file
./jar.2 < some_lisp_file
```
NOTE: this entry will likely segfault on invalid input.
@@ -20,11 +20,11 @@ NOTE: this entry will likely segfault on invalid input.
## Try:
```sh
./try.sh
./try.sh
./try.sh chocolate_cake.lisp
./try.sh chocolate_cake.lisp
./try.sh try.txt
./try.sh try.txt
```
@@ -66,24 +66,24 @@ prints out the return values. End execution by typing an end-of-file
character.
```lisp
(+ 2.5 3.1)
(defun fib (n)
(if (< n 2)
1
(+ (fib (- n 2)) (fib (- n 1)))))
(fib 10)
(defun ! (x) (if (equal x 0) 1 (* x (! (- x 1)))))
(! 7)
(defun fn1 (fn) (+ (fn 1 2) (fn 3 4)))
(defun fn2 (a b) (+ a b))
(fn1 (function +))
(fn1 (function fn2))
(fn1 (function (lambda (z1 z2) (+ z1 z2))))
(quote a)
(cons (quote (a b)) (quote (c d e)))
(cons (quote (f)) ())
(car (quote (a b c)))
(cdr (cdr (quote (g h i))))
(+ 2.5 3.1)
(defun fib (n)
(if (< n 2)
1
(+ (fib (- n 2)) (fib (- n 1)))))
(fib 10)
(defun ! (x) (if (equal x 0) 1 (* x (! (- x 1)))))
(! 7)
(defun fn1 (fn) (+ (fn 1 2) (fn 3 4)))
(defun fn2 (a b) (+ a b))
(fn1 (function +))
(fn1 (function fn2))
(fn1 (function (lambda (z1 z2) (+ z1 z2))))
(quote a)
(cons (quote (a b)) (quote (c d e)))
(cons (quote (f)) ())
(car (quote (a b c)))
(cdr (cdr (quote (g h i))))
```
+26 -27
View File
@@ -138,8 +138,7 @@ Location: <a href="../../location.html#FI">FI</a> - <em>Republic of Finland </em
Location: <a href="../../location.html#SE">SE</a> - <em>Kingdom of Sweden</em> (<em>Sweden</em>)
<br><br></li>
<li>Name: <a href="../../authors.html#Ora_Lassila">Ora Lassila</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -148,19 +147,19 @@ 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>
<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>
<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">./jar.2</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="ex">[enter</span> some lisp]</span>
<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">./jar.2</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">[enter</span> some lisp]</span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a><span class="ex">./jar.2</span> <span class="op">&lt;</span> some_lisp_file</span></code></pre></div>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">./jar.2</span> <span class="op">&lt;</span> some_lisp_file</span></code></pre></div>
<p>NOTE: this entry will likely segfault on invalid input.</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>
<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>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span> chocolate_cake.lisp</span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span> chocolate_cake.lisp</span>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span> try.txt</span></code></pre></div>
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span> try.txt</span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This is the most useful program submitted this year. It is a
rather large subset of lisp. It has no error recovery, and
@@ -193,24 +192,24 @@ The program implements a conventional lisp listener, i.e. you type in
lisp expressions (followed by CR), the program evaluates them and
prints out the return values. End execution by typing an end-of-file
character.</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode lisp"><code class="sourceCode commonlisp"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>(<span class="op">+</span> <span class="fl">2.5</span> <span class="fl">3.1</span>)</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a>(<span class="kw">defun</span><span class="fu"> fib </span>(n)</span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> (<span class="kw">if</span> (<span class="op">&lt;</span> n <span class="dv">2</span>)</span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> <span class="dv">1</span></span>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a> (<span class="op">+</span> (fib (<span class="op">-</span> n <span class="dv">2</span>)) (fib (<span class="op">-</span> n <span class="dv">1</span>)))))</span>
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a>(fib <span class="dv">10</span>)</span>
<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a>(<span class="kw">defun</span><span class="fu"> </span>! (x) (<span class="kw">if</span> (<span class="kw">equal</span> x <span class="dv">0</span>) <span class="dv">1</span> (<span class="op">*</span> x (! (<span class="op">-</span> x <span class="dv">1</span>)))))</span>
<span id="cb4-8"><a href="#cb4-8" aria-hidden="true" tabindex="-1"></a>(! <span class="dv">7</span>)</span>
<span id="cb4-9"><a href="#cb4-9" aria-hidden="true" tabindex="-1"></a>(<span class="kw">defun</span><span class="fu"> fn1 </span>(fn) (<span class="op">+</span> (fn <span class="dv">1</span> <span class="dv">2</span>) (fn <span class="dv">3</span> <span class="dv">4</span>)))</span>
<span id="cb4-10"><a href="#cb4-10" aria-hidden="true" tabindex="-1"></a>(<span class="kw">defun</span><span class="fu"> fn2 </span>(a b) (<span class="op">+</span> a b))</span>
<span id="cb4-11"><a href="#cb4-11" aria-hidden="true" tabindex="-1"></a>(fn1 (<span class="kw">function</span> <span class="op">+</span>))</span>
<span id="cb4-12"><a href="#cb4-12" aria-hidden="true" tabindex="-1"></a>(fn1 (<span class="kw">function</span> fn2))</span>
<span id="cb4-13"><a href="#cb4-13" aria-hidden="true" tabindex="-1"></a>(fn1 (<span class="kw">function</span> (<span class="kw">lambda</span> (z1 z2) (<span class="op">+</span> z1 z2))))</span>
<span id="cb4-14"><a href="#cb4-14" aria-hidden="true" tabindex="-1"></a>(<span class="kw">quote</span> a)</span>
<span id="cb4-15"><a href="#cb4-15" aria-hidden="true" tabindex="-1"></a>(<span class="kw">cons</span> (<span class="kw">quote</span> (a b)) (<span class="kw">quote</span> (c d e)))</span>
<span id="cb4-16"><a href="#cb4-16" aria-hidden="true" tabindex="-1"></a>(<span class="kw">cons</span> (<span class="kw">quote</span> (f)) ())</span>
<span id="cb4-17"><a href="#cb4-17" aria-hidden="true" tabindex="-1"></a>(<span class="kw">car</span> (<span class="kw">quote</span> (a b c)))</span>
<span id="cb4-18"><a href="#cb4-18" aria-hidden="true" tabindex="-1"></a>(<span class="kw">cdr</span> (<span class="kw">cdr</span> (<span class="kw">quote</span> (g h i))))</span></code></pre></div>
<div class="sourceCode" id="cb4"><pre class="sourceCode lisp"><code class="sourceCode commonlisp"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> (<span class="op">+</span> <span class="fl">2.5</span> <span class="fl">3.1</span>)</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> (<span class="kw">defun</span><span class="fu"> fib </span>(n)</span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> (<span class="kw">if</span> (<span class="op">&lt;</span> n <span class="dv">2</span>)</span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> <span class="dv">1</span></span>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a> (<span class="op">+</span> (fib (<span class="op">-</span> n <span class="dv">2</span>)) (fib (<span class="op">-</span> n <span class="dv">1</span>)))))</span>
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a> (fib <span class="dv">10</span>)</span>
<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a> (<span class="kw">defun</span><span class="fu"> </span>! (x) (<span class="kw">if</span> (<span class="kw">equal</span> x <span class="dv">0</span>) <span class="dv">1</span> (<span class="op">*</span> x (! (<span class="op">-</span> x <span class="dv">1</span>)))))</span>
<span id="cb4-8"><a href="#cb4-8" aria-hidden="true" tabindex="-1"></a> (! <span class="dv">7</span>)</span>
<span id="cb4-9"><a href="#cb4-9" aria-hidden="true" tabindex="-1"></a> (<span class="kw">defun</span><span class="fu"> fn1 </span>(fn) (<span class="op">+</span> (fn <span class="dv">1</span> <span class="dv">2</span>) (fn <span class="dv">3</span> <span class="dv">4</span>)))</span>
<span id="cb4-10"><a href="#cb4-10" aria-hidden="true" tabindex="-1"></a> (<span class="kw">defun</span><span class="fu"> fn2 </span>(a b) (<span class="op">+</span> a b))</span>
<span id="cb4-11"><a href="#cb4-11" aria-hidden="true" tabindex="-1"></a> (fn1 (<span class="kw">function</span> <span class="op">+</span>))</span>
<span id="cb4-12"><a href="#cb4-12" aria-hidden="true" tabindex="-1"></a> (fn1 (<span class="kw">function</span> fn2))</span>
<span id="cb4-13"><a href="#cb4-13" aria-hidden="true" tabindex="-1"></a> (fn1 (<span class="kw">function</span> (<span class="kw">lambda</span> (z1 z2) (<span class="op">+</span> z1 z2))))</span>
<span id="cb4-14"><a href="#cb4-14" aria-hidden="true" tabindex="-1"></a> (<span class="kw">quote</span> a)</span>
<span id="cb4-15"><a href="#cb4-15" aria-hidden="true" tabindex="-1"></a> (<span class="kw">cons</span> (<span class="kw">quote</span> (a b)) (<span class="kw">quote</span> (c d e)))</span>
<span id="cb4-16"><a href="#cb4-16" aria-hidden="true" tabindex="-1"></a> (<span class="kw">cons</span> (<span class="kw">quote</span> (f)) ())</span>
<span id="cb4-17"><a href="#cb4-17" aria-hidden="true" tabindex="-1"></a> (<span class="kw">car</span> (<span class="kw">quote</span> (a b c)))</span>
<span id="cb4-18"><a href="#cb4-18" aria-hidden="true" tabindex="-1"></a> (<span class="kw">cdr</span> (<span class="kw">cdr</span> (<span class="kw">quote</span> (g h i))))</span></code></pre></div>
<p>Please do not leave any whitespace before the first parenthesis when
you type your input, or any other unnecessary whitespace. Please try to
avoid any undefined variables or functions, wrong number of arguments
+7 -7
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make all
make all
```
To get this to compile with a modern CPP, we had to replace `#D` with `#define`.
@@ -12,7 +12,7 @@ To get this to compile with a modern CPP, we had to replace `#D` with `#define`.
Run the program this way:
```sh
./ovdluhe < textfile
./ovdluhe < textfile
```
The program stops when it reaches the end of the template buffer
@@ -22,7 +22,7 @@ by chance or is killed.
## Try:
```sh
./try.sh ; sleep 2 ; ./try.sh
./try.sh ; sleep 2 ; ./try.sh
```
@@ -35,7 +35,7 @@ it's a `#define` it's easy to set up.
### Alternate build:
```sh
make P=9 clobber alt
make P=9 clobber alt
```
You do not have to define `P` but if you do you can replace the value with
@@ -47,16 +47,16 @@ program to fail and a negative value will cause a compilation error.
### Alternate use:
```sh
./ovdluhe.alt
./ovdluhe.alt
```
### Alternate try:
```sh
./try.alt.sh
./try.alt.sh
P=5 ./try.alt.sh
P=5 ./try.alt.sh
```
NOTE: if you specify too high a value for `P` the program might fail. If you
+8 -9
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Oskar_von_der_Luehe">Oskar von der Luehe</a><br>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<br><br></li>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,30 +141,30 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</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> all</span></code></pre></div>
<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>
<p>To get this to compile with a modern CPP, we had to replace <code>#D</code> with <code>#define</code>.</p>
<h2 id="to-use">To use:</h2>
<p>Run the program this way:</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./ovdluhe</span> <span class="op">&lt;</span> textfile</span></code></pre></div>
<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">./ovdluhe</span> <span class="op">&lt;</span> textfile</span></code></pre></div>
<p>The program stops when it reaches the end of the template buffer
by chance or is killed.</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 class="kw">;</span> <span class="fu">sleep</span> 2 <span class="kw">;</span> <span class="ex">./try.sh</span></span></code></pre></div>
<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 class="kw">;</span> <span class="fu">sleep</span> 2 <span class="kw">;</span> <span class="ex">./try.sh</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>The author suggested that one varies the definition of <code>P</code> from 2 through 10. As
it’s a <code>#define</code> it’s easy to set up.</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> P=9 clobber alt</span></code></pre></div>
<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> P=9 clobber alt</span></code></pre></div>
<p>You do not have to define <code>P</code> but if you do you can replace the value with
whatever you wish, as long as it’s a positive <code>int</code> (or evaluates to a positive
<code>int</code> like the default <code>(A&lt;&lt;AP)</code> does). Too high a value will likely cause the
program to fail and a negative value will cause a compilation error.</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">./ovdluhe.alt</span></span></code></pre></div>
<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">./ovdluhe.alt</span></span></code></pre></div>
<h3 id="alternate-try">Alternate try:</h3>
<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">./try.alt.sh</span></span>
<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">./try.alt.sh</span></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a><span class="va">P</span><span class="op">=</span>5 <span class="ex">./try.alt.sh</span></span></code></pre></div>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a> <span class="va">P</span><span class="op">=</span>5 <span class="ex">./try.alt.sh</span></span></code></pre></div>
<p>NOTE: if you specify too high a value for <code>P</code> the program might fail. If you
specify a value &lt; 0 it will fail to compile.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
+4 -4
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make all
make all
```
There is an alternate version with a trace routine that the author had commented
@@ -11,7 +11,7 @@ out. See [alternate code](#alternate-code) below for more details.
## Try:
```sh
./paul
./paul
```
@@ -29,14 +29,14 @@ could easily be added.
### Alternate build:
```sh
make alt
make alt
```
### Alternate use:
```sh
./paul.alt
./paul.alt
```
+5 -6
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Paul_E_Black">Paul E. Black</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,11 +141,11 @@ 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>
<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>
<p>There is an alternate version with a trace routine that the author had commented
out. See <a href="#alternate-code">alternate code</a> below for more 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">./paul</span></span></code></pre></div>
<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">./paul</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>This version was described by the author like:</p>
<blockquote>
@@ -157,9 +156,9 @@ and forth as the program runs. A much better debugger or trace
could easily be added.</p>
</blockquote>
<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>
<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>
<h3 id="alternate-use">Alternate use:</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="ex">./paul.alt</span></span></code></pre></div>
<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">./paul.alt</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>The author’s comments is a detailed program explanation and spoiler. If you
want a real challenge, don’t read any further and try to understand the program
+11 -11
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make all
make all
```
@@ -10,7 +10,7 @@ make all
The current status of this entry is:
```
STATUS: INABIAF - please **DO NOT** fix
STATUS: INABIAF - please **DO NOT** fix
```
For more detailed information see [1989 robison bugs](../../bugs.html#1989_robison).
@@ -19,21 +19,21 @@ For more detailed information see [1989 robison bugs](../../bugs.html#1989_robis
## To use:
```sh
./robison
# enter valid expressions
./robison
# enter valid expressions
```
## Try:
```sh
./robison
11x10
# enter other expressions
./robison
11x10
# enter other expressions
./try.sh
./try.sh
echo 100 / 100 | ./robison # <-- what happens here ?
echo 100 / 100 | ./robison # <-- what happens here ?
```
NOTE: This program will very likely crash or break into tiny bits :-) if you
@@ -64,13 +64,13 @@ numerals must be binary. Parentheses may be used for
grouping. For example:
```
101x111-100
101x111-100
```
prints:
```
1111
1111
```
That is `5x(7-4)` is `15`. (APL groups from right to left.)
+12 -13
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Arch_D_Robison">Arch D. Robison</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,22 +141,22 @@ 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>
<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>
<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>
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#1989_robison">1989 robison bugs</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">./robison</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="co"># enter valid expressions</span></span></code></pre></div>
<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></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> <span class="co"># enter valid expressions</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<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></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="ex">11x10</span></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="co"># enter other expressions</span></span>
<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></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">11x10</span></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> <span class="co"># enter other expressions</span></span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span>
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a><span class="bu">echo</span> 100 / 100 <span class="kw">|</span> <span class="ex">./robison</span> <span class="co"># &lt;-- what happens here ?</span></span></code></pre></div>
<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> 100 / 100 <span class="kw">|</span> <span class="ex">./robison</span> <span class="co"># &lt;-- what happens here ?</span></span></code></pre></div>
<p>NOTE: This program will very likely crash or break into tiny bits :-) if you
feed it numbers with non-binary digits. This, as you might notice if you try one
of the above commands, can happen with other input as well. If you wish to
@@ -176,9 +175,9 @@ outputs the evaluation of an
input. Functions are limited to dyadic <code>+</code>,<code>-</code>,<code>x</code>, and unary <code>-</code>;
numerals must be binary. Parentheses may be used for
grouping. For example:</p>
<pre><code>101x111-100</code></pre>
<pre><code> 101x111-100</code></pre>
<p>prints:</p>
<pre><code>1111</code></pre>
<pre><code> 1111</code></pre>
<p>That is <code>5x(7-4)</code> is <code>15</code>. (APL groups from right to left.)
Extending it to the full APL language should be trivial.</p>
<p>The <code>C--</code> language improves the C language by removing superfluous
+2 -2
View File
@@ -1,14 +1,14 @@
## To build:
```sh
make all
make all
```
## Try:
```sh
./roemer
./roemer
```
+3 -4
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Roemer_B_Lievaart">Roemer B. Lievaart</a><br>
Location: <a href="../../location.html#NL">NL</a> - <em>Kingdom of the Netherlands</em> (<em>Netherlands</em>)
<br><br></li>
Location: <a href="../../location.html#NL">NL</a> - <em>Kingdom of the Netherlands</em> (<em>Netherlands</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,9 +141,9 @@ Location: <a href="../../location.html#NL">NL</a> - <em>Kingdom of the Netherlan
<!-- 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>
<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>
<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">./roemer</span></span></code></pre></div>
<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">./roemer</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Do you know what this program does? If you do, look again, there is more here
than meets the PI.</p>
+8 -9
View File
@@ -1,23 +1,23 @@
## To build:
```sh
make all
make all
```
## To use:
```sh
./tromp [drops_per_sec [cmd_string]]
./tromp [drops_per_sec [cmd_string]]
```
## Try:
```sh
./tromp 5
./tromp 5
./tromp 10 "hkl jq"
./tromp 10 "hkl jq"
```
The second command, `./tromp 10 "hkl jq"`, will set up the keys kind of like
@@ -30,15 +30,14 @@ vim:
- space - pause (space)
- q - quit (:q)
NOTE: after the game ends a file called `HI` will be in the directory with the
high scores (up to 20 runs saved) so one can see who has the highest score. The
file might look like:
```
330 by luser
136 by loser
100 by winner
330 by luser
136 by loser
100 by winner
```
... or so, where in this case the [luser is the winner, the loser is in second
@@ -55,7 +54,7 @@ the judges' additional remarks in the author's remarks, for more details.
### Alternate build:
```sh
make alt
make alt
```
+9 -10
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#John_Tromp">John Tromp</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,13 +141,13 @@ 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>
<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>
<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">./tromp</span> [drops_per_sec <span class="pp">[</span><span class="ss">cmd_string</span><span class="pp">]</span>]</span></code></pre></div>
<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">./tromp</span> [drops_per_sec <span class="pp">[</span><span class="ss">cmd_string</span><span class="pp">]</span>]</span></code></pre></div>
<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">./tromp</span> 5</span>
<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">./tromp</span> 5</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./tromp</span> 10 <span class="st">&quot;hkl jq&quot;</span></span></code></pre></div>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./tromp</span> 10 <span class="st">&quot;hkl jq&quot;</span></span></code></pre></div>
<p>The second command, <code>./tromp 10 "hkl jq"</code>, will set up the keys kind of like
vim:</p>
<ul>
@@ -162,9 +161,9 @@ vim:</p>
<p>NOTE: after the game ends a file called <code>HI</code> will be in the directory with the
high scores (up to 20 runs saved) so one can see who has the highest score. The
file might look like:</p>
<pre><code>330 by luser
136 by loser
100 by winner</code></pre>
<pre><code> 330 by luser
136 by loser
100 by winner</code></pre>
<p>… or so, where in this case the <a href="https://web.archive.org/web/20181023221954/https://www.chicagotribune.com/news/ct-xpm-2002-07-31-0207310310-story.html">luser is the winner, the loser is in second
place and the winner is the
loser</a> :-)</p>
@@ -172,7 +171,7 @@ loser</a> :-)</p>
<p>The author provided an alternate version of the code with some improvements. See
the judges’ additional remarks in the author’s remarks, for more details.</p>
<h3 id="alternate-build">Alternate build:</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="fu">make</span> alt</span></code></pre></div>
<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="fu">make</span> alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>tromp.alt</code> as you would <code>tromp</code> above.</p>
<p>NOTE: testing more than one user updating the high score file, one of the
+2 -2
View File
@@ -1,14 +1,14 @@
## To build:
```sh
make all
make all
```
## Try:
```sh
./try.sh
./try.sh
```
+3 -4
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#David_Van_Brackle">David Van Brackle</a><br>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<br><br></li>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,9 +141,9 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</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> all</span></code></pre></div>
<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>
<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">./try.sh</span></span></code></pre></div>
<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">./try.sh</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This program computes all proper subsets of the set of
arguments passed to it. Each subset is printed with one
+14 -14
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make all
make all
```
@@ -10,7 +10,7 @@ make all
The current status of this entry is:
```
STATUS: known bug - please help us fix
STATUS: known bug - please help us fix
```
For more detailed information see [1989 westley bugs](../../bugs.html#1989_westley).
@@ -21,29 +21,29 @@ For more detailed information see [1989 westley bugs](../../bugs.html#1989_westl
Try compiling and running the 4 resulting programs like:
```sh
./compile.sh
./compile.sh
```
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:
```sh
CC=/opt/local/bin/gcc-mp-12 ./compile.sh
CC=/opt/local/bin/gcc-mp-12 ./compile.sh
```
If you wish to delay the script or remove the delay you can do so like:
```sh
DELAY=2 ./compile.sh
DELAY=2 ./compile.sh
```
Finally try:
```sh
./westley
# input some lines of text, sending EOF (usually ctrl-d) to end
./westley
# input some lines of text, sending EOF (usually ctrl-d) to end
./try.sh # demo of some input
./try.sh # demo of some input
```
@@ -71,7 +71,7 @@ When compiling these versions, one needs to define `trgpune`
in the compile line (which the Makefile now has). Example:
```sh
cc -Dtrgpune=putchar ver3.c -o ver3
cc -Dtrgpune=putchar ver3.c -o ver3
```
`trgpune` is the ROT13 of `getchar()`, so `getchar()` and `putchar()`
@@ -110,13 +110,13 @@ called `vs()` turns into a function called `if()` in the original,
so it can't be done. Therefore, I do:
```c
expr1 && expr2 && (expr3=etc);
expr1 && expr2 && (expr3=etc);
```
which is the same as:
```c
if (expr1 && expr2) expr3=etc;
if (expr1 && expr2) expr3=etc;
```
A/UX on the Macintosh doesn't get this right; it evaluates ALL
@@ -125,7 +125,7 @@ statement. This might warrant a warning, since other compilers
may do this. I found MANY compilers botched:
```c
expr1 && (expr2,expr3);
expr1 && (expr2,expr3);
```
`expr2` was OFTEN evaluated even if `expr1` was false. I removed
@@ -147,7 +147,7 @@ such statements to make it more portable.
Normally (!), a reversible C program is done thus:
```c
/**/ forward code /*/ edoc drawkcab /**/
/**/ forward code /*/ edoc drawkcab /**/
```
If your compiler nests comments, it will get this wrong.
@@ -155,7 +155,7 @@ However, I have made some bits of the code palindromic,
(or different, but reversible) so it is more like:
```c
/**/forward/*//**/ palindromic /**//*/drawkcab/**/
/**/forward/*//**/ palindromic /**//*/drawkcab/**/
```
The code can therefore be interlaced. There are eight
+15 -16
View File
@@ -132,8 +132,7 @@
<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>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,24 +141,24 @@ 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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="co"># input some lines of text, sending EOF (usually ctrl-d) to end</span></span>
<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>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a> <span class="co"># input some lines of text, sending EOF (usually ctrl-d) to end</span></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span> <span class="co"># demo of some input</span></span></code></pre></div>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span> <span class="co"># demo of some input</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>There is a secret way to get ONE of the versions to print out
“<code>Hello, world!\n</code>”. Can you find how to do it?</p>
@@ -176,7 +175,7 @@ different algorithm for each version (hereafter referred to as
(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>
<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
@@ -208,14 +207,14 @@ first argument (argc) must be at least one).</p>
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">&amp;&amp;</span> expr2 <span class="op">&amp;&amp;</span> <span class="op">(</span>expr3<span class="op">=</span>etc<span class="op">);</span></span></code></pre></div>
<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">&amp;&amp;</span> expr2 <span class="op">&amp;&amp;</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">&amp;&amp;</span> expr2<span class="op">)</span> expr3<span class="op">=</span>etc<span class="op">;</span></span></code></pre></div>
<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">&amp;&amp;</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>
<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">&amp;&amp;</span> <span class="op">(</span>expr2<span class="op">,</span>expr3<span class="op">);</span></span></code></pre></div>
<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">&amp;&amp;</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>
<h3 id="variable-names-worth-noting">Variable names worth noting</h3>
@@ -225,11 +224,11 @@ such statements to make it more portable.</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>
<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>
<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>
<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
<code>/*//**/ /**//*/</code> pairs.</p>
+6 -6
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make all
make all
```
There is an alternate version for those using Turbo-C or MSC. See [alternate
@@ -13,7 +13,7 @@ code](#alternate-code) below for details.
The current status of this entry is:
```
STATUS: INABIAF - please **DO NOT** fix
STATUS: INABIAF - please **DO NOT** fix
```
For more detailed information see [1990 baruch bugs](../../bugs.html#1990_baruch).
@@ -22,15 +22,15 @@ For more detailed information see [1990 baruch bugs](../../bugs.html#1990_baruch
## To use:
```sh
echo 4 | ./baruch
echo 7 | ./baruch
echo 4 | ./baruch
echo 7 | ./baruch
```
## Try:
```sh
./try.sh
./try.sh
```
@@ -48,7 +48,7 @@ question. YMMV.
### Alternate build:
```sh
make alt
make alt
```
+7 -8
View File
@@ -135,8 +135,7 @@
Location: <a href="../../location.html#IL">IL</a> - <em>State of Israel</em> (<em>Israel</em>)
<br><br></li>
<li>Name: <a href="../../authors.html#Doron_Osovlanski">Doron Osovlanski</a><br>
Location: <a href="../../location.html#IL">IL</a> - <em>State of Israel</em> (<em>Israel</em>)
<br><br></li>
Location: <a href="../../location.html#IL">IL</a> - <em>State of Israel</em> (<em>Israel</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -145,18 +144,18 @@ Location: <a href="../../location.html#IL">IL</a> - <em>State of Israel</em> (<e
<!-- 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>
<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>
<p>There is an alternate version for those using Turbo-C or MSC. See <a href="#alternate-code">alternate
code</a> below for 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>
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#1990_baruch">1990 baruch bugs</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="bu">echo</span> 4 <span class="kw">|</span> <span class="ex">./baruch</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="bu">echo</span> 7 <span class="kw">|</span> <span class="ex">./baruch</span></span></code></pre></div>
<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="bu">echo</span> 4 <span class="kw">|</span> <span class="ex">./baruch</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> 7 <span class="kw">|</span> <span class="ex">./baruch</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<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">./try.sh</span></span></code></pre></div>
<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">./try.sh</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>This alternate code is for the <a href="https://en.wikipedia.org/wiki/0">very few</a>
<a href="https://en.wikipedia.org/wiki/Microsoft_Windows">users</a>
@@ -166,7 +165,7 @@ the <code>" #Q"</code> string was not changed as that showed worse looking outpu
of improved output though admittedly we have no way to test the compilers in
question. YMMV.</p>
<h3 id="alternate-build">Alternate build:</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="fu">make</span> alt</span></code></pre></div>
<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="fu">make</span> alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>baruch.alt</code> as you would <code>baruch</code>.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
+3 -3
View File
@@ -1,21 +1,21 @@
## To build:
```sh
make all
make all
```
## To use:
```sh
./cmills [starting_cash]
./cmills [starting_cash]
```
## Try:
```sh
./cmills 5000
./cmills 5000
```
+4 -5
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Christopher_Mills">Christopher Mills</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,11 +141,11 @@ 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>
<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>
<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">./cmills</span> <span class="pp">[</span><span class="ss">starting_cash</span><span class="pp">]</span></span></code></pre></div>
<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">./cmills</span> <span class="pp">[</span><span class="ss">starting_cash</span><span class="pp">]</span></span></code></pre></div>
<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">./cmills</span> 5000</span></code></pre></div>
<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">./cmills</span> 5000</span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>The Makefile uses several <code>-D</code> defines. The following is is a list of the macros
that may be changed:</p>
+4 -4
View File
@@ -1,14 +1,14 @@
## To build:
```sh
make all
make all
```
## To use:
```sh
./dds
./dds
```
@@ -17,8 +17,8 @@ make all
Give the following lines as input:
```basic
OLD LANDER.BAS
RUN
OLD LANDER.BAS
RUN
```
NOTE: this entry is probably one of the only times CAPS LOCK might be worth
+5 -6
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Diomidis_Spinellis">Diomidis Spinellis</a><br>
Location: <a href="../../location.html#GR">GR</a> - <em>Hellenic Republic</em> (<em>Greece</em>)
<br><br></li>
Location: <a href="../../location.html#GR">GR</a> - <em>Hellenic Republic</em> (<em>Greece</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,13 +141,13 @@ 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> all</span></code></pre></div>
<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>
<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">./dds</span></span></code></pre></div>
<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">./dds</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<p>Give the following lines as input:</p>
<pre class="basic"><code>OLD LANDER.BAS
RUN</code></pre>
<pre class="basic"><code> OLD LANDER.BAS
RUN</code></pre>
<p>NOTE: this entry is probably one of the only times CAPS LOCK might be worth
having (though still not useful enough to enable :-) ) as all input has to be
UPPER CASE.</p>
+6 -6
View File
@@ -1,21 +1,21 @@
## To build:
```sh
make all
make all
```
## To use:
```sh
echo foo bar | ./dg
echo foo bar | ./dg
```
## Try:
```sh
./try.sh
./try.sh
```
@@ -25,13 +25,13 @@ Some C preprocessors got confused about single quotes in certain cases.
In particular, the following source line:
```c
b12(ase(bco(acp(bi(acp(bcp(acp(bpl(aqu(bqu(A))))))))))))))))))))))))))))))
b12(ase(bco(acp(bi(acp(bcp(acp(bpl(aqu(bqu(A))))))))))))))))))))))))))))))
```
sometimes has to be changed to:
```c
b12(ase(bco(acp(bi(acp(bcp(acp(bpl('A'))))))))))))))))))))))))))))
b12(ase(bco(acp(bi(acp(bcp(acp(bpl('A'))))))))))))))))))))))))))))
```
particularly if the C preprocessor botches single quotes in cpp expansions,
@@ -57,7 +57,7 @@ character is in the set `A-Za-z`. `l[]` is an array that gets filled
with:
```c
"nopqrstuvwxyzzzzabcdefghijklmmmmNOPQRSTUVWXYZZZZABCDEFGHIJKLMMMM"
"nopqrstuvwxyzzzzabcdefghijklmmmmNOPQRSTUVWXYZZZZABCDEFGHIJKLMMMM"
```
If `index(3)` says the char is in the alphabet, then XOR the offset
+7 -8
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#David_Goodenough">David Goodenough</a><br>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<br><br></li>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,17 +141,17 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</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> all</span></code></pre></div>
<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>
<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="bu">echo</span> foo bar <span class="kw">|</span> <span class="ex">./dg</span></span></code></pre></div>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> foo bar <span class="kw">|</span> <span class="ex">./dg</span></span></code></pre></div>
<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>
<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>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Some C preprocessors got confused about single quotes in certain cases.
In particular, the following source line:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>b12<span class="op">(</span>ase<span class="op">(</span>bco<span class="op">(</span>acp<span class="op">(</span>bi<span class="op">(</span>acp<span class="op">(</span>bcp<span class="op">(</span>acp<span class="op">(</span>bpl<span class="op">(</span>aqu<span class="op">(</span>bqu<span class="op">(</span>A<span class="op">))))))))))))))))))))))))))))))</span></span></code></pre></div>
<div class="sourceCode" id="cb4"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> b12<span class="op">(</span>ase<span class="op">(</span>bco<span class="op">(</span>acp<span class="op">(</span>bi<span class="op">(</span>acp<span class="op">(</span>bcp<span class="op">(</span>acp<span class="op">(</span>bpl<span class="op">(</span>aqu<span class="op">(</span>bqu<span class="op">(</span>A<span class="op">))))))))))))))))))))))))))))))</span></span></code></pre></div>
<p>sometimes has to be changed to:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>b12<span class="op">(</span>ase<span class="op">(</span>bco<span class="op">(</span>acp<span class="op">(</span>bi<span class="op">(</span>acp<span class="op">(</span>bcp<span class="op">(</span>acp<span class="op">(</span>bpl<span class="op">(</span><span class="ch">&#39;A&#39;</span><span class="op">))))))))))))))))))))))))))))</span></span></code></pre></div>
<div class="sourceCode" id="cb5"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> b12<span class="op">(</span>ase<span class="op">(</span>bco<span class="op">(</span>acp<span class="op">(</span>bi<span class="op">(</span>acp<span class="op">(</span>bcp<span class="op">(</span>acp<span class="op">(</span>bpl<span class="op">(</span><span class="ch">&#39;A&#39;</span><span class="op">))))))))))))))))))))))))))))</span></span></code></pre></div>
<p>particularly if the C preprocessor botches single quotes in cpp expansions,
which we have done for the wider audience.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
@@ -168,7 +167,7 @@ source. The <code>axx()</code> <code>#define</code>s do the same, but add tokens
<p>As for the rot13 algorithm, it relies on <code>index(3)</code> to find if the
character is in the set <code>A-Za-z</code>. <code>l[]</code> is an array that gets filled
with:</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="st">&quot;nopqrstuvwxyzzzzabcdefghijklmmmmNOPQRSTUVWXYZZZZABCDEFGHIJKLMMMM&quot;</span></span></code></pre></div>
<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="st">&quot;nopqrstuvwxyzzzzabcdefghijklmmmmNOPQRSTUVWXYZZZZABCDEFGHIJKLMMMM&quot;</span></span></code></pre></div>
<p>If <code>index(3)</code> says the char is in the alphabet, then XOR the offset
with <code>16</code> to translate, and output, otherwise pass it unchanged.</p>
<!--
+20 -20
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make all
make all
```
@@ -10,7 +10,7 @@ make all
To test the official C entry, one might try:
```sh
echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw
echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw
```
which should apply the identity transformation to a minimal holoalphabetic
@@ -20,7 +20,7 @@ sentence.
#### Also try:
```sh
./try.sh
./try.sh
```
@@ -40,18 +40,18 @@ The sender must have `compress` and `btoa`. To send, try:
```sh
./shark.sh jaw.* README.md > receive
./shark.sh jaw.* README.md > receive
```
The resulting file, `receive`, unpacks the input files
even if the receiver lacks `uncompress` and `btoa`:
```sh
mkdir -p test
cd test
sh ../receive
cmp ../jaw.c jaw.c
cmp ../README.md README.md
mkdir -p test
cd test
sh ../receive
cmp ../jaw.c jaw.c
cmp ../README.md README.md
```
NOTE: a limitation is that the script should be in the parent directory of the
@@ -169,17 +169,17 @@ them. Here's a simple one, which could be extended to enable auto-reassembly
with one shell cmd at the far end.
```sh
#!/bin/sh
m=$1; shift
shark $* | split -800 - /tmp/shark$$
n=`ls /tmp/shark$$* | wc -l | sed 's/ *//'`
p=0
for f in `ls /tmp/shark$$*`
do
p=`expr $p + 1`
mail -s "bundle ($p of $n) from '`whoami`'" $m < $f
done
rm /tmp/shark$$*
#!/bin/sh
m=$1; shift
shark $* | split -800 - /tmp/shark$$
n=`ls /tmp/shark$$* | wc -l | sed 's/ *//'`
p=0
for f in `ls /tmp/shark$$*`
do
p=`expr $p + 1`
mail -s "bundle ($p of $n) from '`whoami`'" $m < $f
done
rm /tmp/shark$$*
```
+21 -22
View File
@@ -138,8 +138,7 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<br><br></li>
<li>Name: <a href="../../authors.html#Paul_Eggert">Paul Eggert</a><br>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<br><br></li>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -148,14 +147,14 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</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> all</span></code></pre></div>
<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>
<h2 id="try">Try:</h2>
<p>To test the official C entry, one might try:</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="bu">echo</span> <span class="st">&quot;Quartz glyph jocks vend, fix, BMW.&quot;</span> <span class="kw">|</span> <span class="ex">compress</span> <span class="kw">|</span> <span class="ex">./btoa</span> <span class="kw">|</span> <span class="ex">./jaw</span></span></code></pre></div>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> <span class="st">&quot;Quartz glyph jocks vend, fix, BMW.&quot;</span> <span class="kw">|</span> <span class="ex">compress</span> <span class="kw">|</span> <span class="ex">./btoa</span> <span class="kw">|</span> <span class="ex">./jaw</span></span></code></pre></div>
<p>which should apply the identity transformation to a minimal holoalphabetic
sentence.</p>
<h4 id="also-try">Also try:</h4>
<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>
<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>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>The program, in its base form, implements two useful utilities:</p>
<ul>
@@ -166,14 +165,14 @@ sentence.</p>
it to 1530 bytes) which implements the complete shark utility. The script,
<a href="shark.sh">shark.sh</a>, contains a <code>jaw.c</code> embedded within it!</p>
<p>The sender must have <code>compress</code> and <code>btoa</code>. To send, 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">./shark.sh</span> jaw.<span class="pp">*</span> README.md <span class="op">&gt;</span> receive</span></code></pre></div>
<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">./shark.sh</span> jaw.<span class="pp">*</span> README.md <span class="op">&gt;</span> receive</span></code></pre></div>
<p>The resulting file, <code>receive</code>, unpacks the input files
even if the receiver lacks <code>uncompress</code> and <code>btoa</code>:</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="fu">mkdir</span> <span class="at">-p</span> test</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="bu">cd</span> test</span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a><span class="fu">sh</span> ../receive</span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a><span class="fu">cmp</span> ../jaw.c jaw.c</span>
<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a><span class="fu">cmp</span> ../README.md README.md</span></code></pre></div>
<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="fu">mkdir</span> <span class="at">-p</span> test</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> <span class="bu">cd</span> test</span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">sh</span> ../receive</span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">cmp</span> ../jaw.c jaw.c</span>
<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">cmp</span> ../README.md README.md</span></code></pre></div>
<p>NOTE: a limitation is that the script should be in the parent directory of the
directory it is run from.</p>
<h2 id="authors-remarks">Authors’ remarks:</h2>
@@ -263,17 +262,17 @@ left, and source-to-source transformations galore.</p></li>
<p>Construct <code>sharkmail</code>, to auto-split <code>sharkives</code> into mailable segments and mail
them. Here’s a simple one, which could be extended to enable auto-reassembly
with one shell cmd at the far end.</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="co">#!/bin/sh</span></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="va">m</span><span class="op">=</span><span class="va">$1</span><span class="kw">;</span> <span class="bu">shift</span></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a><span class="ex">shark</span> <span class="va">$*</span> <span class="kw">|</span> <span class="fu">split</span> <span class="at">-800</span> <span class="at">-</span> /tmp/shark<span class="va">$$</span></span>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a><span class="va">n</span><span class="op">=</span><span class="kw">`</span><span class="fu">ls</span> /tmp/shark<span class="va">$$</span><span class="pp">*</span> <span class="kw">|</span> <span class="fu">wc</span> <span class="at">-l</span> <span class="kw">|</span> <span class="fu">sed</span> <span class="st">&#39;s/ *//&#39;</span><span class="kw">`</span></span>
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a><span class="va">p</span><span class="op">=</span>0</span>
<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> f <span class="kw">in</span> <span class="kw">`</span><span class="fu">ls</span> /tmp/shark<span class="va">$$</span><span class="pp">*</span><span class="kw">`</span></span>
<span id="cb6-7"><a href="#cb6-7" aria-hidden="true" tabindex="-1"></a><span class="cf">do</span></span>
<span id="cb6-8"><a href="#cb6-8" aria-hidden="true" tabindex="-1"></a> <span class="va">p</span><span class="op">=</span><span class="kw">`</span><span class="fu">expr</span> <span class="va">$p</span> + 1<span class="kw">`</span></span>
<span id="cb6-9"><a href="#cb6-9" aria-hidden="true" tabindex="-1"></a> <span class="ex">mail</span> <span class="at">-s</span> <span class="st">&quot;bundle (</span><span class="va">$p</span><span class="st"> of </span><span class="va">$n</span><span class="st">) from &#39;</span><span class="kw">`</span><span class="fu">whoami</span><span class="kw">`</span><span class="st">&#39;&quot;</span> <span class="va">$m</span> <span class="op">&lt;</span> <span class="va">$f</span></span>
<span id="cb6-10"><a href="#cb6-10" aria-hidden="true" tabindex="-1"></a><span class="cf">done</span></span>
<span id="cb6-11"><a href="#cb6-11" aria-hidden="true" tabindex="-1"></a><span class="fu">rm</span> /tmp/shark<span class="va">$$</span><span class="pp">*</span></span></code></pre></div>
<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="co">#!/bin/sh</span></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a> <span class="va">m</span><span class="op">=</span><span class="va">$1</span><span class="kw">;</span> <span class="bu">shift</span></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">shark</span> <span class="va">$*</span> <span class="kw">|</span> <span class="fu">split</span> <span class="at">-800</span> <span class="at">-</span> /tmp/shark<span class="va">$$</span></span>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a> <span class="va">n</span><span class="op">=</span><span class="kw">`</span><span class="fu">ls</span> /tmp/shark<span class="va">$$</span><span class="pp">*</span> <span class="kw">|</span> <span class="fu">wc</span> <span class="at">-l</span> <span class="kw">|</span> <span class="fu">sed</span> <span class="st">&#39;s/ *//&#39;</span><span class="kw">`</span></span>
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a> <span class="va">p</span><span class="op">=</span>0</span>
<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span> f <span class="kw">in</span> <span class="kw">`</span><span class="fu">ls</span> /tmp/shark<span class="va">$$</span><span class="pp">*</span><span class="kw">`</span></span>
<span id="cb6-7"><a href="#cb6-7" aria-hidden="true" tabindex="-1"></a> <span class="cf">do</span></span>
<span id="cb6-8"><a href="#cb6-8" aria-hidden="true" tabindex="-1"></a> <span class="va">p</span><span class="op">=</span><span class="kw">`</span><span class="fu">expr</span> <span class="va">$p</span> + 1<span class="kw">`</span></span>
<span id="cb6-9"><a href="#cb6-9" aria-hidden="true" tabindex="-1"></a> <span class="ex">mail</span> <span class="at">-s</span> <span class="st">&quot;bundle (</span><span class="va">$p</span><span class="st"> of </span><span class="va">$n</span><span class="st">) from &#39;</span><span class="kw">`</span><span class="fu">whoami</span><span class="kw">`</span><span class="st">&#39;&quot;</span> <span class="va">$m</span> <span class="op">&lt;</span> <span class="va">$f</span></span>
<span id="cb6-10"><a href="#cb6-10" aria-hidden="true" tabindex="-1"></a> <span class="cf">done</span></span>
<span id="cb6-11"><a href="#cb6-11" aria-hidden="true" tabindex="-1"></a> <span class="fu">rm</span> /tmp/shark<span class="va">$$</span><span class="pp">*</span></span></code></pre></div>
<h3 id="shark-history">Shark history:</h3>
<ul>
<li><p>May 1987: Karl Fox introduces 1023-byte <code>zcat.c</code> to USENET.
Loaded 100 of 734 files, more files were not shown because too many files have changed in this diff. Show more