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

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

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

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

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

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

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

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

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

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

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

No files matched your search

+5 -5
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make
```
@@ -27,14 +27,14 @@ For more detailed information see [2001 anonymous bugs](../../bugs.html#2001_ano
## To use:
```sh
```<!---sh-->
./anonymous x86_program
```
## Try:
```sh
```<!---sh-->
./try.sh
./anonymous anonymous.bed # if able to compile as a 32-bit (-m32) ELF binary
@@ -64,14 +64,14 @@ that :-(
### Alternate build:
```sh
```<!---sh-->
make alt
```
### Alternate use:
```sh
```<!---sh-->
./anonymous.ten.alt
./anonymous.bed.alt
+9 -9
View File
@@ -141,7 +141,7 @@ 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></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<p>The programs that this program is supposed to act on,
<a href="anonymous.ten.c">anonymous.ten.c</a> and <a href="anonymous.bed.c">anonymous.bed.c</a>,
compiled with <code>make</code>, MUST be compiled as 32-bit ELF binaries. In the case that
@@ -155,11 +155,11 @@ whatever your system will compile them as).</p>
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2001_anonymous">2001 anonymous 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">./anonymous</span> x86_program</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./anonymous x86_program</code></pre>
<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>
<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">./anonymous</span> anonymous.bed <span class="co"># if able to compile as a 32-bit (-m32) ELF binary</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh
./anonymous anonymous.bed # if able to compile as a 32-bit (-m32) ELF binary</code></pre>
<p>NOTE: if the 32-bit version cannot be compiled the script will at least compile
<a href="anonymous.ten.c">anonymous.ten</a> as a 64-bit program (or whatever your system is
set to) and run it directly.</p>
@@ -176,11 +176,11 @@ program or do something terribly wrong like slaughtering all the
<a href="https://www.glyphweb.com/arda/i/imladris.php">Imladris</a>! :-) so please don’t do
that :-(</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>
<pre class="&lt;!---sh--&gt;"><code> make alt</code></pre>
<h3 id="alternate-use">Alternate 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">./anonymous.ten.alt</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="ex">./anonymous.bed.alt</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./anonymous.ten.alt
./anonymous.bed.alt</code></pre>
<h3 id="a-2023-note-about-the-warning-from-the-author">A 2023 note about the warning from the author:</h3>
<p>The author suggested that this <em>might</em> somewhat destroy the binaries this
touches but after the fix of 2023 this was not observed (yet?). It does indeed
+7 -7
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make
```
@@ -19,14 +19,14 @@ For more detailed information see [2001 bellard bugs](../../bugs.html#2001_bella
## To use:
```sh
```<!---sh-->
./bellard file
```
## Try:
```sh
```<!---sh-->
./bellard bellard.otccex.c
```
@@ -47,7 +47,7 @@ program.
You can use it by typing:
```sh
```<!---sh-->
./bellard bellard.c [args]...
```
@@ -61,19 +61,19 @@ or by giving the C source to its standard input.
- Sample compilation and execution:
```sh
```<!---sh-->
./bellard bellard.otccex.c 10
```
- Self compilation:
```sh
```<!---sh-->
./bellard bellard.c bellard.otccex.c 10
```
- Self compilation iterated...
```sh
```<!---sh-->
./bellard bellard.c bellard.c bellard.otccex.c 10
```
+7 -7
View File
@@ -141,16 +141,16 @@ Location: <a href="../../location.html#FR">FR</a> - <em>French Republic</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></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code> STATUS: INABIAF - please **DO NOT** fix
STATUS: doesn&#39;t work with some platforms - please help us fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2001_bellard">2001 bellard 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">./bellard</span> file</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./bellard file</code></pre>
<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">./bellard</span> bellard.otccex.c</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./bellard bellard.otccex.c</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p><code>&lt;JUDGES_COMMENTS&gt;</code> :-)</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
@@ -161,7 +161,7 @@ compilable by a standard ANSI C compiler. <code>OTCC</code> compiles,
assembles, links and runs C code without the need of any other
program.</p>
<p>You can use it by typing:</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">./bellard</span> bellard.c <span class="pp">[</span><span class="ss">args</span><span class="pp">]</span>...</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./bellard bellard.c [args]...</code></pre>
<p>or by giving the C source to its standard input.</p>
<p><code>args</code> are given to the <code>main()</code> function of <code>bellard.c</code> (<code>argv[0]</code> is
<a href="bellard.c">bellard.c</a>).</p>
@@ -169,15 +169,15 @@ program.</p>
<ul>
<li>Sample compilation and execution:</li>
</ul>
<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">./bellard</span> bellard.otccex.c 10</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./bellard bellard.otccex.c 10</code></pre>
<ul>
<li>Self compilation:</li>
</ul>
<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">./bellard</span> bellard.c bellard.otccex.c 10</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./bellard bellard.c bellard.otccex.c 10</code></pre>
<ul>
<li>Self compilation iterated…</li>
</ul>
<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">./bellard</span> bellard.c bellard.c bellard.otccex.c 10</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./bellard bellard.c bellard.c bellard.otccex.c 10</code></pre>
<p>An alternate syntax is to use it as a script interpreter: you can
put <code>#!/usr/local/bin/otcc</code> at the beginning of your C source if
you installed <code>otcc</code> at this place.</p>
+5 -5
View File
@@ -1,20 +1,20 @@
## To build:
```sh
```<!---sh-->
make
```
## To use:
```sh
```<!---sh-->
./cheong digits
```
## Try:
```sh
```<!---sh-->
./try.sh
```
@@ -36,7 +36,7 @@ Compile normally and run with one argument, an integer with 2n digits.
Program will return the integer part of its square root (n-digits).
For example,
```sh
```<!---sh-->
$ cc -o cheong cheong.c
$ ./cheong 1234567890
35136
@@ -52,7 +52,7 @@ This program runs normally on any ANSI C compiler and is ASCII dependent.
Strict compiling gives just one unavoidable warning:
```sh
```<!---sh-->
gcc -ansi -Wall cheong.c
cheong.c:3: warning: third argument of `main' should probably be `char **'
```
+10 -10
View File
@@ -141,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></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./cheong</span> digits</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./cheong digits</code></pre>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Be sure to give an even number of digits in the argument. Add a
leading 0 if needed.</p>
@@ -156,17 +156,17 @@ as all good programs should be! :-)</p>
<p>Compile normally and run with one argument, an integer with 2n digits.
Program will return the integer part of its square root (n-digits).
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">$</span> cc <span class="at">-o</span> cheong cheong.c</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">$</span> ./cheong 1234567890</span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">35136</span></span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">$</span> ./cheong 0200000000000000000000000000</span>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a> <span class="ex">14142135623730</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> $ cc -o cheong cheong.c
$ ./cheong 1234567890
35136
$ ./cheong 0200000000000000000000000000
14142135623730</code></pre>
<p>Deviation from these instructions will cause undefined results. :-)</p>
<h3 id="portability">Portability</h3>
<p>This program runs normally on any ANSI C compiler and is ASCII dependent.</p>
<p>Strict compiling gives just one unavoidable warning:</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">gcc</span> <span class="at">-ansi</span> <span class="at">-Wall</span> cheong.c</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">cheong.c:3:</span> warning: third argument of <span class="kw">`</span><span class="ex">main</span><span class="st">&#39; should probably be `char **&#39;</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> gcc -ansi -Wall cheong.c
cheong.c:3: warning: third argument of `main&#39; should probably be `char **&#39;</code></pre>
<h3 id="obfuscation">Obfuscation</h3>
<p>The main obfuscation is the algorithm used to calculate square roots,
sometimes known as the longhand method. The basic algorithm is itself
+5 -5
View File
@@ -1,20 +1,20 @@
## To build:
```sh
```<!---sh-->
make
```
## To use:
```sh
```<!---sh-->
./coupard
```
## Try:
```sh
```<!---sh-->
./try.sh
```
@@ -52,7 +52,7 @@ that can do sound, as a lowest-denominator sound I/O interface.
To listen to what the program says directly, invoke
```sh
```<!---sh-->
./coupard > /dev/audio
```
@@ -68,7 +68,7 @@ If you want to convert the audio output of the program into another audio
format, you can pipe it to [SoX](https://en.wikipedia.org/wiki/SoX) for example
(`sox` is the Swiss army knife of Unix audio tools). The command:
```sh
```<!---sh-->
./coupard | sox -c1 -r8000 -tub - -c2 -r44100 -twav test.wav
```
+5 -5
View File
@@ -141,11 +141,11 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></l
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./coupard</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./coupard</code></pre>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>You may need to run this a few times to understand exactly what is
being said. You might even need to look somewhere on your desktop,
@@ -170,7 +170,7 @@ fixed-format audio interface that is supported by the majority of Unices
that can do sound, as a lowest-denominator sound I/O interface.</p>
<h3 id="program-usage">Program usage</h3>
<p>To listen to what the program says directly, invoke</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">./coupard</span> <span class="op">&gt;</span> /dev/audio</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./coupard &gt; /dev/audio</code></pre>
<p>The program then speaks out something like</p>
<blockquote>
<p>The time is HH hours MM minutes SS seconds</p>
@@ -181,7 +181,7 @@ the speakers connected … :-)</p>
<p>If you want to convert the audio output of the program into another audio
format, you can pipe it to <a href="https://en.wikipedia.org/wiki/SoX">SoX</a> for example
(<code>sox</code> is the Swiss army knife of Unix audio tools). The command:</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">./coupard</span> <span class="kw">|</span> <span class="fu">sox</span> <span class="at">-c1</span> <span class="at">-r8000</span> <span class="at">-tub</span> <span class="at">-</span> <span class="at">-c2</span> <span class="at">-r44100</span> <span class="at">-twav</span> test.wav</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./coupard | sox -c1 -r8000 -tub - -c2 -r44100 -twav test.wav</code></pre>
<p>converts the output of the program into a 44.1KHz stereo .WAV
file and saves it into <code>test.wav</code>.</p>
<p>The output format of the program is 8KHz, unsigned 8-bit samples.</p>
+4 -4
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make
```
@@ -10,7 +10,7 @@ code](#alternate code) below.
## To use:
```sh
```<!---sh-->
./ctk
```
@@ -23,14 +23,14 @@ This alternate version adds to the movement keys `l` for right, `h` for left and
### Alternate build:
```sh
```<!---sh-->
make alt
```
### Alternate use:
```sh
```<!---sh-->
./ctk.alt
```
+4 -4
View File
@@ -141,18 +141,18 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></l
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<p>There is an alternate version with vi(m) key movements. See <a href="#alternate%20code">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">./ctk</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./ctk</code></pre>
<h2 id="alternate-code">Alternate code:</h2>
<p>This alternate version adds to the movement keys <code>l</code> for right, <code>h</code> for left and
<code>k</code> for straight.</p>
<h3 id="alternate-build">Alternate build:</h3>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> alt</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make alt</code></pre>
<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">./ctk.alt</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./ctk.alt</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>No matter how careful you are, this guy eventually crashes. Most people
can make at least one successful road trip without crashing.</p>
+4 -4
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make
```
@@ -21,7 +21,7 @@ For more detailed information see [2001 dgbeards bugs](../../bugs.html#2001_dgbe
## To use:
```sh
```<!---sh-->
./dgbeards
```
@@ -36,14 +36,14 @@ this you can look at the author's remarks and make the change.
### Alternate build:
```sh
```<!---sh-->
make alt
```
### Alternate use:
```sh
```<!---sh-->
./dgbeards.alt
```
+4 -4
View File
@@ -141,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></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<p>There is an alternate version based on the author’s remarks. See <a href="#alternate-code">alternate
code</a> below for more details.</p>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
@@ -149,16 +149,16 @@ code</a> below for more details.</p>
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2001_dgbeards">2001 dgbeards 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">./dgbeards</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./dgbeards</code></pre>
<h2 id="alternate-code">Alternate code:</h2>
<p>The author provided a way to speed it up a bit and also how to make it so it
doesn’t crash on losing. The idea that it crashes on losing was too good to
lose but this alternate version has the former change. If you wish to remove
this you can look at the author’s remarks and make the change.</p>
<h3 id="alternate-build">Alternate build:</h3>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> alt</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make alt</code></pre>
<h3 id="alternate-use">Alternate use:</h3>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./dgbeards.alt</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./dgbeards.alt</code></pre>
<h2 id="try">Try:</h2>
<p>See if you can figure out how to make the computer always lose (‘win’ :-) ).
It’s a very simple thing to do. Read the author’s remarks for clues.</p>
+10 -10
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make
```
@@ -19,7 +19,7 @@ For more detailed information see [2001 herrmann1 bugs](../../bugs.html#2001_her
## To use:
```sh
```<!---sh-->
./herrmann1.sh 'prg=file'
```
@@ -30,7 +30,7 @@ need an older compiler perhaps gcc 2.95.
## Try:
```sh
```<!---sh-->
./try.sh
```
@@ -86,7 +86,7 @@ terminal!
The info files `herrmann1.turing` and [herrmann1.gcd](herrmann1.gcd) are sample
programs for the Turing machine. For example, type
```sh
```<!---sh-->
./herrmann1.sh 'prg=herrmann1.times2'
```
@@ -126,7 +126,7 @@ In the previous example, the Turing machine started on the default
tape of the program `times2.turing`. To provide your own tape, type
(for example)
```sh
```<!---sh-->
./herrmann1 prg=times2.turing tape="O O O I I I O O O"
```
@@ -155,7 +155,7 @@ number in unary representation. (That is, a row of I's is
expected, and one more I is appended to the row.) Let's call it
`plus1.turing`. Here's what it could look like:
```c
```<!---c-->
/* Search beginning of number. */
#define start_O O, right, start
/* Number found. Move one step to the left. */
@@ -177,7 +177,7 @@ line defining `st2_I` has been left out.)
Now, the program can be used with
```sh
```<!---sh-->
./herrmann1.sh 'prg=plus1.turing' 'tape="I I I"'
```
@@ -187,7 +187,7 @@ machine would start on an empty tape (that is, a tape filled with
the case for `plus1.turing`). So you might want to provide a
default tape by adding a line like
```c
```<!---c-->
#define tape O O O O O I I I I
```
@@ -200,13 +200,13 @@ When writing long programs, the most common errors are to forget
to define a state or to misspell one. Let's assume you forgot the
line
```c
```<!---c-->
#define start_I I, left, st2
```
Remove it and type
```sh
```<!---sh-->
./herrmann1 'prg=plus1.turing'
```
+15 -15
View File
@@ -141,19 +141,19 @@ Location: <a href="../../location.html#DE">DE</a> - <em>Federal Republic of Germ
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code> STATUS: missing files - please provide them
STATUS: known bug - please help us fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2001_herrmann1">2001 herrmann1 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">./herrmann1.sh</span> <span class="st">&#39;prg=file&#39;</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./herrmann1.sh &#39;prg=file&#39;</code></pre>
<p>NOTE: this entry seems to rely on older versions of gcc for the compilation
stage and as such if you wish to see that part like it was designed you will
need an older compiler perhaps gcc 2.95.</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">./try.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>There are some clear hints in the source code as to the
purpose of this program. Perhaps the only way to figure out what is
@@ -192,7 +192,7 @@ terminal!</p></li>
<h4 id="for-the-impatient">For the impatient</h4>
<p>The info files <code>herrmann1.turing</code> and <a href="herrmann1.gcd">herrmann1.gcd</a> are sample
programs for the Turing machine. For example, type</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">./herrmann1.sh</span> <span class="st">&#39;prg=herrmann1.times2&#39;</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./herrmann1.sh &#39;prg=herrmann1.times2&#39;</code></pre>
<p>and watch the animated Turing machine multiply 8 by two (in
unary representation). Here’s a screen shot during compilation:</p>
<pre><code> /*
@@ -217,7 +217,7 @@ result.)</p>
<p>In the previous example, the Turing machine started on the default
tape of the program <code>times2.turing</code>. To provide your own tape, type
(for example)</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./herrmann1</span> prg=times2.turing tape=<span class="st">&quot;O O O I I I O O O&quot;</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./herrmann1 prg=times2.turing tape=&quot;O O O I I I O O O&quot;</code></pre>
<p>(The <code>O</code>s and <code>I</code>s are letters, not digits.) You might prefer to
provide only a finite portion of the tape, like I did above. In
this case, the remainder of the tape is filled with <code>O</code>s. ;-)</p>
@@ -234,12 +234,12 @@ better. Simply try some out.</p>
number in unary representation. (That is, a row of I’s is
expected, and one more I is appended to the row.) Let’s call it
<code>plus1.turing</code>. Here’s what it could look like:</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> <span class="co">/* Search beginning of number. */</span></span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define start_O O</span><span class="op">,</span><span class="pp"> right</span><span class="op">,</span><span class="pp"> start</span></span>
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a> <span class="co">/* Number found. Move one step to the left. */</span></span>
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define start_I I</span><span class="op">,</span><span class="pp"> left</span><span class="op">,</span><span class="pp"> st2</span></span>
<span id="cb10-5"><a href="#cb10-5" aria-hidden="true" tabindex="-1"></a> <span class="co">/* Write a I and stop */</span></span>
<span id="cb10-6"><a href="#cb10-6" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define st2_O I</span><span class="op">,</span><span class="pp"> left</span><span class="op">,</span><span class="pp"> stop</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> /* Search beginning of number. */
#define start_O O, right, start
/* Number found. Move one step to the left. */
#define start_I I, left, st2
/* Write a I and stop */
#define st2_O I, left, stop</code></pre>
<p>Some explanations:
- The tape alphabet is always O and I.
- The states can be anything starting with “st”. “start” and
@@ -251,21 +251,21 @@ line defining <code>st2_I</code> has been left out.)
- The order of the lines is irrelevant.
- You may use C-style comments. (Would you have guessed it?)</p>
<p>Now, the program can be used with</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./herrmann1.sh</span> <span class="st">&#39;prg=plus1.turing&#39;</span> <span class="st">&#39;tape=&quot;I I I&quot;&#39;</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./herrmann1.sh &#39;prg=plus1.turing&#39; &#39;tape=&quot;I I I&quot;&#39;</code></pre>
<p>But what happens if no tape is provided? Up to now, the Turing
machine would start on an empty tape (that is, a tape filled with
<code>O</code>s). For many programs, this doesn’t make much sense (as is
the case for <code>plus1.turing</code>). So you might want to provide a
default tape by adding a line 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="pp">#define tape O O O O O I I I I</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> #define tape O O O O O I I I I</code></pre>
<p>to your program.</p>
<h3 id="debugging">Debugging</h3>
<p>When writing long programs, the most common errors are to forget
to define a state or to misspell one. Let’s assume you forgot the
line</p>
<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">#define start_I I</span><span class="op">,</span><span class="pp"> left</span><span class="op">,</span><span class="pp"> st2</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> #define start_I I, left, st2</code></pre>
<p>Remove it and type</p>
<div class="sourceCode" id="cb14"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./herrmann1</span> <span class="st">&#39;prg=plus1.turing&#39;</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./herrmann1 &#39;prg=plus1.turing&#39;</code></pre>
<p>The output will be</p>
<p>Undefined state start.</p>
<p>Tape:</p>
+7 -7
View File
@@ -1,20 +1,20 @@
## To build:
```sh
```<!---sh-->
make
```
## To use:
```sh
```<!---sh-->
./herrmann2
```
## Try:
```sh
```<!---sh-->
./try.sh
```
@@ -75,7 +75,7 @@ to about 9k.
3D picture, constructed of random characters (with ASCII code between
32 and 126). For example, type
```sh
```<!---sh-->
./herrmann2 < herrmann2.ioccc
```
@@ -86,7 +86,7 @@ new random character, it will take the next one from the
argument. When it arrives at the end of the argument, it will
start over at the beginning. Example:
```sh
```<!---sh-->
./herrmann2 "234 84 045 5 6765 7487 65190 84 656 254 12 43931 818 0 6542 \
341 45 567 76967 7244 606 976567 895 81898 095 68678 1843 4650547 \
565980691 389 04974" < herrmann2.ioccc
@@ -122,7 +122,7 @@ get it (if you lost it or if you don't have it already) is to use
the program itself on the right picture and with the right
argument:
```sh
```<!---sh-->
./herrmann2 \
'char*d,A[9876];e;b;*ad,a,c; tw,ndr,T; wri; ;*h; _,ar ;on;'\
' ;l ;i(V)man,n {-!har ; =Aadre(0,&e,o||n -- +,o4,=9,l=b=8,'\
@@ -183,7 +183,7 @@ works.)
- When still in doubt about how to judge this program, type
```sh
```<!---sh-->
./herrmann2 < herrmann2.cup
```
+17 -17
View File
@@ -141,11 +141,11 @@ Location: <a href="../../location.html#DE">DE</a> - <em>Federal Republic of Germ
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./herrmann2</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./herrmann2</code></pre>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<p>If you use vi(m) you can see a pattern in <a href="herrmann2.cup">herrmann2.cup</a> and
[herrmann2.ioccc][(herrmann2.ioccc]) by say:</p>
<pre><code> /[pon]\</code></pre>
@@ -177,7 +177,7 @@ to about 9k.</p></li>
3D picture, constructed of random characters (with ASCII code between
32 and 126). For example, type</p></li>
</ol>
<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">./herrmann2</span> <span class="op">&lt;</span> herrmann2.ioccc</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./herrmann2 &lt; herrmann2.ioccc</code></pre>
<ol start="3" type="1">
<li>If you want to control the characters used in the output (for
example if your picture is to consist only of digits), pass them
@@ -186,9 +186,9 @@ new random character, it will take the next one from the
argument. When it arrives at the end of the argument, it will
start over at the beginning. Example:</li>
</ol>
<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">./herrmann2</span> <span class="st">&quot;234 84 045 5 6765 7487 65190 84 656 254 12 43931 818 0 6542 </span><span class="dt">\</span></span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a><span class="st"> 341 45 567 76967 7244 606 976567 895 81898 095 68678 1843 4650547 </span><span class="dt">\</span></span>
<span id="cb9-3"><a href="#cb9-3" aria-hidden="true" tabindex="-1"></a><span class="st"> 565980691 389 04974&quot;</span> <span class="op">&lt;</span> herrmann2.ioccc</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./herrmann2 &quot;234 84 045 5 6765 7487 65190 84 656 254 12 43931 818 0 6542 \
341 45 567 76967 7244 606 976567 895 81898 095 68678 1843 4650547 \
565980691 389 04974&quot; &lt; herrmann2.ioccc</code></pre>
<h3 id="some-hints-to-get-better-results">Some hints to get better results</h3>
<ul>
<li><p>Due to the way these 3D pictures work, the left part of the
@@ -216,15 +216,15 @@ get it (if you lost it or if you don’t have it already) is to use
the program itself on the right picture and with the right
argument:</p></li>
</ul>
<div class="sourceCode" id="cb10"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./herrmann2</span> <span class="dt">\</span></span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a> <span class="st">&#39;char*d,A[9876];e;b;*ad,a,c; tw,ndr,T; wri; ;*h; _,ar ;on;&#39;</span><span class="dt">\</span></span>
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a> <span class="st">&#39; ;l ;i(V)man,n {-!har ; =Aadre(0,&amp;e,o||n -- +,o4,=9,l=b=8,&#39;</span><span class="dt">\</span></span>
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a> <span class="st">&#39;!( te-*Aim)|(0~l),srand (l),,!A,d=,b))&amp;&amp;+((A + te-A(&amp;(*)=+ +95&gt;&#39;</span><span class="dt">\</span></span>
<span id="cb10-5"><a href="#cb10-5" aria-hidden="true" tabindex="-1"></a> <span class="st">&#39;e?(*&amp; c_*r=5,r+e-r +_:2-19&lt;-+?|(d==d),!n ?*d| *( (char**)+V+), (&#39;</span><span class="dt">\</span></span>
<span id="cb10-6"><a href="#cb10-6" aria-hidden="true" tabindex="-1"></a> <span class="st">&#39; +0,*d-7 ) -r+8)c:7:+++7+! r: and%9- 85! ()-(r+o):(+w,_+ A*(=er&#39;</span><span class="dt">\</span></span>
<span id="cb10-7"><a href="#cb10-7" aria-hidden="true" tabindex="-1"></a> <span class="st">&#39;i+(o)+b)),!write,(=_((-b+*h)(1,A+b,!!((((-+, a &gt;T^l,( o-95=+))w?&#39;</span><span class="dt">\</span></span>
<span id="cb10-8"><a href="#cb10-8" aria-hidden="true" tabindex="-1"></a> <span class="st">&#39;++ &amp;&amp;r:b&lt;&lt;2+a +w) ((!main(n*n,V) , +-) ),l)),w= +T--&gt;o +o+;{ &amp;!&#39;</span><span class="dt">\</span></span>
<span id="cb10-9"><a href="#cb10-9" aria-hidden="true" tabindex="-1"></a> <span class="st">&#39;a;}return _+= &#39;</span> <span class="op">&lt;</span> herrmann2.ioccc</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./herrmann2 \
&#39;char*d,A[9876];e;b;*ad,a,c; tw,ndr,T; wri; ;*h; _,ar ;on;&#39;\
&#39; ;l ;i(V)man,n {-!har ; =Aadre(0,&amp;e,o||n -- +,o4,=9,l=b=8,&#39;\
&#39;!( te-*Aim)|(0~l),srand (l),,!A,d=,b))&amp;&amp;+((A + te-A(&amp;(*)=+ +95&gt;&#39;\
&#39;e?(*&amp; c_*r=5,r+e-r +_:2-19&lt;-+?|(d==d),!n ?*d| *( (char**)+V+), (&#39;\
&#39; +0,*d-7 ) -r+8)c:7:+++7+! r: and%9- 85! ()-(r+o):(+w,_+ A*(=er&#39;\
&#39;i+(o)+b)),!write,(=_((-b+*h)(1,A+b,!!((((-+, a &gt;T^l,( o-95=+))w?&#39;\
&#39;++ &amp;&amp;r:b&lt;&lt;2+a +w) ((!main(n*n,V) , +-) ),l)),w= +T--&gt;o +o+;{ &amp;!&#39;\
&#39;a;}return _+= &#39; &lt; herrmann2.ioccc</code></pre>
<ul>
<li><p>If I had submitted the program last year, I would have said that
it has exactly the maximum allowed length: 1536 characters. Now
@@ -267,7 +267,7 @@ only needs a logarithmic recursion depth! (Find out how this
works.)</p></li>
<li><p>When still in doubt about how to judge this program, type</p></li>
</ul>
<div class="sourceCode" id="cb11"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./herrmann2</span> <span class="op">&lt;</span> herrmann2.cup</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./herrmann2 &lt; herrmann2.cup</code></pre>
<p>and let the result inspire you. ;-)</p>
<h3 id="requirements-to-the-compiler-compatibility">Requirements to the compiler / Compatibility</h3>
<ul>
+3 -3
View File
@@ -1,13 +1,13 @@
## To build:
```sh
```<!---sh-->
make
```
## To use:
```sh
```<!---sh-->
./jason
```
@@ -37,7 +37,7 @@ cause problems. Go ahead, try it! :-)
TED Shroyer came up with the idea that made it possible to hide all
the text. Thanks, TED. You won. :)
```sh
```<!---sh-->
cc -o jason jason.c
./jason
you are in a maze of twisty little passages
+9 -9
View File
@@ -141,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></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./jason</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./jason</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>You are in a maze of twisty little passages, all alike.</p>
<p>The really amazing part of this is that it’s a text adventure, and there’s
@@ -160,13 +160,13 @@ cause problems. Go ahead, try it! :-)</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>TED Shroyer came up with the idea that made it possible to hide all
the text. Thanks, TED. You won. :)</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">cc</span> <span class="at">-o</span> jason jason.c</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./jason</span></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">you</span> are in a maze of twisty little passages</span>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">caves</span> lead: left forward back</span>
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a> <span class="ex">you</span> see</span>
<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a> <span class="ex">a</span> lamp</span>
<span id="cb3-7"><a href="#cb3-7" aria-hidden="true" tabindex="-1"></a> <span class="op">&gt;</span> _</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> cc -o jason jason.c
./jason
you are in a maze of twisty little passages
caves lead: left forward back
you see
a lamp
&gt; _</code></pre>
<p>This program is a rather nostalgic little labyrinth game. Start
out by typing “<code>get lamp</code>”, then use the direction words “<code>left</code>”,
“<code>right</code>”, “<code>forward</code>”, and “<code>back</code>” to explore the caves. Note that
+14 -14
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make
```
@@ -21,7 +21,7 @@ For more detailed information see [2001 kev bugs](../../bugs.html#2001_kev).
## To use:
```sh
```<!---sh-->
./kev # in one terminal
./kev hostname # in another terminal
@@ -32,7 +32,7 @@ NOTE: each player's paddle is at the bottom and the opponent at the top.
## Try:
```sh
```<!---sh-->
./kev # in one terminal
./kev localhost # in another terminal on the same host
@@ -41,13 +41,13 @@ NOTE: each player's paddle is at the bottom and the opponent at the top.
If you need to change the speed you can reconfigure it like (say
for over a network and not the same host):
```sh
```<!---sh-->
make clobber SPEED=50 all # original default value which is very fast
```
If you wish to change the port you can do so like:
```sh
```<!---sh-->
make clobber PORT=3773 all
```
@@ -58,19 +58,19 @@ syscall with the `l_` macro, changing the `L` variable like one would `PORT`. Of
course you can do more than one at the same time. For instance to change the
speed and port:
```sh
```<!---sh-->
make clobber SPEED=512 PORT=3773 all
```
If you have `xterm` try on one system:
```sh
```<!---sh-->
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev &
```
and then the other, the client system:
```sh
```<!---sh-->
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev localhost&
```
@@ -85,7 +85,7 @@ awkward `,` and `.` keys to move your paddle.
### Alternate build:
```sh
```<!---sh-->
make alt
```
@@ -105,13 +105,13 @@ terminal?
If you have `xterm` try on one system:
```sh
```<!---sh-->
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev.alt &
```
and then the other, the client system:
```sh
```<!---sh-->
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev.alt localhost&
```
@@ -151,14 +151,14 @@ getting the ball past your opponent's paddle. It's pretty fun! :)
Run the server first without any command line arguments, i.e.
```sh
```<!---sh-->
./kev
```
Then run the client with a single command line argument which is
the name of the machine running the server, e.g.
```sh
```<!---sh-->
./kev localhost
```
@@ -169,7 +169,7 @@ blocked by a firewall.
Here's a good quick example to see it in action on your own
machine, assuming you have `Xwindows`:
```sh
```<!---sh-->
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev &
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev localhost&
```
+19 -19
View File
@@ -141,7 +141,7 @@ 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></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<p>There is another version which lets you use the arrow keys rather than the more
awkward <code>,</code> and <code>.</code> keys. See <a href="#alternate-code">alternate code</a> below.</p>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
@@ -149,35 +149,35 @@ awkward <code>,</code> and <code>.</code> keys. See <a href="#alternate-code">al
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2001_kev">2001 kev 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">./kev</span> <span class="co"># in one terminal</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">./kev</span> hostname <span class="co"># in another terminal</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./kev # in one terminal
./kev hostname # in another terminal</code></pre>
<p>NOTE: each player’s paddle is at the bottom and the opponent at the top.</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">./kev</span> <span class="co"># in one terminal</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">./kev</span> localhost <span class="co"># in another terminal on the same host</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./kev # in one terminal
./kev localhost # in another terminal on the same host</code></pre>
<p>If you need to change the speed you can reconfigure it like (say
for over a network and not the same host):</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">make</span> clobber SPEED=50 all <span class="co"># original default value which is very fast</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make clobber SPEED=50 all # original default value which is very fast</code></pre>
<p>If you wish to change the port you can do so like:</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="fu">make</span> clobber PORT=3773 all</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make clobber PORT=3773 all</code></pre>
<p>Of course if you want a port &lt; 1024 you’ll need to be root so don’t do that.</p>
<p>And if you know what you’re doing you can redefine the call to the <code>socket(2)</code>
syscall with the <code>l_</code> macro, changing the <code>L</code> variable like one would <code>PORT</code>. Of
course you can do more than one at the same time. For instance to change the
speed and port:</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> clobber SPEED=512 PORT=3773 all</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make clobber SPEED=512 PORT=3773 all</code></pre>
<p>If you have <code>xterm</code> try on one system:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">xterm</span> <span class="at">-geometry</span> 80x40 <span class="at">-fg</span> green <span class="at">-bg</span> black <span class="at">-fn</span> 9x15bold <span class="at">-e</span> ./kev <span class="kw">&amp;</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev &amp;</code></pre>
<p>and then the other, the client system:</p>
<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">xterm</span> <span class="at">-geometry</span> 80x40 <span class="at">-fg</span> green <span class="at">-bg</span> black <span class="at">-fn</span> 9x15bold <span class="at">-e</span> ./kev localhost<span class="kw">&amp;</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev localhost&amp;</code></pre>
<p>This might look nicer than just the terminal itself.</p>
<h2 id="alternate-code">Alternate code:</h2>
<p>This version allows you to use arrow keys on the keyboard rather than the more
awkward <code>,</code> and <code>.</code> keys to move your paddle.</p>
<h3 id="alternate-build">Alternate build:</h3>
<div class="sourceCode" id="cb10"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> alt</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make alt</code></pre>
<p>You can reconfigure the macros described above in the same way.</p>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>kev.alt</code> as you would <code>kev</code>.</p>
@@ -185,9 +185,9 @@ awkward <code>,</code> and <code>.</code> keys to move your paddle.</p>
terminal?</p>
<h3 id="alternate-try">Alternate try:</h3>
<p>If you have <code>xterm</code> try on one system:</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">xterm</span> <span class="at">-geometry</span> 80x40 <span class="at">-fg</span> green <span class="at">-bg</span> black <span class="at">-fn</span> 9x15bold <span class="at">-e</span> ./kev.alt <span class="kw">&amp;</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev.alt &amp;</code></pre>
<p>and then the other, the client system:</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">xterm</span> <span class="at">-geometry</span> 80x40 <span class="at">-fg</span> green <span class="at">-bg</span> black <span class="at">-fn</span> 9x15bold <span class="at">-e</span> ./kev.alt localhost<span class="kw">&amp;</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev.alt localhost&amp;</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Continuing with this year’s “retro game” theme, this is another old game;
arguably, one of the oldest. Requires a functioning network, and curses.</p>
@@ -212,17 +212,17 @@ speeds. Each player has a paddle to hit the ball, and you get points for
getting the ball past your opponent’s paddle. It’s pretty fun! :)</p>
<h3 id="running">RUNNING</h3>
<p>Run the server first without any command line arguments, i.e.</p>
<div class="sourceCode" id="cb13"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./kev</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./kev</code></pre>
<p>Then run the client with a single command line argument which is
the name of the machine running the server, e.g.</p>
<div class="sourceCode" id="cb14"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./kev</span> localhost</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./kev localhost</code></pre>
<p>Make sure that the terminals on both ends are the same size. Also, the TCP port
number (by default 5455) specified in the <a href="Makefile">Makefile</a> mustn’t be
blocked by a firewall.</p>
<p>Here’s a good quick example to see it in action on your own
machine, assuming you have <code>Xwindows</code>:</p>
<div class="sourceCode" id="cb15"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">xterm</span> <span class="at">-geometry</span> 80x40 <span class="at">-fg</span> green <span class="at">-bg</span> black <span class="at">-fn</span> 9x15bold <span class="at">-e</span> ./kev <span class="kw">&amp;</span></span>
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">xterm</span> <span class="at">-geometry</span> 80x40 <span class="at">-fg</span> green <span class="at">-bg</span> black <span class="at">-fn</span> 9x15bold <span class="at">-e</span> ./kev localhost<span class="kw">&amp;</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev &amp;
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev localhost&amp;</code></pre>
<h3 id="playing">PLAYING</h3>
<p>Your paddle is the one at the bottom of the screen, your opponent
is at the top. To move your paddle left, hold down <code>,</code> (i.e. <code>&lt;</code>
+3 -3
View File
@@ -1,20 +1,20 @@
## To build:
```sh
```<!---sh-->
make
```
## To use:
```sh
```<!---sh-->
./ollinger integer
```
## Try:
```sh
```<!---sh-->
./try.sh
```
+3 -3
View File
@@ -141,11 +141,11 @@ Location: <a href="../../location.html#FR">FR</a> - <em>French Republic</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></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./ollinger</span> integer</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./ollinger integer</code></pre>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<p>Try the above command in a large window, say 200 chars wide and 100
high (200x100) with a tiny font.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
+7 -7
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make
```
@@ -18,7 +18,7 @@ For more detailed information see [2001 rosten bugs](../../bugs.html#2001_rosten
## To use:
```sh
```<!---sh-->
./rosten [number]
```
@@ -30,14 +30,14 @@ NOTE: number is floating point.
## Try:
```sh
```<!---sh-->
./rosten 1.03
./rosten 1.00
```
For some abuse, try:
```sh
```<!---sh-->
./rosten 0.99
```
@@ -57,7 +57,7 @@ cursor) in the wrong way. :-)
### SYNOPSIS
```sh
```<!---sh-->
./rosten [greasiness]
```
@@ -94,7 +94,7 @@ portable, but compile with almost no warnings on most of the compilers
tested. It's a kind of shame that none of the compilers do anything
like this:
```sh
```<!---sh-->
$ make greasymouse
cc greasymouse.c -o greasymouse -lX11
greasymouse.c:30: This macro should have more text and spaces in it
@@ -142,7 +142,7 @@ the way it's used to.
The MIPS compiler suggests an `==` instead of an `=` in expressions
such as:
```c
```<!---c-->
&&(a=b)
```
+16 -16
View File
@@ -141,21 +141,21 @@ 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></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code> STATUS: missing files - please provide them</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2001_rosten">2001 rosten 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">./rosten</span> <span class="pp">[</span><span class="ss">number</span><span class="pp">]</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./rosten [number]</code></pre>
<p>WARNING: this will mess with your mouse and can make it hard to quit the
program. Use at your own risk.</p>
<p>NOTE: number is floating point.</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">./rosten</span> 1.03</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./rosten</span> 1.00</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./rosten 1.03
./rosten 1.00</code></pre>
<p>For some abuse, 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">./rosten</span> 0.99</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./rosten 0.99</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Friction can be your friend if it does not rub you (or your mouse
cursor) in the wrong way. :-)</p>
@@ -163,7 +163,7 @@ cursor) in the wrong way. :-)</p>
<h3 id="name">NAME</h3>
<p><code>rosten</code> - make the mouse act as if it has been greased</p>
<h3 id="synopsis">SYNOPSIS</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">./rosten</span> <span class="pp">[</span><span class="ss">greasiness</span><span class="pp">]</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./rosten [greasiness]</code></pre>
<h3 id="description">DESCRIPTION</h3>
<p>This program is designed primarily to make your X windows interface more
obfuscated. Try doing something mouse driven (such as using a mouse
@@ -183,15 +183,15 @@ required is a large desk and some good grease.</p>
portable, but compile with almost no warnings on most of the compilers
tested. It’s a kind of shame that none of the compilers do anything
like this:</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">$</span> make greasymouse</span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">cc</span> greasymouse.c <span class="at">-o</span> greasymouse <span class="at">-lX11</span></span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">greasymouse.c:30:</span> This macro should have more text and spaces in it</span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">greasymouse.c:32:</span> This is a really stupid way to perform this operation</span>
<span id="cb7-5"><a href="#cb7-5" aria-hidden="true" tabindex="-1"></a> <span class="ex">greasymouse.c:42:</span> This program would look better with a newline here</span>
<span id="cb7-6"><a href="#cb7-6" aria-hidden="true" tabindex="-1"></a> <span class="ex">greasymouse.c:48:</span> That<span class="st">&#39;s a really silly thing to do</span></span>
<span id="cb7-7"><a href="#cb7-7" aria-hidden="true" tabindex="-1"></a><span class="st"> greasymouse.c:55: So is that</span></span>
<span id="cb7-8"><a href="#cb7-8" aria-hidden="true" tabindex="-1"></a><span class="st"> ...</span></span>
<span id="cb7-9"><a href="#cb7-9" aria-hidden="true" tabindex="-1"></a><span class="st"> greasymouse.c:58: This program is rubbish. I&#39;</span>m not going to link it.</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> $ make greasymouse
cc greasymouse.c -o greasymouse -lX11
greasymouse.c:30: This macro should have more text and spaces in it
greasymouse.c:32: This is a really stupid way to perform this operation
greasymouse.c:42: This program would look better with a newline here
greasymouse.c:48: That&#39;s a really silly thing to do
greasymouse.c:55: So is that
...
greasymouse.c:58: This program is rubbish. I&#39;m not going to link it.</code></pre>
<p>The code is best viewed with <a href="https://en.wikipedia.org/wiki/Tab_stop">tab stops</a> every 8 spaces.</p>
<h3 id="bugs">BUGS</h3>
<p>The mouse gets stuck completely if you give it an option of less
@@ -213,7 +213,7 @@ would never do a thing like that: I just haven’t used them in
the way it’s used to.</p>
<p>The MIPS compiler suggests an <code>==</code> instead of an <code>=</code> in expressions
such as:</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="op">&amp;&amp;(</span>a<span class="op">=</span>b<span class="op">)</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> &amp;&amp;(a=b)</code></pre>
<p>but its suggestions would break my program. It also reckons
that <code>r()</code> has no prototype.</p>
<p>Giving the <code>-pedantic</code> option to the MIPS compiler causes it to generate
+4 -4
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make
```
@@ -18,7 +18,7 @@ For more detailed information see [2001 schweikh bugs](../../bugs.html#2001_schw
## To use:
```sh
```<!---sh-->
./schweikh string string2
```
@@ -40,7 +40,7 @@ This is supposed to happen. As is written in the
## Try:
```sh
```<!---sh-->
./try.sh
```
@@ -64,7 +64,7 @@ pattern if you are looking for something in the middle.
You can use it for your shell scripting needs similar to a silent grep
(and without `stdout` redirected to `/dev/null`):
```sh
```<!---sh-->
if prog "${VARIABLE}" '<glob>'; then
echo VARIABLE matches
else
+8 -8
View File
@@ -141,13 +141,13 @@ Location: <a href="../../location.html#DE">DE</a> - <em>Federal Republic of Germ
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2001_schweikh">2001 schweikh 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">./schweikh</span> string string2</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./schweikh string string2</code></pre>
<p>This program will very likely crash or do something else if you do not give it
two args.</p>
<p>Note also that the glob pattern must match the whole string. See the author’s
@@ -157,7 +157,7 @@ comments for details and a workaround.</p>
<a href="http://catb.org/jargon/html/F/feature.html">The Jargon File</a>:</p>
<pre><code> That&#39;s not a bug, that&#39;s a feature.</code></pre>
<h2 id="try">Try:</h2>
<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.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Do you get the pattern here?</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
@@ -170,11 +170,11 @@ the whole string, so you may want to use <code>*</code> at the beginning and end
pattern if you are looking for something in the middle.</p>
<p>You can use it for your shell scripting needs similar to a silent grep
(and without <code>stdout</code> redirected to <code>/dev/null</code>):</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="cf">if</span> <span class="ex">prog</span> <span class="st">&quot;</span><span class="va">${VARIABLE}</span><span class="st">&quot;</span> <span class="st">&#39;&lt;glob&gt;&#39;</span><span class="kw">;</span> <span class="cf">then</span></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> VARIABLE matches</span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a> <span class="cf">else</span></span>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> no match</span>
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a> <span class="cf">fi</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> if prog &quot;${VARIABLE}&quot; &#39;&lt;glob&gt;&#39;; then
echo VARIABLE matches
else
echo no match
fi</code></pre>
<h3 id="bugs">Bugs</h3>
<p>There is no way to escape the meta characters. Dammit Jim, I’m a
one-liner, not a regexp lib.</p>
+9 -9
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make
```
@@ -25,7 +25,7 @@ For more detailed information see [2001 westley bugs](../../bugs.html#2001_westl
## To use:
```sh
```<!---sh-->
./westley 2>/dev/null
# enter some input, terminate with EOF
@@ -37,7 +37,7 @@ For more detailed information see [2001 westley bugs](../../bugs.html#2001_westl
## Try:
```sh
```<!---sh-->
./try.sh
```
@@ -60,7 +60,7 @@ everyone in the face! :-) This is also compiled by default.
### Punch card try:
```sh
```<!---sh-->
echo 'Brian Westley does it again!' | ./westley.punch 2>/dev/null
```
@@ -73,7 +73,7 @@ This alternate code might be less portable.
### Alternate build:
```sh
```<!---sh-->
make alt
```
@@ -108,7 +108,7 @@ to punch cards - C programs can be written to be "drop proof".
Consider the following C program:
```c
```<!---c-->
main(){a();b();c();}
a(){printf("A");}
b(){printf("B");}
@@ -122,7 +122,7 @@ any particular order\*\*; it will always produce `ABC` as output.
You can also use global variables:
```c
```<!---c-->
char *greet = "Hello, world!";
char *greet; main(){puts(greet);}
```
@@ -132,7 +132,7 @@ It would be trivial to write an entire C program that is
possible to write a program that will always compile but
behave differently depending on the line order:
```c
```<!---c-->
test(a,b){return a;}
#define test(a,b) test(b,a)
main(){if (test(0,1)) printf("T"); else printf("F");}
@@ -144,7 +144,7 @@ falls between the declaration of `test()` and its use in
you can use the same call to `test()` repeatedly in
different lines to return different values:
```c
```<!---c-->
#define test(x,y) test(y,x)
main(){int i=0;a(&i);b(&i);c(&i);d(&i);printf("%d\n",i);}
a(i)int*i;{if (test(0,1)) *i += 1;}
+26 -26
View File
@@ -141,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></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<p>There are two additional programs based on the author’s remarks and the original
version, provided as alternate code as it might be less portable. See <a href="#sorted-code">sorted
code</a>, <a href="#punch-card-code">punch card code</a> and <a href="#alternate-code">alternate
@@ -153,14 +153,14 @@ code</a> below.</p>
STATUS: main() has only one arg - try and make it have 2 or 3</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2001_westley">2001 westley 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">./westley</span> <span class="dv">2</span><span class="op">&gt;</span>/dev/null</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> <span class="co"># enter some input, terminate with EOF</span></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> foo <span class="kw">|</span> <span class="ex">./westley</span> <span class="dv">2</span><span class="op">&gt;</span>/dev/null</span>
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a> <span class="ex">./westley</span> <span class="op">&lt;</span> westley.c <span class="dv">2</span><span class="op">&gt;</span>/dev/null</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./westley 2&gt;/dev/null
# enter some input, terminate with EOF
echo foo | ./westley 2&gt;/dev/null
./westley &lt; westley.c 2&gt;/dev/null</code></pre>
<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>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<h2 id="sorted-code">Sorted code:</h2>
<p>The author stated that one can sort (ignoring leading blanks i.e. <code>sort -b</code>) the
code by line and it will always sort the order of the input.</p>
@@ -171,12 +171,12 @@ code by line and it will always sort the order of the input.</p>
<a href="westley.punch.c">westley.punch.c</a> code is specifically so that Westley can punch
everyone in the face! :-) This is also compiled by default.</p>
<h3 id="punch-card-try">Punch card 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="bu">echo</span> <span class="st">&#39;Brian Westley does it again!&#39;</span> <span class="kw">|</span> <span class="ex">./westley.punch</span> <span class="dv">2</span><span class="op">&gt;</span>/dev/null</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> echo &#39;Brian Westley does it again!&#39; | ./westley.punch 2&gt;/dev/null</code></pre>
<h2 id="alternate-code">Alternate code:</h2>
<p>An alternate version of this entry, <a href="westley.alt.c">westley.alt.c</a>, is provided.
This alternate code might be less portable.</p>
<h3 id="alternate-build">Alternate build:</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="fu">make</span> alt</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make alt</code></pre>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>westley.alt</code> as you would <code>westley</code> above.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
@@ -195,36 +195,36 @@ were becoming obsolete just as C was becoming more popular*; this is rather
unfortunate, because C has an advantage over many other languages when it comes
to punch cards - C programs can be written to be “drop proof”.</p>
<p>Consider the following C program:</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> main<span class="op">(){</span>a<span class="op">();</span>b<span class="op">();</span>c<span class="op">();}</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a> a<span class="op">(){</span>printf<span class="op">(</span><span class="st">&quot;A&quot;</span><span class="op">);}</span></span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a> b<span class="op">(){</span>printf<span class="op">(</span><span class="st">&quot;B&quot;</span><span class="op">);}</span></span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a> c<span class="op">(){</span>printf<span class="op">(</span><span class="st">&quot;C&quot;</span><span class="op">);}</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> main(){a();b();c();}
a(){printf(&quot;A&quot;);}
b(){printf(&quot;B&quot;);}
c(){printf(&quot;C&quot;);}</code></pre>
<p>This program will compile and run no matter what order the
lines are in. If you punch it on cards (one line of code per
card, naturally) and drop them, you don’t need to put them in
any particular order**; it will always produce <code>ABC</code> as output.</p>
<p>You can also use global variables:</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="dt">char</span> <span class="op">*</span>greet <span class="op">=</span> <span class="st">&quot;Hello, world!&quot;</span><span class="op">;</span></span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">char</span> <span class="op">*</span>greet<span class="op">;</span> main<span class="op">(){</span>puts<span class="op">(</span>greet<span class="op">);}</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> char *greet = &quot;Hello, world!&quot;;
char *greet; main(){puts(greet);}</code></pre>
<p>It would be trivial to write an entire C program that is
“drop proof” using the above techniques; surprisingly, it’s
possible to write a program that will always compile but
behave differently depending on the line order:</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> test<span class="op">(</span>a<span class="op">,</span>b<span class="op">){</span><span class="cf">return</span> a<span class="op">;}</span></span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define test</span><span class="op">(</span><span class="pp">a</span><span class="op">,</span><span class="pp">b</span><span class="op">)</span><span class="pp"> test</span><span class="op">(</span><span class="pp">b</span><span class="op">,</span><span class="pp">a</span><span class="op">)</span></span>
<span id="cb9-3"><a href="#cb9-3" aria-hidden="true" tabindex="-1"></a> main<span class="op">(){</span><span class="cf">if</span> <span class="op">(</span>test<span class="op">(</span><span class="dv">0</span><span class="op">,</span><span class="dv">1</span><span class="op">))</span> printf<span class="op">(</span><span class="st">&quot;T&quot;</span><span class="op">);</span> <span class="cf">else</span> printf<span class="op">(</span><span class="st">&quot;F&quot;</span><span class="op">);}</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> test(a,b){return a;}
#define test(a,b) test(b,a)
main(){if (test(0,1)) printf(&quot;T&quot;); else printf(&quot;F&quot;);}</code></pre>
<p>This program will print out <code>T</code> if the <code>#define</code> statement
falls between the declaration of <code>test()</code> and its use in
<code>main()</code>, otherwise it will print out <code>F</code>. Furthermore,
you can use the same call to <code>test()</code> repeatedly in
different lines to return different values:</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> <span class="pp">#define test</span><span class="op">(</span><span class="pp">x</span><span class="op">,</span><span class="pp">y</span><span class="op">)</span><span class="pp"> test</span><span class="op">(</span><span class="pp">y</span><span class="op">,</span><span class="pp">x</span><span class="op">)</span></span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a> main<span class="op">(){</span><span class="dt">int</span> i<span class="op">=</span><span class="dv">0</span><span class="op">;</span>a<span class="op">(&amp;</span>i<span class="op">);</span>b<span class="op">(&amp;</span>i<span class="op">);</span>c<span class="op">(&amp;</span>i<span class="op">);</span>d<span class="op">(&amp;</span>i<span class="op">);</span>printf<span class="op">(</span><span class="st">&quot;</span><span class="sc">%d\n</span><span class="st">&quot;</span><span class="op">,</span>i<span class="op">);}</span></span>
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a> a<span class="op">(</span>i<span class="op">)</span><span class="dt">int</span><span class="op">*</span>i<span class="op">;{</span><span class="cf">if</span> <span class="op">(</span>test<span class="op">(</span><span class="dv">0</span><span class="op">,</span><span class="dv">1</span><span class="op">))</span> <span class="op">*</span>i <span class="op">+=</span> <span class="dv">1</span><span class="op">;}</span></span>
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a> b<span class="op">(</span>i<span class="op">)</span><span class="dt">int</span><span class="op">*</span>i<span class="op">;{</span><span class="cf">if</span> <span class="op">(</span>test<span class="op">(</span><span class="dv">0</span><span class="op">,</span><span class="dv">1</span><span class="op">))</span> <span class="op">*</span>i <span class="op">+=</span> <span class="dv">2</span><span class="op">;}</span></span>
<span id="cb10-5"><a href="#cb10-5" aria-hidden="true" tabindex="-1"></a> c<span class="op">(</span>i<span class="op">)</span><span class="dt">int</span><span class="op">*</span>i<span class="op">;{</span><span class="cf">if</span> <span class="op">(</span>test<span class="op">(</span><span class="dv">0</span><span class="op">,</span><span class="dv">1</span><span class="op">))</span> <span class="op">*</span>i <span class="op">+=</span> <span class="dv">4</span><span class="op">;}</span></span>
<span id="cb10-6"><a href="#cb10-6" aria-hidden="true" tabindex="-1"></a> d<span class="op">(</span>i<span class="op">)</span><span class="dt">int</span><span class="op">*</span>i<span class="op">;{</span><span class="cf">if</span> <span class="op">(</span>test<span class="op">(</span><span class="dv">0</span><span class="op">,</span><span class="dv">1</span><span class="op">))</span> <span class="op">*</span>i <span class="op">+=</span> <span class="dv">8</span><span class="op">;}</span></span>
<span id="cb10-7"><a href="#cb10-7" aria-hidden="true" tabindex="-1"></a> test<span class="op">(</span>x<span class="op">,</span>y<span class="op">){</span><span class="cf">return</span> x<span class="op">;}</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> #define test(x,y) test(y,x)
main(){int i=0;a(&amp;i);b(&amp;i);c(&amp;i);d(&amp;i);printf(&quot;%d\n&quot;,i);}
a(i)int*i;{if (test(0,1)) *i += 1;}
b(i)int*i;{if (test(0,1)) *i += 2;}
c(i)int*i;{if (test(0,1)) *i += 4;}
d(i)int*i;{if (test(0,1)) *i += 8;}
test(x,y){return x;}</code></pre>
<p>If you enter the above program on punch cards, throw them
up in the air, gather them up, and run it, you will get
a number from 0 to 15 printed out. Now <em>that’s</em> a random
+2 -2
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make
```
@@ -18,7 +18,7 @@ For more detailed information see [2001 williams bugs](../../bugs.html#2001_will
## To use:
```sh
```<!---sh-->
./williams
```
+2 -2
View File
@@ -141,13 +141,13 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></l
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code> STATUS: known bug - please help us fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2001_williams">2001 williams 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">./williams</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./williams</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p><a href="https://en.wikipedia.org/wiki/WarGames">A strange game. The only winning move is not to
play</a>. No, really; you can’t