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:
1 parent
b84c27ce02
commit
a996f8d2b8
734 files changed
+16723
-16963
No files matched your search
+1
-1
@@ -66,7 +66,7 @@ Also include anything else that you would like to see in future contests.
|
||||
Send such email to:
|
||||
|
||||
```
|
||||
questions@ioccc.org
|
||||
questions@ioccc.org
|
||||
```
|
||||
|
||||
**IMPORTANT NOTE**: The email addresses found above are for historical
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make
|
||||
make
|
||||
```
|
||||
|
||||
The programs that this program is supposed to act on,
|
||||
@@ -19,7 +19,7 @@ whatever your system will compile them as).
|
||||
The current status of this entry is:
|
||||
|
||||
```
|
||||
STATUS: INABIAF - please **DO NOT** fix
|
||||
STATUS: INABIAF - please **DO NOT** fix
|
||||
```
|
||||
|
||||
For more detailed information see [2001 anonymous bugs](../../bugs.html#2001_anonymous).
|
||||
@@ -28,16 +28,16 @@ For more detailed information see [2001 anonymous bugs](../../bugs.html#2001_ano
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
./anonymous x86_program
|
||||
./anonymous x86_program
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
./try.sh
|
||||
./try.sh
|
||||
|
||||
./anonymous anonymous.bed # if able to compile as a 32-bit (-m32) ELF binary
|
||||
./anonymous anonymous.bed # if able to compile as a 32-bit (-m32) ELF binary
|
||||
```
|
||||
|
||||
NOTE: if the 32-bit version cannot be compiled the script will at least compile
|
||||
@@ -65,16 +65,16 @@ that :-(
|
||||
### Alternate build:
|
||||
|
||||
```sh
|
||||
make alt
|
||||
make alt
|
||||
```
|
||||
|
||||
|
||||
### Alternate use:
|
||||
|
||||
```sh
|
||||
./anonymous.ten.alt
|
||||
./anonymous.ten.alt
|
||||
|
||||
./anonymous.bed.alt
|
||||
./anonymous.bed.alt
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -132,8 +132,7 @@
|
||||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||||
<ul>
|
||||
<li>Name: <a href="../../authors.html#Anonymous_2001">Anonymous 2001</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,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>
|
||||
<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>
|
||||
<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
|
||||
@@ -153,14 +152,14 @@ below for information on how to compile these programs as 64-bit binaries (or
|
||||
whatever your system will compile them as).</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#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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
@@ -177,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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ make
|
||||
The current status of this entry is:
|
||||
|
||||
```
|
||||
STATUS: INABIAF - please **DO NOT** fix
|
||||
STATUS: doesn't work with some platforms - please help us fix
|
||||
STATUS: INABIAF - please **DO NOT** fix
|
||||
STATUS: doesn't work with some platforms - please help us fix
|
||||
```
|
||||
|
||||
For more detailed information see [2001 bellard bugs](../../bugs.html#2001_bellard).
|
||||
@@ -20,14 +20,14 @@ For more detailed information see [2001 bellard bugs](../../bugs.html#2001_bella
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
./bellard file
|
||||
./bellard file
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
./bellard bellard.otccex.c
|
||||
./bellard bellard.otccex.c
|
||||
```
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ program.
|
||||
You can use it by typing:
|
||||
|
||||
```sh
|
||||
./bellard bellard.c [args]...
|
||||
./bellard bellard.c [args]...
|
||||
```
|
||||
|
||||
or by giving the C source to its standard input.
|
||||
@@ -62,19 +62,19 @@ or by giving the C source to its standard input.
|
||||
- Sample compilation and execution:
|
||||
|
||||
```sh
|
||||
./bellard bellard.otccex.c 10
|
||||
./bellard bellard.otccex.c 10
|
||||
```
|
||||
|
||||
- Self compilation:
|
||||
|
||||
```sh
|
||||
./bellard bellard.c bellard.otccex.c 10
|
||||
./bellard bellard.c bellard.otccex.c 10
|
||||
```
|
||||
|
||||
- Self compilation iterated...
|
||||
|
||||
```sh
|
||||
./bellard bellard.c bellard.c bellard.otccex.c 10
|
||||
./bellard bellard.c bellard.c bellard.otccex.c 10
|
||||
```
|
||||
|
||||
An alternate syntax is to use it as a script interpreter: you can
|
||||
|
||||
+10
-11
@@ -132,8 +132,7 @@
|
||||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||||
<ul>
|
||||
<li>Name: <a href="../../authors.html#Fabrice_Bellard">Fabrice Bellard</a><br>
|
||||
Location: <a href="../../location.html#FR">FR</a> - <em>French Republic</em> (<em>France</em>)
|
||||
<br><br></li>
|
||||
Location: <a href="../../location.html#FR">FR</a> - <em>French Republic</em> (<em>France</em>)</li>
|
||||
</ul>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
|
||||
@@ -142,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>
|
||||
<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>
|
||||
<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't work with some platforms - please help us fix</code></pre>
|
||||
<pre><code> STATUS: INABIAF - please **DO NOT** fix
|
||||
STATUS: doesn'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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p><code><JUDGES_COMMENTS></code> :-)</p>
|
||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||
@@ -162,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>
|
||||
<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>
|
||||
<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>
|
||||
@@ -170,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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
|
||||
+10
-10
@@ -1,21 +1,21 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
./cheong digits
|
||||
./cheong digits
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
./try.sh
|
||||
./try.sh
|
||||
```
|
||||
|
||||
|
||||
@@ -37,11 +37,11 @@ Program will return the integer part of its square root (n-digits).
|
||||
For example,
|
||||
|
||||
```sh
|
||||
$ cc -o cheong cheong.c
|
||||
$ ./cheong 1234567890
|
||||
35136
|
||||
$ ./cheong 0200000000000000000000000000
|
||||
14142135623730
|
||||
$ cc -o cheong cheong.c
|
||||
$ ./cheong 1234567890
|
||||
35136
|
||||
$ ./cheong 0200000000000000000000000000
|
||||
14142135623730
|
||||
```
|
||||
|
||||
Deviation from these instructions will cause undefined results. :-)
|
||||
@@ -53,8 +53,8 @@ This program runs normally on any ANSI C compiler and is ASCII dependent.
|
||||
Strict compiling gives just one unavoidable warning:
|
||||
|
||||
```sh
|
||||
gcc -ansi -Wall cheong.c
|
||||
cheong.c:3: warning: third argument of `main' should probably be `char **'
|
||||
gcc -ansi -Wall cheong.c
|
||||
cheong.c:3: warning: third argument of `main' should probably be `char **'
|
||||
```
|
||||
|
||||
### Obfuscation
|
||||
|
||||
+11
-12
@@ -132,8 +132,7 @@
|
||||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||||
<ul>
|
||||
<li>Name: <a href="../../authors.html#Raymond_Cheong">Raymond Cheong</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></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">./cheong</span> digits</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">./cheong</span> digits</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>Be sure to give an even number of digits in the argument. Add a
|
||||
leading 0 if needed.</p>
|
||||
@@ -157,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>
|
||||
<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>
|
||||
<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">' should probably be `char **'</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="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">' should probably be `char **'</span></span></code></pre></div>
|
||||
<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
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
./coupard
|
||||
./coupard
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
./try.sh
|
||||
./try.sh
|
||||
```
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ that can do sound, as a lowest-denominator sound I/O interface.
|
||||
To listen to what the program says directly, invoke
|
||||
|
||||
```sh
|
||||
./coupard > /dev/audio
|
||||
./coupard > /dev/audio
|
||||
```
|
||||
|
||||
The program then speaks out something like
|
||||
@@ -69,7 +69,7 @@ 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
|
||||
./coupard | sox -c1 -r8000 -tub - -c2 -r44100 -twav test.wav
|
||||
./coupard | sox -c1 -r8000 -tub - -c2 -r44100 -twav test.wav
|
||||
```
|
||||
|
||||
converts the output of the program into a 44.1KHz stereo .WAV
|
||||
|
||||
@@ -132,8 +132,7 @@
|
||||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||||
<ul>
|
||||
<li>Name: <a href="../../authors.html#Pierre-Philippe_Coupard">Pierre-Philippe Coupard</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></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">./coupard</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">./coupard</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>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,
|
||||
@@ -171,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">></span> /dev/audio</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">./coupard</span> <span class="op">></span> /dev/audio</span></code></pre></div>
|
||||
<p>The program then speaks out something like</p>
|
||||
<blockquote>
|
||||
<p>The time is HH hours MM minutes SS seconds</p>
|
||||
@@ -182,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>
|
||||
<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>
|
||||
<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
@@ -1,7 +1,7 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make
|
||||
make
|
||||
```
|
||||
|
||||
There is an alternate version with vi(m) key movements. See [alternate
|
||||
@@ -11,7 +11,7 @@ code](#alternate code) below.
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
./ctk
|
||||
./ctk
|
||||
```
|
||||
|
||||
|
||||
@@ -24,14 +24,14 @@ This alternate version adds to the movement keys `l` for right, `h` for left and
|
||||
### Alternate build:
|
||||
|
||||
```sh
|
||||
make alt
|
||||
make alt
|
||||
```
|
||||
|
||||
|
||||
### Alternate use:
|
||||
|
||||
```sh
|
||||
./ctk.alt
|
||||
./ctk.alt
|
||||
```
|
||||
|
||||
|
||||
|
||||
+5
-6
@@ -132,8 +132,7 @@
|
||||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||||
<ul>
|
||||
<li>Name: <a href="../../authors.html#Chris_King">Chris King</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,18 +141,18 @@ 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></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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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">./ctk.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">./ctk.alt</span></span></code></pre></div>
|
||||
<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>
|
||||
|
||||
+10
-10
@@ -1,7 +1,7 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make
|
||||
make
|
||||
```
|
||||
|
||||
There is an alternate version based on the author's remarks. See [alternate
|
||||
@@ -13,7 +13,7 @@ code](#alternate-code) below for more 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 [2001 dgbeards bugs](../../bugs.html#2001_dgbeards).
|
||||
@@ -22,7 +22,7 @@ For more detailed information see [2001 dgbeards bugs](../../bugs.html#2001_dgbe
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
./dgbeards
|
||||
./dgbeards
|
||||
```
|
||||
|
||||
|
||||
@@ -37,14 +37,14 @@ this you can look at the author's remarks and make the change.
|
||||
### Alternate build:
|
||||
|
||||
```sh
|
||||
make alt
|
||||
make alt
|
||||
```
|
||||
|
||||
|
||||
### Alternate use:
|
||||
|
||||
```sh
|
||||
./dgbeards.alt
|
||||
./dgbeards.alt
|
||||
```
|
||||
|
||||
|
||||
@@ -224,11 +224,11 @@ A: When compiled with `gcc -Wall`, the compiler generated the following
|
||||
warnings:
|
||||
|
||||
```
|
||||
suggest parentheses around + or - in operand of &
|
||||
array subscript has type 'char'
|
||||
return type defaults to 'int'
|
||||
control reaches end of non-void function
|
||||
value computed is not used
|
||||
suggest parentheses around + or - in operand of &
|
||||
array subscript has type 'char'
|
||||
return type defaults to 'int'
|
||||
control reaches end of non-void function
|
||||
value computed is not used
|
||||
```
|
||||
|
||||
The `value computed is not used` warning happens because I use the `&&`
|
||||
|
||||
+11
-12
@@ -132,8 +132,7 @@
|
||||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||||
<ul>
|
||||
<li>Name: <a href="../../authors.html#Doug_Beardsley">Doug Beardsley</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></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>
|
||||
<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>
|
||||
<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#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>
|
||||
<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>
|
||||
<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>
|
||||
<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">./dgbeards.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">./dgbeards.alt</span></span></code></pre></div>
|
||||
<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>
|
||||
@@ -292,11 +291,11 @@ this is not so.</p>
|
||||
<h4 id="q-what-about-the-compiler-warnings">Q: What about the compiler warnings?</h4>
|
||||
<p>A: When compiled with <code>gcc -Wall</code>, the compiler generated the following
|
||||
warnings:</p>
|
||||
<pre><code>suggest parentheses around + or - in operand of &
|
||||
array subscript has type 'char'
|
||||
return type defaults to 'int'
|
||||
control reaches end of non-void function
|
||||
value computed is not used</code></pre>
|
||||
<pre><code> suggest parentheses around + or - in operand of &
|
||||
array subscript has type 'char'
|
||||
return type defaults to 'int'
|
||||
control reaches end of non-void function
|
||||
value computed is not used</code></pre>
|
||||
<p>The <code>value computed is not used</code> warning happens because I use the <code>&&</code>
|
||||
operator and take advantage of short circuit evaluation instead of using
|
||||
an <code>if()</code> statement.</p>
|
||||
|
||||
+34
-35
@@ -1,7 +1,7 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ make
|
||||
The current status of this entry is:
|
||||
|
||||
```
|
||||
STATUS: missing files - please provide them
|
||||
STATUS: known bug - please help us fix
|
||||
STATUS: missing files - please provide them
|
||||
STATUS: known bug - please help us fix
|
||||
```
|
||||
|
||||
For more detailed information see [2001 herrmann1 bugs](../../bugs.html#2001_herrmann1).
|
||||
@@ -20,7 +20,7 @@ For more detailed information see [2001 herrmann1 bugs](../../bugs.html#2001_her
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
./herrmann1.sh 'prg=file'
|
||||
./herrmann1.sh 'prg=file'
|
||||
```
|
||||
|
||||
NOTE: this entry seems to rely on older versions of gcc for the compilation
|
||||
@@ -31,7 +31,7 @@ need an older compiler perhaps gcc 2.95.
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
./try.sh
|
||||
./try.sh
|
||||
```
|
||||
|
||||
|
||||
@@ -87,23 +87,23 @@ The info files `herrmann1.turing` and [herrmann1.gcd](herrmann1.gcd) are sample
|
||||
programs for the Turing machine. For example, type
|
||||
|
||||
```sh
|
||||
./herrmann1.sh 'prg=herrmann1.times2'
|
||||
./herrmann1.sh 'prg=herrmann1.times2'
|
||||
```
|
||||
|
||||
and watch the animated Turing machine multiply 8 by two (in
|
||||
unary representation). Here's a screen shot during compilation:
|
||||
|
||||
```
|
||||
/*
|
||||
*
|
||||
* State: st2.
|
||||
*
|
||||
* _ _ _ _ _ * _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
* ... O O I I I I I O I I I I I O O ...
|
||||
* ~ ~ ~ ~ ~ * ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
*
|
||||
*
|
||||
*/
|
||||
/*
|
||||
*
|
||||
* State: st2.
|
||||
*
|
||||
* _ _ _ _ _ * _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
* ... O O I I I I I O I I I I I O O ...
|
||||
* ~ ~ ~ ~ ~ * ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
*
|
||||
*
|
||||
*/
|
||||
```
|
||||
|
||||
(As on real videos, you'll see a bit of "white noise" at the
|
||||
@@ -113,9 +113,9 @@ type `./herrmann1` to see the final result. The output will be
|
||||
Final tape:
|
||||
|
||||
```
|
||||
*
|
||||
..OOIIIIIIIIIIIIIIIIOOOO..
|
||||
*
|
||||
*
|
||||
..OOIIIIIIIIIIIIIIIIOOOO..
|
||||
*
|
||||
```
|
||||
|
||||
(Note that the last frame of the animation is _not_ the final
|
||||
@@ -127,8 +127,7 @@ tape of the program `times2.turing`. To provide your own tape, type
|
||||
(for example)
|
||||
|
||||
```sh
|
||||
./herrmann1 prg=times2.turing tape="O O O I I I O O O"
|
||||
|
||||
./herrmann1 prg=times2.turing tape="O O O I I I O O O"
|
||||
```
|
||||
|
||||
(The `O`s and `I`s are letters, not digits.) You might prefer to
|
||||
@@ -138,7 +137,7 @@ this case, the remainder of the tape is filled with `O`s. ;-)
|
||||
If you just type:
|
||||
|
||||
```
|
||||
./herrmann1
|
||||
./herrmann1
|
||||
```
|
||||
|
||||
and run the program, you'll get a usage message (and the return
|
||||
@@ -157,12 +156,12 @@ expected, and one more I is appended to the row.) Let's call it
|
||||
`plus1.turing`. Here's what it could look like:
|
||||
|
||||
```c
|
||||
/* 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
|
||||
/* 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
|
||||
```
|
||||
|
||||
Some explanations:
|
||||
@@ -179,7 +178,7 @@ line defining `st2_I` has been left out.)
|
||||
Now, the program can be used with
|
||||
|
||||
```sh
|
||||
./herrmann1.sh 'prg=plus1.turing' 'tape="I I I"'
|
||||
./herrmann1.sh 'prg=plus1.turing' 'tape="I I I"'
|
||||
```
|
||||
|
||||
But what happens if no tape is provided? Up to now, the Turing
|
||||
@@ -189,7 +188,7 @@ the case for `plus1.turing`). So you might want to provide a
|
||||
default tape by adding a line like
|
||||
|
||||
```c
|
||||
#define tape O O O O O I I I I
|
||||
#define tape O O O O O I I I I
|
||||
```
|
||||
|
||||
to your program.
|
||||
@@ -202,13 +201,13 @@ to define a state or to misspell one. Let's assume you forgot the
|
||||
line
|
||||
|
||||
```c
|
||||
#define start_I I, left, st2
|
||||
#define start_I I, left, st2
|
||||
```
|
||||
|
||||
Remove it and type
|
||||
|
||||
```sh
|
||||
./herrmann1 'prg=plus1.turing'
|
||||
./herrmann1 'prg=plus1.turing'
|
||||
```
|
||||
|
||||
The output will be
|
||||
@@ -218,9 +217,9 @@ Undefined state start.
|
||||
Tape:
|
||||
|
||||
```
|
||||
*
|
||||
..OOOOOOOOIIIIOO..
|
||||
*
|
||||
*
|
||||
..OOOOOOOOIIIIOO..
|
||||
*
|
||||
```
|
||||
|
||||
and the return code will be 1. As you can see, the Turing machine
|
||||
|
||||
+35
-36
@@ -132,8 +132,7 @@
|
||||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||||
<ul>
|
||||
<li>Name: <a href="../../authors.html#Immanuel_Herrmann">Immanuel Herrmann</a><br>
|
||||
Location: <a href="../../location.html#DE">DE</a> - <em>Federal Republic of Germany</em> (<em>Germany</em>)
|
||||
<br><br></li>
|
||||
Location: <a href="../../location.html#DE">DE</a> - <em>Federal Republic of Germany</em> (<em>Germany</em>)</li>
|
||||
</ul>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
|
||||
@@ -142,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>
|
||||
<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>
|
||||
<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>
|
||||
<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">'prg=file'</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">./herrmann1.sh</span> <span class="st">'prg=file'</span></span></code></pre></div>
|
||||
<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>
|
||||
<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="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
|
||||
@@ -193,37 +192,37 @@ 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">'prg=herrmann1.times2'</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">./herrmann1.sh</span> <span class="st">'prg=herrmann1.times2'</span></span></code></pre></div>
|
||||
<p>and watch the animated Turing machine multiply 8 by two (in
|
||||
unary representation). Here’s a screen shot during compilation:</p>
|
||||
<pre><code>/*
|
||||
*
|
||||
* State: st2.
|
||||
*
|
||||
* _ _ _ _ _ * _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
* ... O O I I I I I O I I I I I O O ...
|
||||
* ~ ~ ~ ~ ~ * ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
*
|
||||
*
|
||||
*/</code></pre>
|
||||
<pre><code> /*
|
||||
*
|
||||
* State: st2.
|
||||
*
|
||||
* _ _ _ _ _ * _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
* ... O O I I I I I O I I I I I O O ...
|
||||
* ~ ~ ~ ~ ~ * ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
*
|
||||
*
|
||||
*/</code></pre>
|
||||
<p>(As on real videos, you’ll see a bit of “white noise” at the
|
||||
beginning and at the end.;-) After compilation has terminated,
|
||||
type <code>./herrmann1</code> to see the final result. The output will be</p>
|
||||
<p>Final tape:</p>
|
||||
<pre><code> *
|
||||
..OOIIIIIIIIIIIIIIIIOOOO..
|
||||
*</code></pre>
|
||||
<pre><code> *
|
||||
..OOIIIIIIIIIIIIIIIIOOOO..
|
||||
*</code></pre>
|
||||
<p>(Note that the last frame of the animation is <em>not</em> the final
|
||||
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">"O O O I I I O O O"</span></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">./herrmann1</span> prg=times2.turing tape=<span class="st">"O O O I I I O O O"</span></span></code></pre></div>
|
||||
<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>
|
||||
<p>If you just type:</p>
|
||||
<pre><code>./herrmann1</code></pre>
|
||||
<pre><code> ./herrmann1</code></pre>
|
||||
<p>and run the program, you’ll get a usage message (and the return
|
||||
code will be 2).</p>
|
||||
<p>Note: To get a really nice animation, you’ll need a terminal which
|
||||
@@ -235,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>
|
||||
<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>
|
||||
<p>Some explanations:
|
||||
- The tape alphabet is always O and I.
|
||||
- The states can be anything starting with “st”. “start” and
|
||||
@@ -252,27 +251,27 @@ 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">'prg=plus1.turing'</span> <span class="st">'tape="I I I"'</span></span></code></pre></div>
|
||||
<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">'prg=plus1.turing'</span> <span class="st">'tape="I I I"'</span></span></code></pre></div>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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">'prg=plus1.turing'</span></span></code></pre></div>
|
||||
<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">'prg=plus1.turing'</span></span></code></pre></div>
|
||||
<p>The output will be</p>
|
||||
<p>Undefined state start.</p>
|
||||
<p>Tape:</p>
|
||||
<pre><code> *
|
||||
..OOOOOOOOIIIIOO..
|
||||
*</code></pre>
|
||||
<pre><code> *
|
||||
..OOOOOOOOIIIIOO..
|
||||
*</code></pre>
|
||||
<p>and the return code will be 1. As you can see, the Turing machine
|
||||
moved over the <code>O</code>s, but when it arrived at the <code>I</code> (still in state
|
||||
start), the error occurred.</p>
|
||||
|
||||
+22
-22
@@ -1,21 +1,21 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
./herrmann2
|
||||
./herrmann2
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
./try.sh
|
||||
./try.sh
|
||||
```
|
||||
|
||||
If you use vi(m) you can see a pattern in [herrmann2.cup](herrmann2.cup) and
|
||||
@@ -23,27 +23,27 @@ If you use vi(m) you can see a pattern in [herrmann2.cup](herrmann2.cup) and
|
||||
|
||||
|
||||
```
|
||||
/[pon]\
|
||||
/[pon]\
|
||||
```
|
||||
|
||||
and
|
||||
|
||||
```
|
||||
/l
|
||||
/l
|
||||
```
|
||||
|
||||
For additional fun in [herrmann2.cup](herrmann2.cup) try:
|
||||
|
||||
|
||||
```
|
||||
/[po]
|
||||
/q
|
||||
/[po]
|
||||
/q
|
||||
```
|
||||
|
||||
and in [herrmann2.ioccc](herrmann2.ioccc) try:
|
||||
|
||||
```
|
||||
/n
|
||||
/n
|
||||
```
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ to about 9k.
|
||||
32 and 126). For example, type
|
||||
|
||||
```sh
|
||||
./herrmann2 < herrmann2.ioccc
|
||||
./herrmann2 < herrmann2.ioccc
|
||||
```
|
||||
|
||||
3. If you want to control the characters used in the output (for
|
||||
@@ -87,9 +87,9 @@ argument. When it arrives at the end of the argument, it will
|
||||
start over at the beginning. Example:
|
||||
|
||||
```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
|
||||
./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
|
||||
```
|
||||
|
||||
### Some hints to get better results
|
||||
@@ -123,15 +123,15 @@ the program itself on the right picture and with the right
|
||||
argument:
|
||||
|
||||
```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,'\
|
||||
'!( te-*Aim)|(0~l),srand (l),,!A,d=,b))&&+((A + te-A(&(*)=+ +95>'\
|
||||
'e?(*& c_*r=5,r+e-r +_:2-19<-+?|(d==d),!n ?*d| *( (char**)+V+), ('\
|
||||
' +0,*d-7 ) -r+8)c:7:+++7+! r: and%9- 85! ()-(r+o):(+w,_+ A*(=er'\
|
||||
'i+(o)+b)),!write,(=_((-b+*h)(1,A+b,!!((((-+, a >T^l,( o-95=+))w?'\
|
||||
'++ &&r:b<<2+a +w) ((!main(n*n,V) , +-) ),l)),w= +T-->o +o+;{ &!'\
|
||||
'a;}return _+= ' < herrmann2.ioccc
|
||||
./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,'\
|
||||
'!( te-*Aim)|(0~l),srand (l),,!A,d=,b))&&+((A + te-A(&(*)=+ +95>'\
|
||||
'e?(*& c_*r=5,r+e-r +_:2-19<-+?|(d==d),!n ?*d| *( (char**)+V+), ('\
|
||||
' +0,*d-7 ) -r+8)c:7:+++7+! r: and%9- 85! ()-(r+o):(+w,_+ A*(=er'\
|
||||
'i+(o)+b)),!write,(=_((-b+*h)(1,A+b,!!((((-+, a >T^l,( o-95=+))w?'\
|
||||
'++ &&r:b<<2+a +w) ((!main(n*n,V) , +-) ),l)),w= +T-->o +o+;{ &!'\
|
||||
'a;}return _+= ' < herrmann2.ioccc
|
||||
```
|
||||
|
||||
- If I had submitted the program last year, I would have said that
|
||||
@@ -184,7 +184,7 @@ works.)
|
||||
- When still in doubt about how to judge this program, type
|
||||
|
||||
```sh
|
||||
./herrmann2 < herrmann2.cup
|
||||
./herrmann2 < herrmann2.cup
|
||||
```
|
||||
|
||||
and let the result inspire you. ;-)
|
||||
|
||||
+23
-24
@@ -132,8 +132,7 @@
|
||||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||||
<ul>
|
||||
<li>Name: <a href="../../authors.html#Immanuel_Herrmann">Immanuel Herrmann</a><br>
|
||||
Location: <a href="../../location.html#DE">DE</a> - <em>Federal Republic of Germany</em> (<em>Germany</em>)
|
||||
<br><br></li>
|
||||
Location: <a href="../../location.html#DE">DE</a> - <em>Federal Republic of Germany</em> (<em>Germany</em>)</li>
|
||||
</ul>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
|
||||
@@ -142,21 +141,21 @@ 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>
|
||||
<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">./herrmann2</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">./herrmann2</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 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>
|
||||
<pre><code> /[pon]\</code></pre>
|
||||
<p>and</p>
|
||||
<pre><code>/l</code></pre>
|
||||
<pre><code> /l</code></pre>
|
||||
<p>For additional fun in <a href="herrmann2.cup">herrmann2.cup</a> try:</p>
|
||||
<pre><code>/[po]
|
||||
/q</code></pre>
|
||||
<pre><code> /[po]
|
||||
/q</code></pre>
|
||||
<p>and in <a href="herrmann2.ioccc">herrmann2.ioccc</a> try:</p>
|
||||
<pre><code>/n</code></pre>
|
||||
<pre><code> /n</code></pre>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>Be careful when staring at the source code - your eyes might cross, but
|
||||
if you concentrate on your focus you will find illumination!</p>
|
||||
@@ -178,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"><</span> herrmann2.ioccc</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">./herrmann2</span> <span class="op"><</span> herrmann2.ioccc</span></code></pre></div>
|
||||
<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
|
||||
@@ -187,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">"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"</span> <span class="op"><</span> herrmann2.ioccc</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">./herrmann2</span> <span class="st">"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"</span> <span class="op"><</span> herrmann2.ioccc</span></code></pre></div>
|
||||
<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
|
||||
@@ -217,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">'char*d,A[9876];e;b;*ad,a,c; tw,ndr,T; wri; ;*h; _,ar ;on;'</span><span class="dt">\</span></span>
|
||||
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a><span class="st">' ;l ;i(V)man,n {-!har ; =Aadre(0,&e,o||n -- +,o4,=9,l=b=8,'</span><span class="dt">\</span></span>
|
||||
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a><span class="st">'!( te-*Aim)|(0~l),srand (l),,!A,d=,b))&&+((A + te-A(&(*)=+ +95>'</span><span class="dt">\</span></span>
|
||||
<span id="cb10-5"><a href="#cb10-5" aria-hidden="true" tabindex="-1"></a><span class="st">'e?(*& c_*r=5,r+e-r +_:2-19<-+?|(d==d),!n ?*d| *( (char**)+V+), ('</span><span class="dt">\</span></span>
|
||||
<span id="cb10-6"><a href="#cb10-6" aria-hidden="true" tabindex="-1"></a><span class="st">' +0,*d-7 ) -r+8)c:7:+++7+! r: and%9- 85! ()-(r+o):(+w,_+ A*(=er'</span><span class="dt">\</span></span>
|
||||
<span id="cb10-7"><a href="#cb10-7" aria-hidden="true" tabindex="-1"></a><span class="st">'i+(o)+b)),!write,(=_((-b+*h)(1,A+b,!!((((-+, a >T^l,( o-95=+))w?'</span><span class="dt">\</span></span>
|
||||
<span id="cb10-8"><a href="#cb10-8" aria-hidden="true" tabindex="-1"></a><span class="st">'++ &&r:b<<2+a +w) ((!main(n*n,V) , +-) ),l)),w= +T-->o +o+;{ &!'</span><span class="dt">\</span></span>
|
||||
<span id="cb10-9"><a href="#cb10-9" aria-hidden="true" tabindex="-1"></a><span class="st">'a;}return _+= '</span> <span class="op"><</span> herrmann2.ioccc</span></code></pre></div>
|
||||
<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">'char*d,A[9876];e;b;*ad,a,c; tw,ndr,T; wri; ;*h; _,ar ;on;'</span><span class="dt">\</span></span>
|
||||
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a> <span class="st">' ;l ;i(V)man,n {-!har ; =Aadre(0,&e,o||n -- +,o4,=9,l=b=8,'</span><span class="dt">\</span></span>
|
||||
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a> <span class="st">'!( te-*Aim)|(0~l),srand (l),,!A,d=,b))&&+((A + te-A(&(*)=+ +95>'</span><span class="dt">\</span></span>
|
||||
<span id="cb10-5"><a href="#cb10-5" aria-hidden="true" tabindex="-1"></a> <span class="st">'e?(*& c_*r=5,r+e-r +_:2-19<-+?|(d==d),!n ?*d| *( (char**)+V+), ('</span><span class="dt">\</span></span>
|
||||
<span id="cb10-6"><a href="#cb10-6" aria-hidden="true" tabindex="-1"></a> <span class="st">' +0,*d-7 ) -r+8)c:7:+++7+! r: and%9- 85! ()-(r+o):(+w,_+ A*(=er'</span><span class="dt">\</span></span>
|
||||
<span id="cb10-7"><a href="#cb10-7" aria-hidden="true" tabindex="-1"></a> <span class="st">'i+(o)+b)),!write,(=_((-b+*h)(1,A+b,!!((((-+, a >T^l,( o-95=+))w?'</span><span class="dt">\</span></span>
|
||||
<span id="cb10-8"><a href="#cb10-8" aria-hidden="true" tabindex="-1"></a> <span class="st">'++ &&r:b<<2+a +w) ((!main(n*n,V) , +-) ),l)),w= +T-->o +o+;{ &!'</span><span class="dt">\</span></span>
|
||||
<span id="cb10-9"><a href="#cb10-9" aria-hidden="true" tabindex="-1"></a> <span class="st">'a;}return _+= '</span> <span class="op"><</span> herrmann2.ioccc</span></code></pre></div>
|
||||
<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
|
||||
@@ -268,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"><</span> herrmann2.cup</span></code></pre></div>
|
||||
<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"><</span> herrmann2.cup</span></code></pre></div>
|
||||
<p>and let the result inspire you. ;-)</p>
|
||||
<h3 id="requirements-to-the-compiler-compatibility">Requirements to the compiler / Compatibility</h3>
|
||||
<ul>
|
||||
|
||||
+1
-1
@@ -172,7 +172,7 @@ we do look at and work out what every entry does.</p>
|
||||
<p>Please send us comments and suggestions what we have expressed above.
|
||||
Also include anything else that you would like to see in future contests.
|
||||
Send such email to:</p>
|
||||
<pre><code>questions@ioccc.org</code></pre>
|
||||
<pre><code> questions@ioccc.org</code></pre>
|
||||
<p><strong>IMPORTANT NOTE</strong>: The email addresses found above are for historical
|
||||
purposes only, and should not be used today. See
|
||||
<a href="../contact.html">contact.html</a> for up to date contact details
|
||||
|
||||
+9
-17
@@ -1,14 +1,14 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
./jason
|
||||
./jason
|
||||
```
|
||||
|
||||
|
||||
@@ -38,13 +38,13 @@ TED Shroyer came up with the idea that made it possible to hide all
|
||||
the text. Thanks, TED. You won. :)
|
||||
|
||||
```sh
|
||||
cc -o jason jason.c
|
||||
./jason
|
||||
you are in a maze of twisty little passages
|
||||
caves lead: left forward back
|
||||
you see
|
||||
a lamp
|
||||
> _
|
||||
cc -o jason jason.c
|
||||
./jason
|
||||
you are in a maze of twisty little passages
|
||||
caves lead: left forward back
|
||||
you see
|
||||
a lamp
|
||||
> _
|
||||
```
|
||||
|
||||
This program is a rather nostalgic little labyrinth game. Start
|
||||
@@ -117,14 +117,6 @@ the game entertaining, see if you can find
|
||||
in the source code.)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### GAME STRATEGY SPOILER
|
||||
|
||||
The trick, of course, is to drop items in empty rooms to mark them. That way
|
||||
|
||||
+10
-11
@@ -132,8 +132,7 @@
|
||||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||||
<ul>
|
||||
<li>Name: <a href="../../authors.html#Jason_Orendorff">Jason Orendorff</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></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">./jason</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">./jason</span></span></code></pre></div>
|
||||
<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
|
||||
@@ -161,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">></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="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">></span> _</span></code></pre></div>
|
||||
<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
|
||||
|
||||
+18
-18
@@ -1,7 +1,7 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make
|
||||
make
|
||||
```
|
||||
|
||||
There is another version which lets you use the arrow keys rather than the more
|
||||
@@ -13,7 +13,7 @@ awkward `,` and `.` keys. See [alternate code](#alternate-code) below.
|
||||
The current status of this entry is:
|
||||
|
||||
```
|
||||
STATUS: INABIAF - please **DO NOT** fix
|
||||
STATUS: INABIAF - please **DO NOT** fix
|
||||
```
|
||||
|
||||
For more detailed information see [2001 kev bugs](../../bugs.html#2001_kev).
|
||||
@@ -22,9 +22,9 @@ For more detailed information see [2001 kev bugs](../../bugs.html#2001_kev).
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
./kev # in one terminal
|
||||
./kev # in one terminal
|
||||
|
||||
./kev hostname # in another terminal
|
||||
./kev hostname # in another terminal
|
||||
```
|
||||
|
||||
NOTE: each player's paddle is at the bottom and the opponent at the top.
|
||||
@@ -33,22 +33,22 @@ NOTE: each player's paddle is at the bottom and the opponent at the top.
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
./kev # in one terminal
|
||||
./kev # in one terminal
|
||||
|
||||
./kev localhost # in another terminal on the same host
|
||||
./kev localhost # in another terminal on the same host
|
||||
```
|
||||
|
||||
If you need to change the speed you can reconfigure it like (say
|
||||
for over a network and not the same host):
|
||||
|
||||
```sh
|
||||
make clobber SPEED=50 all # original default value which is very fast
|
||||
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
|
||||
make clobber PORT=3773 all
|
||||
make clobber PORT=3773 all
|
||||
```
|
||||
|
||||
Of course if you want a port < 1024 you'll need to be root so don't do that.
|
||||
@@ -59,19 +59,19 @@ course you can do more than one at the same time. For instance to change the
|
||||
speed and port:
|
||||
|
||||
```sh
|
||||
make clobber SPEED=512 PORT=3773 all
|
||||
make clobber SPEED=512 PORT=3773 all
|
||||
```
|
||||
|
||||
If you have `xterm` try on one system:
|
||||
|
||||
```sh
|
||||
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev &
|
||||
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev &
|
||||
```
|
||||
|
||||
and then the other, the client system:
|
||||
|
||||
```sh
|
||||
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev localhost&
|
||||
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev localhost&
|
||||
```
|
||||
|
||||
This might look nicer than just the terminal itself.
|
||||
@@ -86,7 +86,7 @@ awkward `,` and `.` keys to move your paddle.
|
||||
### Alternate build:
|
||||
|
||||
```sh
|
||||
make alt
|
||||
make alt
|
||||
```
|
||||
|
||||
You can reconfigure the macros described above in the same way.
|
||||
@@ -106,13 +106,13 @@ terminal?
|
||||
If you have `xterm` try on one system:
|
||||
|
||||
```sh
|
||||
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev.alt &
|
||||
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev.alt &
|
||||
```
|
||||
|
||||
and then the other, the client system:
|
||||
|
||||
```sh
|
||||
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev.alt localhost&
|
||||
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev.alt localhost&
|
||||
```
|
||||
|
||||
|
||||
@@ -152,14 +152,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
|
||||
./kev
|
||||
./kev
|
||||
```
|
||||
|
||||
Then run the client with a single command line argument which is
|
||||
the name of the machine running the server, e.g.
|
||||
|
||||
```sh
|
||||
./kev localhost
|
||||
./kev localhost
|
||||
```
|
||||
|
||||
Make sure that the terminals on both ends are the same size. Also, the TCP port
|
||||
@@ -170,8 +170,8 @@ Here's a good quick example to see it in action on your own
|
||||
machine, assuming you have `Xwindows`:
|
||||
|
||||
```sh
|
||||
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev &
|
||||
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev localhost&
|
||||
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev &
|
||||
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev localhost&
|
||||
```
|
||||
|
||||
|
||||
|
||||
+19
-20
@@ -132,8 +132,7 @@
|
||||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||||
<ul>
|
||||
<li>Name: <a href="../../authors.html#Kevin_Pulo">Kevin Pulo</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,43 +141,43 @@ 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>
|
||||
<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>
|
||||
<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>
|
||||
<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#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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<p>Of course if you want a port < 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>
|
||||
<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>
|
||||
<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">&</span></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">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">&</span></span></code></pre></div>
|
||||
<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">&</span></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">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">&</span></span></code></pre></div>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
@@ -186,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">&</span></span></code></pre></div>
|
||||
<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">&</span></span></code></pre></div>
|
||||
<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">&</span></span></code></pre></div>
|
||||
<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">&</span></span></code></pre></div>
|
||||
<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>
|
||||
@@ -213,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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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">&</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">&</span></span></code></pre></div>
|
||||
<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">&</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">&</span></span></code></pre></div>
|
||||
<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><</code>
|
||||
|
||||
+22
-22
@@ -1,21 +1,21 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
./ollinger integer
|
||||
./ollinger integer
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
./try.sh
|
||||
./try.sh
|
||||
```
|
||||
|
||||
Try the above command in a large window, say 200 chars wide and 100
|
||||
@@ -56,34 +56,34 @@ A: Yes, there are types of entries that show up over and over again.
|
||||
The guidelines say:
|
||||
|
||||
```
|
||||
We tend to dislike programs that:
|
||||
are similar to previous winning entries
|
||||
We tend to dislike programs that:
|
||||
are similar to previous winning entries
|
||||
|
||||
We like variety. However too often we see (please look at the winning
|
||||
examples given to be aware of the level of the competition):
|
||||
We like variety. However too often we see (please look at the winning
|
||||
examples given to be aware of the level of the competition):
|
||||
|
||||
(snip)
|
||||
(snip)
|
||||
|
||||
generating small primes (below is the list of all prime related entries)
|
||||
generating small primes (below is the list of all prime related entries)
|
||||
|
||||
1985/august
|
||||
1988/applin
|
||||
1994/weisberg
|
||||
1995/makarios
|
||||
1996/dalbec
|
||||
2000/bellard
|
||||
1985/august
|
||||
1988/applin
|
||||
1994/weisberg
|
||||
1995/makarios
|
||||
1996/dalbec
|
||||
2000/bellard
|
||||
|
||||
As you can see, just a list of primes (let alone small primes)
|
||||
does not cut it anymore.
|
||||
As you can see, just a list of primes (let alone small primes)
|
||||
does not cut it anymore.
|
||||
|
||||
(snip)
|
||||
(snip)
|
||||
|
||||
entries that use some complex state machine/table to print something
|
||||
entries that use some complex state machine/table to print something
|
||||
|
||||
1988/isaak
|
||||
1988/phillipps
|
||||
1988/isaak
|
||||
1988/phillipps
|
||||
|
||||
Unbeaten for 12 years and counting...
|
||||
Unbeaten for 12 years and counting...
|
||||
```
|
||||
|
||||
I think this is enough motivation for trying to submit a program which uses
|
||||
|
||||
+23
-24
@@ -132,8 +132,7 @@
|
||||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||||
<ul>
|
||||
<li>Name: <a href="../../authors.html#Nicolas_Ollinger">Nicolas Ollinger</a><br>
|
||||
Location: <a href="../../location.html#FR">FR</a> - <em>French Republic</em> (<em>France</em>)
|
||||
<br><br></li>
|
||||
Location: <a href="../../location.html#FR">FR</a> - <em>French Republic</em> (<em>France</em>)</li>
|
||||
</ul>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
|
||||
@@ -142,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>
|
||||
<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">./ollinger</span> integer</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">./ollinger</span> integer</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>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>
|
||||
@@ -169,34 +168,34 @@ character printed on the screen.</p>
|
||||
judges get tired of them?</p>
|
||||
<p>A: Yes, there are types of entries that show up over and over again.
|
||||
The guidelines say:</p>
|
||||
<pre><code>We tend to dislike programs that:
|
||||
are similar to previous winning entries
|
||||
<pre><code> We tend to dislike programs that:
|
||||
are similar to previous winning entries
|
||||
|
||||
We like variety. However too often we see (please look at the winning
|
||||
examples given to be aware of the level of the competition):
|
||||
We like variety. However too often we see (please look at the winning
|
||||
examples given to be aware of the level of the competition):
|
||||
|
||||
(snip)
|
||||
(snip)
|
||||
|
||||
generating small primes (below is the list of all prime related entries)
|
||||
generating small primes (below is the list of all prime related entries)
|
||||
|
||||
1985/august
|
||||
1988/applin
|
||||
1994/weisberg
|
||||
1995/makarios
|
||||
1996/dalbec
|
||||
2000/bellard
|
||||
1985/august
|
||||
1988/applin
|
||||
1994/weisberg
|
||||
1995/makarios
|
||||
1996/dalbec
|
||||
2000/bellard
|
||||
|
||||
As you can see, just a list of primes (let alone small primes)
|
||||
does not cut it anymore.
|
||||
As you can see, just a list of primes (let alone small primes)
|
||||
does not cut it anymore.
|
||||
|
||||
(snip)
|
||||
(snip)
|
||||
|
||||
entries that use some complex state machine/table to print something
|
||||
entries that use some complex state machine/table to print something
|
||||
|
||||
1988/isaak
|
||||
1988/phillipps
|
||||
1988/isaak
|
||||
1988/phillipps
|
||||
|
||||
Unbeaten for 12 years and counting...</code></pre>
|
||||
Unbeaten for 12 years and counting...</code></pre>
|
||||
<p>I think this is enough motivation for trying to submit a program which uses
|
||||
some complex state machine/table to generate small primes and print them.</p>
|
||||
<h3 id="the-way-it-works">The way it works</h3>
|
||||
|
||||
+17
-17
@@ -1,7 +1,7 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ make
|
||||
The current status of this entry is:
|
||||
|
||||
```
|
||||
STATUS: missing files - please provide them
|
||||
STATUS: missing files - please provide them
|
||||
```
|
||||
|
||||
For more detailed information see [2001 rosten bugs](../../bugs.html#2001_rosten).
|
||||
@@ -19,7 +19,7 @@ For more detailed information see [2001 rosten bugs](../../bugs.html#2001_rosten
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
./rosten [number]
|
||||
./rosten [number]
|
||||
```
|
||||
|
||||
WARNING: this will mess with your mouse and can make it hard to quit the
|
||||
@@ -31,14 +31,14 @@ NOTE: number is floating point.
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
./rosten 1.03
|
||||
./rosten 1.00
|
||||
./rosten 1.03
|
||||
./rosten 1.00
|
||||
```
|
||||
|
||||
For some abuse, try:
|
||||
|
||||
```sh
|
||||
./rosten 0.99
|
||||
./rosten 0.99
|
||||
```
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ cursor) in the wrong way. :-)
|
||||
### SYNOPSIS
|
||||
|
||||
```sh
|
||||
./rosten [greasiness]
|
||||
./rosten [greasiness]
|
||||
```
|
||||
|
||||
|
||||
@@ -95,15 +95,15 @@ tested. It's a kind of shame that none of the compilers do anything
|
||||
like this:
|
||||
|
||||
```sh
|
||||
$ 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's a really silly thing to do
|
||||
greasymouse.c:55: So is that
|
||||
...
|
||||
greasymouse.c:58: This program is rubbish. I'm not going to link it.
|
||||
$ 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's a really silly thing to do
|
||||
greasymouse.c:55: So is that
|
||||
...
|
||||
greasymouse.c:58: This program is rubbish. I'm not going to link it.
|
||||
```
|
||||
|
||||
The code is best viewed with [tab stops](https://en.wikipedia.org/wiki/Tab_stop) every 8 spaces.
|
||||
@@ -143,7 +143,7 @@ The MIPS compiler suggests an `==` instead of an `=` in expressions
|
||||
such as:
|
||||
|
||||
```c
|
||||
&&(a=b)
|
||||
&&(a=b)
|
||||
```
|
||||
|
||||
but its suggestions would break my program. It also reckons
|
||||
|
||||
+18
-19
@@ -132,8 +132,7 @@
|
||||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||||
<ul>
|
||||
<li>Name: <a href="../../authors.html#Edward_Rosten">Edward Rosten</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,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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
@@ -164,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>
|
||||
<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>
|
||||
<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
|
||||
@@ -184,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">'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'</span>m not going to link it.</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">$</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">'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'</span>m not going to link it.</span></code></pre></div>
|
||||
<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
|
||||
@@ -214,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">&&(</span>a<span class="op">=</span>b<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="op">&&(</span>a<span class="op">=</span>b<span class="op">)</span></span></code></pre></div>
|
||||
<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
|
||||
|
||||
+10
-10
@@ -1,7 +1,7 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ make
|
||||
The current status of this entry is:
|
||||
|
||||
```
|
||||
STATUS: INABIAF - please **DO NOT** fix
|
||||
STATUS: INABIAF - please **DO NOT** fix
|
||||
```
|
||||
|
||||
For more detailed information see [2001 schweikh bugs](../../bugs.html#2001_schweikh).
|
||||
@@ -19,7 +19,7 @@ For more detailed information see [2001 schweikh bugs](../../bugs.html#2001_schw
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
./schweikh string string2
|
||||
./schweikh string string2
|
||||
```
|
||||
|
||||
This program will very likely crash or do something else if you do not give it
|
||||
@@ -34,14 +34,14 @@ This is supposed to happen. As is written in the
|
||||
[The Jargon File](http://catb.org/jargon/html/F/feature.html):
|
||||
|
||||
```
|
||||
That's not a bug, that's a feature.
|
||||
That's not a bug, that's a feature.
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
./try.sh
|
||||
./try.sh
|
||||
```
|
||||
|
||||
|
||||
@@ -65,11 +65,11 @@ You can use it for your shell scripting needs similar to a silent grep
|
||||
(and without `stdout` redirected to `/dev/null`):
|
||||
|
||||
```sh
|
||||
if prog "${VARIABLE}" '<glob>'; then
|
||||
echo VARIABLE matches
|
||||
else
|
||||
echo no match
|
||||
fi
|
||||
if prog "${VARIABLE}" '<glob>'; then
|
||||
echo VARIABLE matches
|
||||
else
|
||||
echo no match
|
||||
fi
|
||||
```
|
||||
|
||||
### Bugs
|
||||
|
||||
+11
-12
@@ -132,8 +132,7 @@
|
||||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||||
<ul>
|
||||
<li>Name: <a href="../../authors.html#Jens_Schweikhardt">Jens Schweikhardt</a><br>
|
||||
Location: <a href="../../location.html#DE">DE</a> - <em>Federal Republic of Germany</em> (<em>Germany</em>)
|
||||
<br><br></li>
|
||||
Location: <a href="../../location.html#DE">DE</a> - <em>Federal Republic of Germany</em> (<em>Germany</em>)</li>
|
||||
</ul>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
|
||||
@@ -142,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>
|
||||
<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>
|
||||
<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#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>
|
||||
<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>
|
||||
<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
|
||||
@@ -156,9 +155,9 @@ comments for details and a workaround.</p>
|
||||
<p>There’s also no way to escape meta characters.</p>
|
||||
<p>This is supposed to happen. As is written in the
|
||||
<a href="http://catb.org/jargon/html/F/feature.html">The Jargon File</a>:</p>
|
||||
<pre><code>That's not a bug, that's a feature.</code></pre>
|
||||
<pre><code> That's not a bug, that'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>
|
||||
<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>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>Do you get the pattern here?</p>
|
||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||
@@ -171,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">"</span><span class="va">${VARIABLE}</span><span class="st">"</span> <span class="st">'<glob>'</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>
|
||||
<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">"</span><span class="va">${VARIABLE}</span><span class="st">"</span> <span class="st">'<glob>'</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>
|
||||
<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>
|
||||
|
||||
+30
-30
@@ -1,7 +1,7 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make
|
||||
make
|
||||
```
|
||||
|
||||
There are two additional programs based on the author's remarks and the original
|
||||
@@ -15,9 +15,9 @@ code](#alternate-code) below.
|
||||
The current status of this entry is:
|
||||
|
||||
```
|
||||
STATUS: uses gets() - change to fgets() if possible
|
||||
STATUS: missing files - please provide them
|
||||
STATUS: main() has only one arg - try and make it have 2 or 3
|
||||
STATUS: uses gets() - change to fgets() if possible
|
||||
STATUS: missing files - please provide them
|
||||
STATUS: main() has only one arg - try and make it have 2 or 3
|
||||
```
|
||||
|
||||
For more detailed information see [2001 westley bugs](../../bugs.html#2001_westley).
|
||||
@@ -26,19 +26,19 @@ For more detailed information see [2001 westley bugs](../../bugs.html#2001_westl
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
./westley 2>/dev/null
|
||||
# enter some input, terminate with EOF
|
||||
./westley 2>/dev/null
|
||||
# enter some input, terminate with EOF
|
||||
|
||||
echo foo | ./westley 2>/dev/null
|
||||
echo foo | ./westley 2>/dev/null
|
||||
|
||||
./westley < westley.c 2>/dev/null
|
||||
./westley < westley.c 2>/dev/null
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
./try.sh
|
||||
./try.sh
|
||||
```
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ everyone in the face! :-) This is also compiled by default.
|
||||
### Punch card try:
|
||||
|
||||
```sh
|
||||
echo 'Brian Westley does it again!' | ./westley.punch 2>/dev/null
|
||||
echo 'Brian Westley does it again!' | ./westley.punch 2>/dev/null
|
||||
```
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ This alternate code might be less portable.
|
||||
### Alternate build:
|
||||
|
||||
```sh
|
||||
make alt
|
||||
make alt
|
||||
```
|
||||
|
||||
|
||||
@@ -109,10 +109,10 @@ to punch cards - C programs can be written to be "drop proof".
|
||||
Consider the following C program:
|
||||
|
||||
```c
|
||||
main(){a();b();c();}
|
||||
a(){printf("A");}
|
||||
b(){printf("B");}
|
||||
c(){printf("C");}
|
||||
main(){a();b();c();}
|
||||
a(){printf("A");}
|
||||
b(){printf("B");}
|
||||
c(){printf("C");}
|
||||
```
|
||||
|
||||
This program will compile and run no matter what order the
|
||||
@@ -123,8 +123,8 @@ any particular order\*\*; it will always produce `ABC` as output.
|
||||
You can also use global variables:
|
||||
|
||||
```c
|
||||
char *greet = "Hello, world!";
|
||||
char *greet; main(){puts(greet);}
|
||||
char *greet = "Hello, world!";
|
||||
char *greet; main(){puts(greet);}
|
||||
```
|
||||
|
||||
It would be trivial to write an entire C program that is
|
||||
@@ -133,9 +133,9 @@ possible to write a program that will always compile but
|
||||
behave differently depending on the line order:
|
||||
|
||||
```c
|
||||
test(a,b){return a;}
|
||||
#define test(a,b) test(b,a)
|
||||
main(){if (test(0,1)) printf("T"); else printf("F");}
|
||||
test(a,b){return a;}
|
||||
#define test(a,b) test(b,a)
|
||||
main(){if (test(0,1)) printf("T"); else printf("F");}
|
||||
```
|
||||
|
||||
This program will print out `T` if the `#define` statement
|
||||
@@ -145,13 +145,13 @@ you can use the same call to `test()` repeatedly in
|
||||
different lines to return different values:
|
||||
|
||||
```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;}
|
||||
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;}
|
||||
#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;}
|
||||
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;}
|
||||
```
|
||||
|
||||
If you enter the above program on punch cards, throw them
|
||||
@@ -200,7 +200,7 @@ by looking at `card.gif`.)
|
||||
For a nice test pattern, try
|
||||
|
||||
```
|
||||
&-0123456789ABCDEFGHIJKLMNOPQR/STUVWXYZ:#@'=".<(+|!$*);,%_>?abcmnoxyz^[]{}\
|
||||
&-0123456789ABCDEFGHIJKLMNOPQR/STUVWXYZ:#@'=".<(+|!$*);,%_>?abcmnoxyz^[]{}\
|
||||
```
|
||||
|
||||
If you want to analyze the program, sorting the lines while
|
||||
@@ -226,9 +226,9 @@ comment), there are technically `28!` different programs, or
|
||||
all legal C.
|
||||
|
||||
```
|
||||
* except in Florida voting machines
|
||||
* except in Florida voting machines
|
||||
|
||||
** all cards must be face down, nine-edge first, of course.
|
||||
** all cards must be face down, nine-edge first, of course.
|
||||
```
|
||||
|
||||
|
||||
|
||||
+31
-32
@@ -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,26 +141,26 @@ 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>
|
||||
<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>
|
||||
<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
|
||||
code</a> below.</p>
|
||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||
<p>The current status of this entry is:</p>
|
||||
<pre><code>STATUS: uses gets() - change to fgets() if possible
|
||||
STATUS: missing files - please provide them
|
||||
STATUS: main() has only one arg - try and make it have 2 or 3</code></pre>
|
||||
<pre><code> STATUS: uses gets() - change to fgets() if possible
|
||||
STATUS: missing files - please provide them
|
||||
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">></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>
|
||||
<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">></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">></span>/dev/null</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">></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"><</span> westley.c <span class="dv">2</span><span class="op">></span>/dev/null</span></code></pre></div>
|
||||
<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a> <span class="ex">./westley</span> <span class="op"><</span> westley.c <span class="dv">2</span><span class="op">></span>/dev/null</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="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>
|
||||
@@ -172,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">'Brian Westley does it again!'</span> <span class="kw">|</span> <span class="ex">./westley.punch</span> <span class="dv">2</span><span class="op">></span>/dev/null</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="bu">echo</span> <span class="st">'Brian Westley does it again!'</span> <span class="kw">|</span> <span class="ex">./westley.punch</span> <span class="dv">2</span><span class="op">></span>/dev/null</span></code></pre></div>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
@@ -196,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">"A"</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">"B"</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">"C"</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> 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">"A"</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">"B"</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">"C"</span><span class="op">);}</span></span></code></pre></div>
|
||||
<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">"Hello, world!"</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>
|
||||
<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">"Hello, world!"</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>
|
||||
<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">"T"</span><span class="op">);</span> <span class="cf">else</span> printf<span class="op">(</span><span class="st">"F"</span><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> 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">"T"</span><span class="op">);</span> <span class="cf">else</span> printf<span class="op">(</span><span class="st">"F"</span><span class="op">);}</span></span></code></pre></div>
|
||||
<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">(&</span>i<span class="op">);</span>b<span class="op">(&</span>i<span class="op">);</span>c<span class="op">(&</span>i<span class="op">);</span>d<span class="op">(&</span>i<span class="op">);</span>printf<span class="op">(</span><span class="st">"</span><span class="sc">%d\n</span><span class="st">"</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>
|
||||
<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">(&</span>i<span class="op">);</span>b<span class="op">(&</span>i<span class="op">);</span>c<span class="op">(&</span>i<span class="op">);</span>d<span class="op">(&</span>i<span class="op">);</span>printf<span class="op">(</span><span class="st">"</span><span class="sc">%d\n</span><span class="st">"</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>
|
||||
<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
|
||||
@@ -265,7 +264,7 @@ Unrecognized characters are punched as a lace column.
|
||||
(You can see an ASCII simulation of the code as punch cards
|
||||
by looking at <code>card.gif</code>.)</p>
|
||||
<p>For a nice test pattern, try</p>
|
||||
<pre><code>&-0123456789ABCDEFGHIJKLMNOPQR/STUVWXYZ:#@'=".<(+|!$*);,%_>?abcmnoxyz^[]{}\</code></pre>
|
||||
<pre><code> &-0123456789ABCDEFGHIJKLMNOPQR/STUVWXYZ:#@'=".<(+|!$*);,%_>?abcmnoxyz^[]{}\</code></pre>
|
||||
<p>If you want to analyze the program, sorting the lines while
|
||||
ignoring leading blanks works best (<code>sort -b</code>). This will
|
||||
produce the version that just reverses the line order, and
|
||||
@@ -284,9 +283,9 @@ actually shorter than the trigraph version of <code>a??(b??)</code>.</p>
|
||||
comment), there are technically <code>28!</code> different programs, or
|
||||
<code>304,888,344,611,713,860,501,504,000,000</code> different versions,
|
||||
all legal C.</p>
|
||||
<pre><code>* except in Florida voting machines
|
||||
<pre><code> * except in Florida voting machines
|
||||
|
||||
** all cards must be face down, nine-edge first, of course.</code></pre>
|
||||
** all cards must be face down, nine-edge first, of course.</code></pre>
|
||||
<!--
|
||||
|
||||
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ make
|
||||
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 [2001 williams bugs](../../bugs.html#2001_williams).
|
||||
@@ -19,7 +19,7 @@ For more detailed information see [2001 williams bugs](../../bugs.html#2001_will
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
./williams
|
||||
./williams
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -132,8 +132,7 @@
|
||||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||||
<ul>
|
||||
<li>Name: <a href="../../authors.html#John_Williams">John Williams</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></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>
|
||||
<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#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>
|
||||
<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>
|
||||
<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
|
||||
|
||||
Reference in new issue
Block a user