improved indentation and whitespace for markdown code blocks

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

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

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

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

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

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

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

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

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

No files matched your search

+33 -34
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make
make
```
There is an alternate version based on the author's remarks. See [alternate
@@ -11,10 +11,9 @@ code](#alternate-code).
## To use:
```sh
./aidan < puzzle
./aidan seed
./aidan < puzzle
./aidan seed
```
where `seed` is a number.
@@ -23,7 +22,7 @@ where `seed` is a number.
## Try:
```sh
./try.sh
./try.sh
```
@@ -36,7 +35,7 @@ which is slower, inelegant and not as obscure, as the author put it.
### Alternate build:
```sh
make alt
make alt
```
@@ -48,7 +47,7 @@ Use `aidan.alt` as you would `aidan` above.
### Alternate try:
```sh
./try.alt.sh
./try.alt.sh
```
@@ -141,14 +140,14 @@ Telegraph](https://www.telegraph.co.uk/), a UK newspaper.
Now, with modern computers this **can** be solved using brute force, e.g.:
```c
#include <stdio.h> /* sudoku-bfi.c */
#define S(t) for(n=0;n<9;v[n++]=0);for(n=0;n<81;n++)if(i[n]){z=1<<i[n];if(v[t]\\
&z)for(;;){if(p<0)goto d;if(i[p]++<9)goto f;i[p]=0;p=s[p];}v[t]|=z;}
int i[82],s[81],v[9],n,p,z;int main(void){for(n=0;n<81;){p=getchar()^48;if(p==
30)p=0;if(p<10)i[n++]=p;}i[81]=0;p=-1;f:S(n%9)S(n/9)S(n%9/3+n/27*3)if(p>80)goto
d;for(n=p;i[++p];);s[p]=n;i[p]=1;goto f;d:z=p<81;printf("\n%s!\n\n",z?"Fail":
"Success");for(n=0;n<81;){p=i[n];printf("%c %s",(p?p|48:'.'),(++n%3?"":n%9?"| "
:n%27?"\n":n%81?"\n------+-------+------\n":"\n\n"));}return z;}
#include <stdio.h> /* sudoku-bfi.c */
#define S(t) for(n=0;n<9;v[n++]=0);for(n=0;n<81;n++)if(i[n]){z=1<<i[n];if(v[t]\\
&z)for(;;){if(p<0)goto d;if(i[p]++<9)goto f;i[p]=0;p=s[p];}v[t]|=z;}
int i[82],s[81],v[9],n,p,z;int main(void){for(n=0;n<81;){p=getchar()^48;if(p==
30)p=0;if(p<10)i[n++]=p;}i[81]=0;p=-1;f:S(n%9)S(n/9)S(n%9/3+n/27*3)if(p>80)goto
d;for(n=p;i[++p];);s[p]=n;i[p]=1;goto f;d:z=p<81;printf("\n%s!\n\n",z?"Fail":
"Success");for(n=0;n<81;){p=i[n];printf("%c %s",(p?p|48:'.'),(++n%3?"":n%9?"| "
:n%27?"\n":n%81?"\n------+-------+------\n":"\n\n"));}return z;}
```
> Judges' note: this was added as [aidan.alt.c](aidan.alt.c).
@@ -163,18 +162,18 @@ Oh, and if you think that example sudoku is too easy, try this one (which my
program generated):
```
--- insane1.sudoku --
. . 4 | . . . | . 5 6
5 . . | . 7 2 | . . .
. . 1 | . . . | 8 . .
------+-------+------
. . . | . . . | . . .
. . . | 6 9 3 | . . 5
. . . | . . . | 7 3 4
------+-------+------
. 5 . | 2 . 1 | 4 . 8
3 . . | . . . | . . .
. . . | . . . | . 6 1
--- insane1.sudoku --
. . 4 | . . . | . 5 6
5 . . | . 7 2 | . . .
. . 1 | . . . | 8 . .
------+-------+------
. . . | . . . | . . .
. . . | 6 9 3 | . . 5
. . . | . . . | 7 3 4
------+-------+------
. 5 . | 2 . 1 | 4 . 8
3 . . | . . . | . . .
. . . | . . . | . 6 1
```
Be warned - it's evil! (I certainly haven't been able to solve it by hand. The
@@ -188,20 +187,20 @@ reasons. That's the worst performance I've had from brute-force so far!)
#### Building
```sh
cc -o sudoku-sf sudoku-sf.c
cc -o sudoku-sf sudoku-sf.c
```
or, if using gcc, try:
```sh
gcc -O2 -Wall -Wextra -ansi -pedantic-errors -o sudoku-sf sudoku-sf.c
gcc -O2 -Wall -Wextra -ansi -pedantic-errors -o sudoku-sf sudoku-sf.c
```
#### Testing (optional)
```sh
perl ./test-su.perl
perl ./test-su.perl
```
Note that this requires Perl 5 (I use 5.8.5, earlier versions untested) and is
@@ -213,7 +212,7 @@ really.
#### Solving
```sh
./aidan < somefile.txt
./aidan < somefile.txt
```
Input should be the numbers of each row in turn. Empty spaces can be
@@ -234,7 +233,7 @@ though slightly slower. See if you can figure out what it does.)
#### Generating
```sh
./sudoku <seed>
./sudoku <seed>
```
Output is a blank grid, then the solution, then the problem. There's no
@@ -294,8 +293,8 @@ least 32. (No, that isn't a typo - I did say 15, not 16).
Also requires that `cpp` can properly handle something like:
```c
#define foo(x,y) x y
foo(bar,)
#define foo(x,y) x y
foo(bar,)
```
Apparently, a few can't (ANSI C specifically doesn't require that this works,
+34 -35
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Aidan_Thornton">Aidan Thornton</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,25 +141,25 @@ 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>There is an alternate version based on the author’s remarks. See <a href="#alternate-code">alternate
code</a>.</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">./aidan</span> <span class="op">&lt;</span> puzzle</span>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./aidan</span> <span class="op">&lt;</span> puzzle</span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./aidan</span> seed</span></code></pre></div>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./aidan</span> seed</span></code></pre></div>
<p>where <code>seed</code> is a number.</p>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>This code is formatted differently and is not the approach used by the author
which is slower, inelegant and not as obscure, as the author put it.</p>
<h3 id="alternate-build">Alternate build:</h3>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>aidan.alt</code> as you would <code>aidan</code> above.</p>
<h3 id="alternate-try">Alternate try:</h3>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.alt.sh</span></span></code></pre></div>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.alt.sh</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Are you puzzled about puzzles? This entry might puzzle you
more while it puzzles out some puzzles: all in a puzzling way!</p>
@@ -224,14 +223,14 @@ figure out how to solve them, but there’s a useful tutorial on
<a href="http://www.sudoku.org.uk/" class="uri">http://www.sudoku.org.uk/</a>, which is roughly affiliated with the <a href="https://www.telegraph.co.uk/">Daily
Telegraph</a>, a UK newspaper.</p>
<p>Now, with modern computers this <strong>can</strong> be solved using brute force, e.g.:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;stdio.h&gt;</span><span class="pp"> </span><span class="co">/* sudoku-bfi.c */</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="pp">#define S</span><span class="op">(</span><span class="pp">t</span><span class="op">)</span><span class="pp"> </span><span class="cf">for</span><span class="op">(</span><span class="pp">n</span><span class="op">=</span><span class="dv">0</span><span class="op">;</span><span class="pp">n</span><span class="op">&lt;</span><span class="dv">9</span><span class="op">;</span><span class="pp">v</span><span class="op">[</span><span class="pp">n</span><span class="op">++]=</span><span class="dv">0</span><span class="op">);</span><span class="cf">for</span><span class="op">(</span><span class="pp">n</span><span class="op">=</span><span class="dv">0</span><span class="op">;</span><span class="pp">n</span><span class="op">&lt;</span><span class="dv">81</span><span class="op">;</span><span class="pp">n</span><span class="op">++)</span><span class="cf">if</span><span class="op">(</span><span class="pp">i</span><span class="op">[</span><span class="pp">n</span><span class="op">]){</span><span class="pp">z</span><span class="op">=</span><span class="dv">1</span><span class="op">&lt;&lt;</span><span class="pp">i</span><span class="op">[</span><span class="pp">n</span><span class="op">];</span><span class="cf">if</span><span class="op">(</span><span class="pp">v</span><span class="op">[</span><span class="pp">t</span><span class="op">]</span><span class="pp">\</span><span class="op">\</span></span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a><span class="op">&amp;</span><span class="pp">z</span><span class="op">)</span><span class="cf">for</span><span class="op">(;;){</span><span class="cf">if</span><span class="op">(</span><span class="pp">p</span><span class="op">&lt;</span><span class="dv">0</span><span class="op">)</span><span class="cf">goto</span><span class="pp"> d</span><span class="op">;</span><span class="cf">if</span><span class="op">(</span><span class="pp">i</span><span class="op">[</span><span class="pp">p</span><span class="op">]++&lt;</span><span class="dv">9</span><span class="op">)</span><span class="cf">goto</span><span class="pp"> f</span><span class="op">;</span><span class="pp">i</span><span class="op">[</span><span class="pp">p</span><span class="op">]=</span><span class="dv">0</span><span class="op">;</span><span class="pp">p</span><span class="op">=</span><span class="pp">s</span><span class="op">[</span><span class="pp">p</span><span class="op">];}</span><span class="pp">v</span><span class="op">[</span><span class="pp">t</span><span class="op">]|=</span><span class="pp">z</span><span class="op">;}</span></span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> i<span class="op">[</span><span class="dv">82</span><span class="op">],</span>s<span class="op">[</span><span class="dv">81</span><span class="op">],</span>v<span class="op">[</span><span class="dv">9</span><span class="op">],</span>n<span class="op">,</span>p<span class="op">,</span>z<span class="op">;</span><span class="dt">int</span> main<span class="op">(</span><span class="dt">void</span><span class="op">){</span><span class="cf">for</span><span class="op">(</span>n<span class="op">=</span><span class="dv">0</span><span class="op">;</span>n<span class="op">&lt;</span><span class="dv">81</span><span class="op">;){</span>p<span class="op">=</span>getchar<span class="op">()^</span><span class="dv">48</span><span class="op">;</span><span class="cf">if</span><span class="op">(</span>p<span class="op">==</span></span>
<span id="cb7-5"><a href="#cb7-5" aria-hidden="true" tabindex="-1"></a><span class="dv">30</span><span class="op">)</span>p<span class="op">=</span><span class="dv">0</span><span class="op">;</span><span class="cf">if</span><span class="op">(</span>p<span class="op">&lt;</span><span class="dv">10</span><span class="op">)</span>i<span class="op">[</span>n<span class="op">++]=</span>p<span class="op">;}</span>i<span class="op">[</span><span class="dv">81</span><span class="op">]=</span><span class="dv">0</span><span class="op">;</span>p<span class="op">=-</span><span class="dv">1</span><span class="op">;</span>f<span class="op">:</span>S<span class="op">(</span>n<span class="op">%</span><span class="dv">9</span><span class="op">)</span>S<span class="op">(</span>n<span class="op">/</span><span class="dv">9</span><span class="op">)</span>S<span class="op">(</span>n<span class="op">%</span><span class="dv">9</span><span class="op">/</span><span class="dv">3</span><span class="op">+</span>n<span class="op">/</span><span class="dv">27</span><span class="op">*</span><span class="dv">3</span><span class="op">)</span><span class="cf">if</span><span class="op">(</span>p<span class="op">&gt;</span><span class="dv">80</span><span class="op">)</span><span class="cf">goto</span></span>
<span id="cb7-6"><a href="#cb7-6" aria-hidden="true" tabindex="-1"></a>d<span class="op">;</span><span class="cf">for</span><span class="op">(</span>n<span class="op">=</span>p<span class="op">;</span>i<span class="op">[++</span>p<span class="op">];);</span>s<span class="op">[</span>p<span class="op">]=</span>n<span class="op">;</span>i<span class="op">[</span>p<span class="op">]=</span><span class="dv">1</span><span class="op">;</span><span class="cf">goto</span> f<span class="op">;</span>d<span class="op">:</span>z<span class="op">=</span>p<span class="op">&lt;</span><span class="dv">81</span><span class="op">;</span>printf<span class="op">(</span><span class="st">&quot;</span><span class="sc">\n%s</span><span class="st">!</span><span class="sc">\n\n</span><span class="st">&quot;</span><span class="op">,</span>z<span class="op">?</span><span class="st">&quot;Fail&quot;</span><span class="op">:</span></span>
<span id="cb7-7"><a href="#cb7-7" aria-hidden="true" tabindex="-1"></a><span class="st">&quot;Success&quot;</span><span class="op">);</span><span class="cf">for</span><span class="op">(</span>n<span class="op">=</span><span class="dv">0</span><span class="op">;</span>n<span class="op">&lt;</span><span class="dv">81</span><span class="op">;){</span>p<span class="op">=</span>i<span class="op">[</span>n<span class="op">];</span>printf<span class="op">(</span><span class="st">&quot;</span><span class="sc">%c</span><span class="st"> </span><span class="sc">%s</span><span class="st">&quot;</span><span class="op">,(</span>p<span class="op">?</span>p<span class="op">|</span><span class="dv">48</span><span class="op">:</span><span class="ch">&#39;.&#39;</span><span class="op">),(++</span>n<span class="op">%</span><span class="dv">3</span><span class="op">?</span><span class="st">&quot;&quot;</span><span class="op">:</span>n<span class="op">%</span><span class="dv">9</span><span class="op">?</span><span class="st">&quot;| &quot;</span></span>
<span id="cb7-8"><a href="#cb7-8" aria-hidden="true" tabindex="-1"></a><span class="op">:</span>n<span class="op">%</span><span class="dv">27</span><span class="op">?</span><span class="st">&quot;</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">:</span>n<span class="op">%</span><span class="dv">81</span><span class="op">?</span><span class="st">&quot;</span><span class="sc">\n</span><span class="st">------+-------+------</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">:</span><span class="st">&quot;</span><span class="sc">\n\n</span><span class="st">&quot;</span><span class="op">));}</span><span class="cf">return</span> z<span class="op">;}</span></span></code></pre></div>
<div class="sourceCode" id="cb7"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a> <span class="pp">#include </span><span class="im">&lt;stdio.h&gt;</span><span class="pp"> </span><span class="co">/* sudoku-bfi.c */</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define S</span><span class="op">(</span><span class="pp">t</span><span class="op">)</span><span class="pp"> </span><span class="cf">for</span><span class="op">(</span><span class="pp">n</span><span class="op">=</span><span class="dv">0</span><span class="op">;</span><span class="pp">n</span><span class="op">&lt;</span><span class="dv">9</span><span class="op">;</span><span class="pp">v</span><span class="op">[</span><span class="pp">n</span><span class="op">++]=</span><span class="dv">0</span><span class="op">);</span><span class="cf">for</span><span class="op">(</span><span class="pp">n</span><span class="op">=</span><span class="dv">0</span><span class="op">;</span><span class="pp">n</span><span class="op">&lt;</span><span class="dv">81</span><span class="op">;</span><span class="pp">n</span><span class="op">++)</span><span class="cf">if</span><span class="op">(</span><span class="pp">i</span><span class="op">[</span><span class="pp">n</span><span class="op">]){</span><span class="pp">z</span><span class="op">=</span><span class="dv">1</span><span class="op">&lt;&lt;</span><span class="pp">i</span><span class="op">[</span><span class="pp">n</span><span class="op">];</span><span class="cf">if</span><span class="op">(</span><span class="pp">v</span><span class="op">[</span><span class="pp">t</span><span class="op">]</span><span class="pp">\</span><span class="op">\</span></span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a><span class="pp"> </span><span class="op">&amp;</span><span class="pp">z</span><span class="op">)</span><span class="cf">for</span><span class="op">(;;){</span><span class="cf">if</span><span class="op">(</span><span class="pp">p</span><span class="op">&lt;</span><span class="dv">0</span><span class="op">)</span><span class="cf">goto</span><span class="pp"> d</span><span class="op">;</span><span class="cf">if</span><span class="op">(</span><span class="pp">i</span><span class="op">[</span><span class="pp">p</span><span class="op">]++&lt;</span><span class="dv">9</span><span class="op">)</span><span class="cf">goto</span><span class="pp"> f</span><span class="op">;</span><span class="pp">i</span><span class="op">[</span><span class="pp">p</span><span class="op">]=</span><span class="dv">0</span><span class="op">;</span><span class="pp">p</span><span class="op">=</span><span class="pp">s</span><span class="op">[</span><span class="pp">p</span><span class="op">];}</span><span class="pp">v</span><span class="op">[</span><span class="pp">t</span><span class="op">]|=</span><span class="pp">z</span><span class="op">;}</span></span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a> <span class="dt">int</span> i<span class="op">[</span><span class="dv">82</span><span class="op">],</span>s<span class="op">[</span><span class="dv">81</span><span class="op">],</span>v<span class="op">[</span><span class="dv">9</span><span class="op">],</span>n<span class="op">,</span>p<span class="op">,</span>z<span class="op">;</span><span class="dt">int</span> main<span class="op">(</span><span class="dt">void</span><span class="op">){</span><span class="cf">for</span><span class="op">(</span>n<span class="op">=</span><span class="dv">0</span><span class="op">;</span>n<span class="op">&lt;</span><span class="dv">81</span><span class="op">;){</span>p<span class="op">=</span>getchar<span class="op">()^</span><span class="dv">48</span><span class="op">;</span><span class="cf">if</span><span class="op">(</span>p<span class="op">==</span></span>
<span id="cb7-5"><a href="#cb7-5" aria-hidden="true" tabindex="-1"></a> <span class="dv">30</span><span class="op">)</span>p<span class="op">=</span><span class="dv">0</span><span class="op">;</span><span class="cf">if</span><span class="op">(</span>p<span class="op">&lt;</span><span class="dv">10</span><span class="op">)</span>i<span class="op">[</span>n<span class="op">++]=</span>p<span class="op">;}</span>i<span class="op">[</span><span class="dv">81</span><span class="op">]=</span><span class="dv">0</span><span class="op">;</span>p<span class="op">=-</span><span class="dv">1</span><span class="op">;</span>f<span class="op">:</span>S<span class="op">(</span>n<span class="op">%</span><span class="dv">9</span><span class="op">)</span>S<span class="op">(</span>n<span class="op">/</span><span class="dv">9</span><span class="op">)</span>S<span class="op">(</span>n<span class="op">%</span><span class="dv">9</span><span class="op">/</span><span class="dv">3</span><span class="op">+</span>n<span class="op">/</span><span class="dv">27</span><span class="op">*</span><span class="dv">3</span><span class="op">)</span><span class="cf">if</span><span class="op">(</span>p<span class="op">&gt;</span><span class="dv">80</span><span class="op">)</span><span class="cf">goto</span></span>
<span id="cb7-6"><a href="#cb7-6" aria-hidden="true" tabindex="-1"></a> d<span class="op">;</span><span class="cf">for</span><span class="op">(</span>n<span class="op">=</span>p<span class="op">;</span>i<span class="op">[++</span>p<span class="op">];);</span>s<span class="op">[</span>p<span class="op">]=</span>n<span class="op">;</span>i<span class="op">[</span>p<span class="op">]=</span><span class="dv">1</span><span class="op">;</span><span class="cf">goto</span> f<span class="op">;</span>d<span class="op">:</span>z<span class="op">=</span>p<span class="op">&lt;</span><span class="dv">81</span><span class="op">;</span>printf<span class="op">(</span><span class="st">&quot;</span><span class="sc">\n%s</span><span class="st">!</span><span class="sc">\n\n</span><span class="st">&quot;</span><span class="op">,</span>z<span class="op">?</span><span class="st">&quot;Fail&quot;</span><span class="op">:</span></span>
<span id="cb7-7"><a href="#cb7-7" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;Success&quot;</span><span class="op">);</span><span class="cf">for</span><span class="op">(</span>n<span class="op">=</span><span class="dv">0</span><span class="op">;</span>n<span class="op">&lt;</span><span class="dv">81</span><span class="op">;){</span>p<span class="op">=</span>i<span class="op">[</span>n<span class="op">];</span>printf<span class="op">(</span><span class="st">&quot;</span><span class="sc">%c</span><span class="st"> </span><span class="sc">%s</span><span class="st">&quot;</span><span class="op">,(</span>p<span class="op">?</span>p<span class="op">|</span><span class="dv">48</span><span class="op">:</span><span class="ch">&#39;.&#39;</span><span class="op">),(++</span>n<span class="op">%</span><span class="dv">3</span><span class="op">?</span><span class="st">&quot;&quot;</span><span class="op">:</span>n<span class="op">%</span><span class="dv">9</span><span class="op">?</span><span class="st">&quot;| &quot;</span></span>
<span id="cb7-8"><a href="#cb7-8" aria-hidden="true" tabindex="-1"></a> <span class="op">:</span>n<span class="op">%</span><span class="dv">27</span><span class="op">?</span><span class="st">&quot;</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">:</span>n<span class="op">%</span><span class="dv">81</span><span class="op">?</span><span class="st">&quot;</span><span class="sc">\n</span><span class="st">------+-------+------</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">:</span><span class="st">&quot;</span><span class="sc">\n\n</span><span class="st">&quot;</span><span class="op">));}</span><span class="cf">return</span> z<span class="op">;}</span></span></code></pre></div>
<blockquote>
<p>Judges’ note: this was added as <a href="aidan.alt.c">aidan.alt.c</a>.</p>
</blockquote>
@@ -242,35 +241,35 @@ program which solves them in much the same way as I do, only a lot faster (and
hopefully more reliably).</p>
<p>Oh, and if you think that example sudoku is too easy, try this one (which my
program generated):</p>
<pre><code>--- insane1.sudoku --
. . 4 | . . . | . 5 6
5 . . | . 7 2 | . . .
. . 1 | . . . | 8 . .
------+-------+------
. . . | . . . | . . .
. . . | 6 9 3 | . . 5
. . . | . . . | 7 3 4
------+-------+------
. 5 . | 2 . 1 | 4 . 8
3 . . | . . . | . . .
. . . | . . . | . 6 1</code></pre>
<pre><code> --- insane1.sudoku --
. . 4 | . . . | . 5 6
5 . . | . 7 2 | . . .
. . 1 | . . . | 8 . .
------+-------+------
. . . | . . . | . . .
. . . | 6 9 3 | . . 5
. . . | . . . | 7 3 4
------+-------+------
. 5 . | 2 . 1 | 4 . 8
3 . . | . . . | . . .
. . . | . . . | . 6 1</code></pre>
<p>Be warned - it’s evil! (I certainly haven’t been able to solve it by hand. The
brute-force program given above, <code>sudoku-bfi.c</code> (<a href="aidan.alt.c">aidan.alt.c</a>),
also has trouble - it took 66 seconds to solve it - but probably for different
reasons. That’s the worst performance I’ve had from brute-force so far!)</p>
<h3 id="usage">Usage</h3>
<h4 id="building">Building</h4>
<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="fu">cc</span> <span class="at">-o</span> sudoku-sf sudoku-sf.c</span></code></pre></div>
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">cc</span> <span class="at">-o</span> sudoku-sf sudoku-sf.c</span></code></pre></div>
<p>or, if using gcc, try:</p>
<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">gcc</span> <span class="at">-O2</span> <span class="at">-Wall</span> <span class="at">-Wextra</span> <span class="at">-ansi</span> <span class="at">-pedantic-errors</span> <span class="at">-o</span> sudoku-sf sudoku-sf.c</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">gcc</span> <span class="at">-O2</span> <span class="at">-Wall</span> <span class="at">-Wextra</span> <span class="at">-ansi</span> <span class="at">-pedantic-errors</span> <span class="at">-o</span> sudoku-sf sudoku-sf.c</span></code></pre></div>
<h4 id="testing-optional">Testing (optional)</h4>
<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="fu">perl</span> ./test-su.perl</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="fu">perl</span> ./test-su.perl</span></code></pre></div>
<p>Note that this requires Perl 5 (I use 5.8.5, earlier versions untested) and is
somewhat slow (should take under a minute on a fairly modern PC - try
appending <code>-n 0</code> if you’re in a hurry). I wrote it mostly for my own benefit,
really.</p>
<h4 id="solving">Solving</h4>
<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">./aidan</span> <span class="op">&lt;</span> somefile.txt</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">./aidan</span> <span class="op">&lt;</span> somefile.txt</span></code></pre></div>
<p>Input should be the numbers of each row in turn. Empty spaces can be
represented as a full stop (<code>.</code>) or zero (<code>0</code>). Other characters are ignored, so you
can cut-and-paste either example sudoku puzzle from above into a file and feed that
@@ -283,7 +282,7 @@ an extra 15 bytes of (very simple) code to add, so it doesn’t really matter to
me. (It’s the same as the normal mode for most input you’re likely to feed it,
though slightly slower. See if you can figure out what it does.)</p>
<h4 id="generating">Generating</h4>
<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">./sudoku</span> <span class="op">&lt;</span>seed<span class="op">&gt;</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">./sudoku</span> <span class="op">&lt;</span>seed<span class="op">&gt;</span></span></code></pre></div>
<p>Output is a blank grid, then the solution, then the problem. There’s no
control over the difficulty. Sorry. However, all generated sudokus should have
exactly one solution - if one doesn’t, that’s a bug.</p>
@@ -322,8 +321,8 @@ can’t help you figure out where the mistake is, sadly.</p></li>
<p>Dependant on ASCII, requires that an <code>int</code> is at least 15 bits and a <code>long</code> at
least 32. (No, that isn’t a typo - I did say 15, not 16).</p>
<p>Also requires that <code>cpp</code> can properly handle something like:</p>
<div class="sourceCode" id="cb14"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#define foo</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"> x y</span></span>
<span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a>foo<span class="op">(</span>bar<span class="op">,)</span></span></code></pre></div>
<div class="sourceCode" id="cb14"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define foo</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"> x y</span></span>
<span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a> foo<span class="op">(</span>bar<span class="op">,)</span></span></code></pre></div>
<p>Apparently, a few can’t (ANSI C specifically doesn’t require that this works,
though it usually does). Unfortunately, I didn’t discover this issue until too
late. (It was mentioned in the notes for people modifying GCC in the “beware
+74 -74
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make
make
```
NOTE: there is an alternate version for vi(m) like movements. See [alternate
@@ -9,7 +9,7 @@ version](#alternate-code) below. If your terminal has problems with the
`stty(1)` commands try:
```sh
make anon-no_stty
make anon-no_stty
```
This will compile [anon.c](anon.c) as `anon` to not use `stty(1)`.
@@ -20,7 +20,7 @@ This will compile [anon.c](anon.c) as `anon` to not use `stty(1)`.
The current status of this entry is:
```
STATUS: INABIAF - please **DO NOT** fix
STATUS: INABIAF - please **DO NOT** fix
```
For more detailed information see [2005 anon bugs](../../bugs.html#2005_anon).
@@ -29,16 +29,16 @@ For more detailed information see [2005 anon bugs](../../bugs.html#2005_anon).
## To use:
```sh
./anon x y [z]
./anon x y [z]
```
## Try:
```sh
./anon 4 4
./anon 4 4
./anon 3 3 3
./anon 3 3 3
```
After a very large number of moves this program will deliberately force itself
@@ -49,13 +49,13 @@ hook you) and spending too much time playing. :-)
If you want to see this in action you can easily do this:
```sh
yes 'please crash on me :-)' | ./anon 4 4
yes 'please crash on me :-)' | ./anon 4 4
```
What happens if you specify a larger board? For instance:
```sh
yes 'please crash on me :-)' | ./anon 10 10 10
yes 'please crash on me :-)' | ./anon 10 10 10
```
If you specify more than three args the program might also crash or do
@@ -71,13 +71,13 @@ The alternate version uses `vi(m)` like movement keys.
### Alternate build:
```sh
make alt
make alt
```
To compile the version without `stty(1)`:
```sh
make alt-no_stty
make alt-no_stty
```
@@ -86,12 +86,12 @@ make alt-no_stty
Use `anon.alt` as you would `anon` with the change in movements:
```
k | Move empty spot up
h | Move empty spot left
j | Move empty spot down
l | Move empty spot right
J | Move empty spot forwards
K | Move empty spot backwards
k | Move empty spot up
h | Move empty spot left
j | Move empty spot down
l | Move empty spot right
J | Move empty spot forwards
K | Move empty spot backwards
```
@@ -122,13 +122,13 @@ The program takes 2 or 3 arguments, specifying the dimensions of the board.
For example, to play the original version of the Fifteen Puzzle:
```sh
./anon 4 4
./anon 4 4
```
To play with a 3D board, do something like this:
```sh
./anon 3 3 3
./anon 3 3 3
```
**WARNING: do NOT run the program with more than 3 command-line arguments.
@@ -145,18 +145,18 @@ characters instead of digits. To slide the tiles around, use the following
keys:
```
i | Slide the tile above the current empty space downwards.
j | Slide the tile to the left of the current empty space to the right.
k | Slide the tile below the current empty space upwards.
l | Slide the tile to the right of the current empty space to the left.
o | Slide the tile behind the current empty space forwards.
n | Slide the tile in front of the current empty space backwards.
i | Slide the tile above the current empty space downwards.
j | Slide the tile to the left of the current empty space to the right.
k | Slide the tile below the current empty space upwards.
l | Slide the tile to the right of the current empty space to the left.
o | Slide the tile behind the current empty space forwards.
n | Slide the tile in front of the current empty space backwards.
```
To quit the game:
```
q | Quit the game.
q | Quit the game.
```
Note that, for example, sliding the tile above the current empty spot
@@ -165,12 +165,12 @@ the current empty spot was. Hence, you could think of the movement keys in
terms of how they effectively "move" the empty spot:
```
i | Move empty spot up
j | Move empty spot left
k | Move empty spot down
l | Move empty spot right
n | Move empty spot forwards
o | Move empty spot backwards
i | Move empty spot up
j | Move empty spot left
k | Move empty spot down
l | Move empty spot right
n | Move empty spot forwards
o | Move empty spot backwards
```
**NOTE:** as a measure of alleviating counter-productivity due to addiction to
@@ -378,7 +378,7 @@ stored in a well-known location in the `MASS`.
`if(p,q,r,s)` is, in fact, an `if` statement. :-) It is equivalent to:
```c
if (p) { q; r } else {s}
if (p) { q; r } else {s}
```
Why are `q` and `r` split up? Because it's cleaner (in whatever twisted sense of
@@ -405,18 +405,18 @@ variable); `x` and `y-1` define the starting and ending values of `i`, and `z`
is the loop body. `Z` is the post-loop code in the current state. For example:
```c
for(s,i, 0, 10,
some_code ,
other_code)
for(s,i, 0, 10,
some_code ,
other_code)
```
is equivalent to:
```c
for (i=0; i&lt;10; i++) {
some_code;
}
other_code;
for (i=0; i&lt;10; i++) {
some_code;
}
other_code;
```
Note the "wrong" indentation in the former: the author prefers to write it
@@ -444,25 +444,25 @@ program, and what the various state numbers are meant to do:
#### MASS usage map
```
0 | Function return value
1 | Function argument 1
2 | Function argument 2
3 | Function argument 3
4 | Scratch register 1
5 | Scratch register 2
6 | Scratch register 3
7 | Scratch register 4
8 | Value of original argv :-)
9 | Value of original argc :-)
11 | Zero register (always set to 0)
12 | Width of board
13 | Length of board
14 | Height of board
15 | Current position of hole
16 | Random seed for rand_r(3)
18 | Scratch register used by state 18 :-)
31 | field width for printing tiles
32 | Start of board data
0 | Function return value
1 | Function argument 1
2 | Function argument 2
3 | Function argument 3
4 | Scratch register 1
5 | Scratch register 2
6 | Scratch register 3
7 | Scratch register 4
8 | Value of original argv :-)
9 | Value of original argc :-)
11 | Zero register (always set to 0)
12 | Width of board
13 | Length of board
14 | Height of board
15 | Current position of hole
16 | Random seed for rand_r(3)
18 | Scratch register used by state 18 :-)
31 | field width for printing tiles
32 | Start of board data
```
(**CAVEAT:** not all of these mappings ended up in the final version of the
@@ -478,22 +478,22 @@ to be on all tested architectures.)
#### State number assignments
```
1 | showhelp
2 | showhelp
3 | is 2D: start init
4 | is 3D: start init
5 | find allocation type
6 | MASS init, bottom-up
7 | MASS init, top-down
8 | main program
9 | generate() outer loop
13 | render()
14 | render() loop
15 | exit(0)
16 | pick a tile that hasn't occurred yet
17 | inner loop of 16.
18 | main loop
19 | checkwin() loop
1 | showhelp
2 | showhelp
3 | is 2D: start init
4 | is 3D: start init
5 | find allocation type
6 | MASS init, bottom-up
7 | MASS init, top-down
8 | main program
9 | generate() outer loop
13 | render()
14 | render() loop
15 | exit(0)
16 | pick a tile that hasn't occurred yet
17 | inner loop of 16.
18 | main loop
19 | checkwin() loop
```
Note that some of the manually-implemented states (those not implemented by
+75 -76
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Anonymous_2005">Anonymous 2005</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,47 +141,47 @@ 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>NOTE: there is an alternate version for vi(m) like movements. See <a href="#alternate-code">alternate
version</a> below. If your terminal has problems with the
<code>stty(1)</code> commands try:</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> anon-no_stty</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="fu">make</span> anon-no_stty</span></code></pre></div>
<p>This will compile <a href="anon.c">anon.c</a> as <code>anon</code> to not use <code>stty(1)</code>.</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#2005_anon">2005 anon bugs</a>.</p>
<h2 id="to-use">To use:</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">./anon</span> x y <span class="pp">[</span><span class="ss">z</span><span class="pp">]</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">./anon</span> x y <span class="pp">[</span><span class="ss">z</span><span class="pp">]</span></span></code></pre></div>
<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">./anon</span> 4 4</span>
<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">./anon</span> 4 4</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./anon</span> 3 3 3</span></code></pre></div>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./anon</span> 3 3 3</span></code></pre></div>
<p>After a very large number of moves this program will deliberately force itself
to destroy its runtime stack. This is the author’s way to prevent you from being
frustrated (which might happen as it likes to create unsolvable puzzles just to
hook you) and spending too much time playing. :-)</p>
<p>If you want to see this in action you can easily do this:</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">yes</span> <span class="st">&#39;please crash on me :-)&#39;</span> <span class="kw">|</span> <span class="ex">./anon</span> 4 4</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">yes</span> <span class="st">&#39;please crash on me :-)&#39;</span> <span class="kw">|</span> <span class="ex">./anon</span> 4 4</span></code></pre></div>
<p>What happens if you specify a larger board? For instance:</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">yes</span> <span class="st">&#39;please crash on me :-)&#39;</span> <span class="kw">|</span> <span class="ex">./anon</span> 10 10 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="fu">yes</span> <span class="st">&#39;please crash on me :-)&#39;</span> <span class="kw">|</span> <span class="ex">./anon</span> 10 10 10</span></code></pre></div>
<p>If you specify more than three args the program might also crash or do
something strange. This might also happen if you specify excessively large board
dimensions. Try <code>100 100 100</code> for instance and see what happens!</p>
<h2 id="alternate-version">Alternate version:</h2>
<p>The alternate version uses <code>vi(m)</code> like movement keys.</p>
<h3 id="alternate-build">Alternate build:</h3>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> alt</span></code></pre></div>
<p>To compile the version without <code>stty(1)</code>:</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="fu">make</span> alt-no_stty</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="fu">make</span> alt-no_stty</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>anon.alt</code> as you would <code>anon</code> with the change in movements:</p>
<pre><code>k | Move empty spot up
h | Move empty spot left
j | Move empty spot down
l | Move empty spot right
J | Move empty spot forwards
K | Move empty spot backwards</code></pre>
<pre><code> k | Move empty spot up
h | Move empty spot left
j | Move empty spot down
l | Move empty spot right
J | Move empty spot forwards
K | Move empty spot backwards</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Taking the 4x4 board with 15 tiles to a whole new level, this entry takes this
puzzle to a whole new dimension! While you puzzle out this puzzle, we invite
@@ -201,9 +200,9 @@ spaces on the board, and the goal is to rearrange them so that they appear
sorted in the order they appear on the screen.</p>
<p>The program takes 2 or 3 arguments, specifying the dimensions of the board.
For example, to play the original version of the Fifteen Puzzle:</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">./anon</span> 4 4</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">./anon</span> 4 4</span></code></pre></div>
<p>To play with a 3D board, do something like this:</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">./anon</span> 3 3 3</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">./anon</span> 3 3 3</span></code></pre></div>
<p><strong>WARNING: do NOT run the program with more than 3 command-line arguments.
This will trigger a bug that will cause it to crash or do something strange.
:-)</strong></p>
@@ -214,24 +213,24 @@ dimensions. :-) (10x10x10 is considered a safe upper limit.)</p>
<p>The empty space on the board is represented by a space filled with <code>#</code>
characters instead of digits. To slide the tiles around, use the following
keys:</p>
<pre><code>i | Slide the tile above the current empty space downwards.
j | Slide the tile to the left of the current empty space to the right.
k | Slide the tile below the current empty space upwards.
l | Slide the tile to the right of the current empty space to the left.
o | Slide the tile behind the current empty space forwards.
n | Slide the tile in front of the current empty space backwards.</code></pre>
<pre><code> i | Slide the tile above the current empty space downwards.
j | Slide the tile to the left of the current empty space to the right.
k | Slide the tile below the current empty space upwards.
l | Slide the tile to the right of the current empty space to the left.
o | Slide the tile behind the current empty space forwards.
n | Slide the tile in front of the current empty space backwards.</code></pre>
<p>To quit the game:</p>
<pre><code>q | Quit the game.</code></pre>
<pre><code> q | Quit the game.</code></pre>
<p>Note that, for example, sliding the tile above the current empty spot
downwards will fill up the empty spot, and create a new empty spot above where
the current empty spot was. Hence, you could think of the movement keys in
terms of how they effectively “move” the empty spot:</p>
<pre><code>i | Move empty spot up
j | Move empty spot left
k | Move empty spot down
l | Move empty spot right
n | Move empty spot forwards
o | Move empty spot backwards</code></pre>
<pre><code> i | Move empty spot up
j | Move empty spot left
k | Move empty spot down
l | Move empty spot right
n | Move empty spot forwards
o | Move empty spot backwards</code></pre>
<p><strong>NOTE:</strong> as a measure of alleviating counter-productivity due to addiction to
this game, particularly for those hardcore gamers who insist on solving a
10x10x10 puzzle during work hours, and also to give an upper bound to user
@@ -395,7 +394,7 @@ allocation. It’s the only state that needs to return a value from the boolean
expression, since once the <code>MASS</code> is initialized any return value can simply be
stored in a well-known location in the <code>MASS</code>.</p>
<p><code>if(p,q,r,s)</code> is, in fact, an <code>if</code> statement. :-) It is equivalent to:</p>
<div class="sourceCode" id="cb16"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="op">(</span>p<span class="op">)</span> <span class="op">{</span> q<span class="op">;</span> r <span class="op">}</span> <span class="cf">else</span> <span class="op">{</span>s<span class="op">}</span></span></code></pre></div>
<div class="sourceCode" id="cb16"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span>p<span class="op">)</span> <span class="op">{</span> q<span class="op">;</span> r <span class="op">}</span> <span class="cf">else</span> <span class="op">{</span>s<span class="op">}</span></span></code></pre></div>
<p>Why are <code>q</code> and <code>r</code> split up? Because it’s cleaner (in whatever twisted sense of
the word that can be applied to an IOCCC entry) to implement using boolean
expressions. Keep in mind that all statements are assumed to evaluate to
@@ -416,14 +415,14 @@ closes the current state and opens a new one behind the programmer’s back.
<code>i</code> is the index variable (well, the index into the <code>MASS</code> of the index
variable); <code>x</code> and <code>y-1</code> define the starting and ending values of <code>i</code>, and <code>z</code>
is the loop body. <code>Z</code> is the post-loop code in the current state. For example:</p>
<div class="sourceCode" id="cb17"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span><span class="op">(</span>s<span class="op">,</span>i<span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">10</span><span class="op">,</span></span>
<span id="cb17-2"><a href="#cb17-2" aria-hidden="true" tabindex="-1"></a>some_code <span class="op">,</span></span>
<span id="cb17-3"><a href="#cb17-3" aria-hidden="true" tabindex="-1"></a>other_code<span class="op">)</span></span></code></pre></div>
<div class="sourceCode" id="cb17"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span><span class="op">(</span>s<span class="op">,</span>i<span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">10</span><span class="op">,</span></span>
<span id="cb17-2"><a href="#cb17-2" aria-hidden="true" tabindex="-1"></a> some_code <span class="op">,</span></span>
<span id="cb17-3"><a href="#cb17-3" aria-hidden="true" tabindex="-1"></a> other_code<span class="op">)</span></span></code></pre></div>
<p>is equivalent to:</p>
<div class="sourceCode" id="cb18"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> <span class="op">(</span>i<span class="op">=</span><span class="dv">0</span><span class="op">;</span> i<span class="op">&amp;</span>lt<span class="op">;</span><span class="dv">10</span><span class="op">;</span> i<span class="op">++)</span> <span class="op">{</span></span>
<span id="cb18-2"><a href="#cb18-2" aria-hidden="true" tabindex="-1"></a> some_code<span class="op">;</span></span>
<span id="cb18-3"><a href="#cb18-3" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span>
<span id="cb18-4"><a href="#cb18-4" aria-hidden="true" tabindex="-1"></a>other_code<span class="op">;</span></span></code></pre></div>
<div class="sourceCode" id="cb18"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span> <span class="op">(</span>i<span class="op">=</span><span class="dv">0</span><span class="op">;</span> i<span class="op">&amp;</span>lt<span class="op">;</span><span class="dv">10</span><span class="op">;</span> i<span class="op">++)</span> <span class="op">{</span></span>
<span id="cb18-2"><a href="#cb18-2" aria-hidden="true" tabindex="-1"></a> some_code<span class="op">;</span></span>
<span id="cb18-3"><a href="#cb18-3" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span>
<span id="cb18-4"><a href="#cb18-4" aria-hidden="true" tabindex="-1"></a> other_code<span class="op">;</span></span></code></pre></div>
<p>Note the “wrong” indentation in the former: the author prefers to write it
that way, since the analogy to the usual <code>for</code> loop is clearer. This is why it’s
easier to understand the pre-CPP code, since after CPP, the macro reshuffles
@@ -444,25 +443,25 @@ key press. What could be more fun than to define such a case in terms of a
are the mappings of various locations of the <code>MASS</code> to their usage in the
program, and what the various state numbers are meant to do:</p>
<h4 id="mass-usage-map">MASS usage map</h4>
<pre><code>0 | Function return value
1 | Function argument 1
2 | Function argument 2
3 | Function argument 3
4 | Scratch register 1
5 | Scratch register 2
6 | Scratch register 3
7 | Scratch register 4
8 | Value of original argv :-)
9 | Value of original argc :-)
11 | Zero register (always set to 0)
12 | Width of board
13 | Length of board
14 | Height of board
15 | Current position of hole
16 | Random seed for rand_r(3)
18 | Scratch register used by state 18 :-)
31 | field width for printing tiles
32 | Start of board data</code></pre>
<pre><code> 0 | Function return value
1 | Function argument 1
2 | Function argument 2
3 | Function argument 3
4 | Scratch register 1
5 | Scratch register 2
6 | Scratch register 3
7 | Scratch register 4
8 | Value of original argv :-)
9 | Value of original argc :-)
11 | Zero register (always set to 0)
12 | Width of board
13 | Length of board
14 | Height of board
15 | Current position of hole
16 | Random seed for rand_r(3)
18 | Scratch register used by state 18 :-)
31 | field width for printing tiles
32 | Start of board data</code></pre>
<p>(<strong>CAVEAT:</strong> not all of these mappings ended up in the final version of the
program, mainly due to size limitations which entailed the trimming off of a
lot of neat features in the game. It is left as an exercise for the reader to
@@ -472,22 +471,22 @@ the <code>MASS</code>, because otherwise they may overwrite their original value
memory allocation code saves them. Index 8 is deemed “safe enough”. (It seems
to be on all tested architectures.)</p>
<h4 id="state-number-assignments">State number assignments</h4>
<pre><code>1 | showhelp
2 | showhelp
3 | is 2D: start init
4 | is 3D: start init
5 | find allocation type
6 | MASS init, bottom-up
7 | MASS init, top-down
8 | main program
9 | generate() outer loop
13 | render()
14 | render() loop
15 | exit(0)
16 | pick a tile that hasn&#39;t occurred yet
17 | inner loop of 16.
18 | main loop
19 | checkwin() loop</code></pre>
<pre><code> 1 | showhelp
2 | showhelp
3 | is 2D: start init
4 | is 3D: start init
5 | find allocation type
6 | MASS init, bottom-up
7 | MASS init, top-down
8 | main program
9 | generate() outer loop
13 | render()
14 | render() loop
15 | exit(0)
16 | pick a tile that hasn&#39;t occurred yet
17 | inner loop of 16.
18 | main loop
19 | checkwin() loop</code></pre>
<p>Note that some of the manually-implemented states (those not implemented by
<code>do()</code>) respond to multiple state numbers. Also note that states 1-4
conveniently correspond to what the program should do when 1-4 arguments are
+10 -10
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make
make
```
@@ -16,20 +16,20 @@ Look here to find some [SVG Viewer
Implementations](https://www.w3.org/Graphics/SVG/WG/wiki/Implementations).
```sh
./boutines < input > output.svg
./boutines < input > output.svg
```
## Try:
```sh
./try.sh
./try.sh
```
If `ruby` is installed [try.sh](try.sh) will generate an SVG file by:
```sh
ruby -e '20.times{puts "#{rand} #{rand}"}' | ./boutines > test.svg
ruby -e '20.times{puts "#{rand} #{rand}"}' | ./boutines > test.svg
```
It will also create an SVG file with the file [input.txt](input.txt).
@@ -76,7 +76,7 @@ an [SVG](https://www.w3.org/TR/SVG11/expanded-toc.html) stream.
This will possibly save a compressed SVG file and may be useful:
```sh
./boutines | gzip > result.svg.gz
./boutines | gzip > result.svg.gz
```
Input consists of a list of floating points values separated by whitespaces
@@ -85,11 +85,11 @@ whitespace then the other coordinate (pointing downwards in the resulting
graph) and a newline will just go fine:
```
0 0
0 1
1 0
1 1
.5 .5
0 0
0 1
1 0
1 1
.5 .5
```
Strictly speaking, you have to provide a **set** of points. If there are
+11 -12
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Francois_Boutines">Francois Boutines</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,7 +141,7 @@ 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>
<p>You will need an <a href="https://www.w3.org/TR/SVG11/expanded-toc.html">SVG</a> viewer or
a converter like <a href="https://imagemagick.org/index.php">ImageMagick</a>’s <code>convert</code>.
@@ -150,11 +149,11 @@ See <a href="../../faq.html#imagemagick">FAQ 3.17 - How do I compile and install
require it?</a>.</p>
<p>Look here to find some <a href="https://www.w3.org/Graphics/SVG/WG/wiki/Implementations">SVG Viewer
Implementations</a>.</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./boutines</span> <span class="op">&lt;</span> input <span class="op">&gt;</span> output.svg</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">./boutines</span> <span class="op">&lt;</span> input <span class="op">&gt;</span> output.svg</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 <code>ruby</code> is installed <a href="try.sh">try.sh</a> will generate an SVG file by:</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">ruby</span> <span class="at">-e</span> <span class="st">&#39;20.times{puts &quot;#{rand} #{rand}&quot;}&#39;</span> <span class="kw">|</span> <span class="ex">./boutines</span> <span class="op">&gt;</span> test.svg</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">ruby</span> <span class="at">-e</span> <span class="st">&#39;20.times{puts &quot;#{rand} #{rand}&quot;}&#39;</span> <span class="kw">|</span> <span class="ex">./boutines</span> <span class="op">&gt;</span> test.svg</span></code></pre></div>
<p>It will also create an SVG file with the file <a href="input.txt">input.txt</a>.</p>
<p>The script will check if <code>convert</code> is available and if so it will try converting
the SVG file(s) to PNG file(s) which you should be able to view in most any
@@ -179,16 +178,16 @@ square</a>.</p>
<p>A <a href="https://en.wikipedia.org/wiki/Voronoi_diagram">Voronoi diagram</a> of the set as
an <a href="https://www.w3.org/TR/SVG11/expanded-toc.html">SVG</a> stream.</p>
<p>This will possibly save a compressed SVG file and may be useful:</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">./boutines</span> <span class="kw">|</span> <span class="fu">gzip</span> <span class="op">&gt;</span> result.svg.gz</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">./boutines</span> <span class="kw">|</span> <span class="fu">gzip</span> <span class="op">&gt;</span> result.svg.gz</span></code></pre></div>
<p>Input consists of a list of floating points values separated by whitespaces
(ranging preferably in <code>[0,1]</code>). Alternating a horizontal coordinate, a
whitespace then the other coordinate (pointing downwards in the resulting
graph) and a newline will just go fine:</p>
<pre><code>0 0
0 1
1 0
1 1
.5 .5</code></pre>
<pre><code> 0 0
0 1
1 0
1 1
.5 .5</code></pre>
<p>Strictly speaking, you have to provide a <strong>set</strong> of points. If there are
duplicates in the list, there is no guarantee on the one to be shown (in
addition their labels will overlap) in the resulting colored <a href="https://en.wikipedia.org/wiki/Voronoi_diagram">Voronoi
+2 -2
View File
@@ -1,14 +1,14 @@
## To build:
```sh
make
make
```
## To use:
```sh
./chia
./chia
```
+3 -4
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#V_Chia">V. Chia</a><br>
Location: <a href="../../location.html#SG">SG</a> - <em>Republic of Singapore</em> (<em>Singapore</em>)
<br><br></li>
Location: <a href="../../location.html#SG">SG</a> - <em>Republic of Singapore</em> (<em>Singapore</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,9 +141,9 @@ Location: <a href="../../location.html#SG">SG</a> - <em>Republic of Singapore</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">./chia</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">./chia</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Have you had your morning cup of Java? You might want a
second cup before parsing this entry. And give your C
+7 -7
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make
make
```
NOTE: We FORCE the use of -O0 even if someone overrides it because this entry
@@ -13,7 +13,7 @@ will not work with it enabled.
The current status of this entry is:
```
STATUS: INABIAF - please **DO NOT** fix
STATUS: INABIAF - please **DO NOT** fix
```
For more detailed information see [2005 giljade bugs](../../bugs.html#2005_giljade).
@@ -22,22 +22,22 @@ For more detailed information see [2005 giljade bugs](../../bugs.html#2005_gilja
## To use:
```sh
./giljade
./giljade
```
## Try:
```sh
./try.sh
./try.sh
```
### Self-test feature to try:
```sh
./giljade > out
./giljade out
./giljade > out
./giljade out
```
NOTE: [try.sh](try.sh) will ask you if you wish to do this.
@@ -53,7 +53,7 @@ Control-F.
If you really understand expressions, then understand this:
```c
s=s^(b=s&s-1^s)
s=s^(b=s&s-1^s)
```
... and understand why it is found in the source code.
+8 -9
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Gil_Dogon">Gil Dogon</a><br>
Location: <a href="../../location.html#IL">IL</a> - <em>State of Israel</em> (<em>Israel</em>)
<br><br></li>
Location: <a href="../../location.html#IL">IL</a> - <em>State of Israel</em> (<em>Israel</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,20 +141,20 @@ Location: <a href="../../location.html#IL">IL</a> - <em>State of Israel</em> (<e
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></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>NOTE: We FORCE the use of -O0 even if someone overrides it because this entry
will not work with it enabled.</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#2005_giljade">2005 giljade 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">./giljade</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">./giljade</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<h3 id="self-test-feature-to-try">Self-test feature to try:</h3>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./giljade</span> <span class="op">&gt;</span> out</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./giljade</span> out</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">./giljade</span> <span class="op">&gt;</span> out</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./giljade</span> out</span></code></pre></div>
<p>NOTE: <a href="try.sh">try.sh</a> will ask you if you wish to do this.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This entry takes editorial in how it deals with its output. After using <code>vi(1)</code>
@@ -163,7 +162,7 @@ will not work with it enabled.</p>
output. We especially recommend it on a 78 column xterm while leaning on
Control-F.</p>
<p>If you really understand expressions, then understand this:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>s<span class="op">=</span>s<span class="op">^(</span>b<span class="op">=</span>s<span class="op">&amp;</span>s<span class="op">-</span><span class="dv">1</span><span class="op">^</span>s<span class="op">)</span></span></code></pre></div>
<div class="sourceCode" id="cb6"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a> s<span class="op">=</span>s<span class="op">^(</span>b<span class="op">=</span>s<span class="op">&amp;</span>s<span class="op">-</span><span class="dv">1</span><span class="op">^</span>s<span class="op">)</span></span></code></pre></div>
<p>… and understand why it is found in the source code.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="so-what-do-we-have-here">So what do we have here ?</h3>
+2 -2
View File
@@ -7,14 +7,14 @@ haven't already.
If you have SDL installed:
```sh
make
make
```
## To use:
```sh
./jetro
./jetro
```
+3 -4
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Jetro_Lauha">Jetro Lauha</a><br>
Location: <a href="../../location.html#FI">FI</a> - <em>Republic of Finland </em> (<em>Finland</em>)
<br><br></li>
Location: <a href="../../location.html#FI">FI</a> - <em>Republic of Finland </em> (<em>Finland</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -146,9 +145,9 @@ Location: <a href="../../location.html#FI">FI</a> - <em>Republic of Finland </em
requires SDL1 or SDL2?</a> for information on how to install it if you
haven’t already.</p>
<p>If you have SDL installed:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></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">./jetro</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">./jetro</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>We have seen entries with SDL graphics in the past, now it’s time for SDL
sound. This entry can even be run on a computer without a sound card with an
+3 -3
View File
@@ -1,21 +1,21 @@
## To build:
```sh
make
make
```
## To use:
```sh
./klausler arg1 arg2 | head
./klausler arg1 arg2 | head
```
## Try:
```sh
./try.sh
./try.sh
```
+4 -5
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Peter_Klausler">Peter Klausler</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">./klausler</span> arg1 arg2 <span class="kw">|</span> <span class="fu">head</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">./klausler</span> arg1 arg2 <span class="kw">|</span> <span class="fu">head</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>To reduce the size of the source, include other people’s data.
That is what Peter suggests when he describes how to generate
+9 -9
View File
@@ -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 [2005 mikeash bugs](../../bugs.html#2005_mikeash).
@@ -19,7 +19,7 @@ For more detailed information see [2005 mikeash bugs](../../bugs.html#2005_mikea
## To use:
```sh
./mikeash
./mikeash
```
NOTE: the author stated that they tested this under i386 machines but this works
@@ -29,7 +29,7 @@ under 64-bit (x86_64, arm64) machines too.
## Try:
```sh
./try.sh
./try.sh
```
@@ -68,7 +68,7 @@ functions.
Try:
```sh
echo '(format t "~s" (+ 2 2 ))' | ./mikeash
echo '(format t "~s" (+ 2 2 ))' | ./mikeash
```
You should see `4"` echoed on your command prompt. The `"` after the 4 and
@@ -77,7 +77,7 @@ the format function. More sophisticated arithmetic expressions may be
used:
```sh
echo '(format t "~s" (* (+ 2 2 ) (- 5 (/ 9 3 ))))' | ./mikeash
echo '(format t "~s" (* (+ 2 2 ) (- 5 (/ 9 3 ))))' | ./mikeash
```
This evaluates the expression `(2+2) * (5 - 9/3)` giving the correct result,
@@ -131,8 +131,8 @@ Basically, the [LISP][] interpreter is good for some basic math operations, and
for running itself. To do the latter, try this:
```sh
./mikeash < mikeash.c > mikeash2.c
diff mikeash.c mikeash2.c
./mikeash < mikeash.c > mikeash2.c
diff mikeash.c mikeash2.c
```
The program can also be run from an implementation of [common
@@ -140,7 +140,7 @@ lisp](https://en.wikipedia.org/wiki/Common_Lisp). To do
this, run the common lisp compiler and then type the following command:
```
(load "mikeash.c")
(load "mikeash.c")
```
The source code of [mikeash.c](mikeash.c) will be printed.
+10 -11
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Michael_Ash">Michael Ash</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,17 +141,17 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></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#2005_mikeash">2005 mikeash 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">./mikeash</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">./mikeash</span></span></code></pre></div>
<p>NOTE: the author stated that they tested this under i386 machines but this works
under 64-bit (x86_64, arm64) machines too.</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>Having problems speaking code? Do you <a href="https://en.wikipedia.org/wiki/Lisp_(programming_language)">LISP</a>? Parenthetically
speaking, this entry takes advantage of C99 features, while
@@ -176,12 +175,12 @@ constant string, due to different string escape semantics in C and Lisp, and
some implicit integer-to-pointer conversions due to the implicitly-declared
functions.</p>
<p>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="bu">echo</span> <span class="st">&#39;(format t &quot;~s&quot; (+ 2 2 ))&#39;</span> <span class="kw">|</span> <span class="ex">./mikeash</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="bu">echo</span> <span class="st">&#39;(format t &quot;~s&quot; (+ 2 2 ))&#39;</span> <span class="kw">|</span> <span class="ex">./mikeash</span></span></code></pre></div>
<p>You should see <code>4"</code> echoed on your command prompt. The <code>"</code> after the 4 and
the lack of a newline are due to the somewhat broken implementation of
the format function. More sophisticated arithmetic expressions may be
used:</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="bu">echo</span> <span class="st">&#39;(format t &quot;~s&quot; (* (+ 2 2 ) (- 5 (/ 9 3 ))))&#39;</span> <span class="kw">|</span> <span class="ex">./mikeash</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="bu">echo</span> <span class="st">&#39;(format t &quot;~s&quot; (* (+ 2 2 ) (- 5 (/ 9 3 ))))&#39;</span> <span class="kw">|</span> <span class="ex">./mikeash</span></span></code></pre></div>
<p>This evaluates the expression <code>(2+2) * (5 - 9/3)</code> giving the correct result,
<code>8"</code> (with the same issue of no newline after the <code>"</code>). Note that due to the
highly ad-hoc nature of the tokenizer, the spaces before the closing parentheses
@@ -220,12 +219,12 @@ nowhere near
</ul>
<p>Basically, the <a href="https://en.wikipedia.org/wiki/Lisp_(programming_language)">LISP</a> interpreter is good for some basic math operations, and
for running itself. To do the latter, try 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">./mikeash</span> <span class="op">&lt;</span> mikeash.c <span class="op">&gt;</span> mikeash2.c</span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="fu">diff</span> mikeash.c mikeash2.c</span></code></pre></div>
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./mikeash</span> <span class="op">&lt;</span> mikeash.c <span class="op">&gt;</span> mikeash2.c</span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">diff</span> mikeash.c mikeash2.c</span></code></pre></div>
<p>The program can also be run from an implementation of <a href="https://en.wikipedia.org/wiki/Common_Lisp">common
lisp</a>. To do
this, run the common lisp compiler and then type the following command:</p>
<pre><code>(load &quot;mikeash.c&quot;)</code></pre>
<pre><code> (load &quot;mikeash.c&quot;)</code></pre>
<p>The source code of <a href="mikeash.c">mikeash.c</a> will be printed.</p>
<h3 id="obfuscation">Obfuscation</h3>
<p><code>Lispob</code> is obfuscated in several ways. First, it’s actually two programs
+11 -11
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make
make
```
There is an alternate version that scans for (_ONLY_ scans) the string `https`
@@ -13,7 +13,7 @@ as a starting point. 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 [2005 mynx bugs](../../bugs.html#2005_mynx).
@@ -22,7 +22,7 @@ For more detailed information see [2005 mynx bugs](../../bugs.html#2005_mynx).
## To use:
```sh
./mynx http://<domain>
./mynx http://<domain>
```
You can specify a port by appending to the domain `:port`. See notes below on
@@ -32,9 +32,9 @@ the issue of https.
## Try:
```sh
./mynx http://www.textfiles.com
./mynx http://www.textfiles.com
./mynx manual.html
./mynx manual.html
```
@@ -59,7 +59,7 @@ must just appreciate the entry for what it once was.
### Alternate build:
```sh
make alt
make alt
```
@@ -69,7 +69,7 @@ Use `mynx.alt` as you would `mynx`. You'd have to specify a port at the end of
the URL like:
```sh
./mynx.alt https://www.ioccc.org:443
./mynx.alt https://www.ioccc.org:443
```
but again unless you have a clever workaround or hack to the problem, this sadly
@@ -93,13 +93,13 @@ it inspired me to try my hand at writing the client side complement.
A typical build command would be:
```sh
cc -o mynx mynx.c
cc -o mynx mynx.c
```
While some others like to be a little different:
```sh
cc -o mynx mynx.c -lnsl -lsocket
cc -o mynx mynx.c -lnsl -lsocket
```
I even managed to figure out a basic configure script, given last year's
@@ -108,13 +108,13 @@ all the network functions in a variety of places. So a simpler build
command sequence would be:
```sh
cd source ; ./configure ; make
cd source ; ./configure ; make
```
After which, the rest of the documentation can be read by saying:
```sh
./mynx ../manual.html
./mynx ../manual.html
```
+12 -13
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Anthony_C_Howe">Anthony C. Howe</a><br>
Location: <a href="../../location.html#CA">CA</a> - <em>Canada</em>
<br><br></li>
Location: <a href="../../location.html#CA">CA</a> - <em>Canada</em></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,21 +141,21 @@ Location: <a href="../../location.html#CA">CA</a> - <em>Canada</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 that scans for (<em>ONLY</em> scans) the string <code>https</code>
as a starting point. 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#2005_mynx">2005 mynx 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">./mynx</span> http://<span class="op">&lt;</span>domain<span class="op">&gt;</span></span></code></pre></div>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./mynx</span> http://<span class="op">&lt;</span>domain<span class="op">&gt;</span></span></code></pre></div>
<p>You can specify a port by appending to the domain <code>:port</code>. See notes below on
the issue of https.</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">./mynx</span> http://www.textfiles.com</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">./mynx</span> http://www.textfiles.com</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">./mynx</span> manual.html</span></code></pre></div>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./mynx</span> manual.html</span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>Obviously this will not work with <code>https</code> as it only scans for <code>http</code> in the URL
(if not specified it tries to open it as a local file). But even if it scanned
@@ -172,11 +171,11 @@ to either come up with a pipeline (or some other command line) that allows it to
work with https or to update the code to support https they may. Otherwise you
must just appreciate the entry for what it once was.</p>
<h3 id="alternate-build">Alternate build:</h3>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>mynx.alt</code> as you would <code>mynx</code>. You’d have to specify a port at the end of
the URL 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="ex">./mynx.alt</span> https://www.ioccc.org:443</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">./mynx.alt</span> https://www.ioccc.org:443</span></code></pre></div>
<p>but again unless you have a clever workaround or hack to the problem, this sadly
won’t work.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
@@ -189,16 +188,16 @@ get a functioning LAMP stack.</p>
<p>I was rather impressed by last year’s mini webserver. So much so that
it inspired me to try my hand at writing the client side complement.</p>
<p>A typical build command would be:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cc</span> <span class="at">-o</span> mynx mynx.c</span></code></pre></div>
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">cc</span> <span class="at">-o</span> mynx mynx.c</span></code></pre></div>
<p>While some others like to be a little different:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cc</span> <span class="at">-o</span> mynx mynx.c <span class="at">-lnsl</span> <span class="at">-lsocket</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="fu">cc</span> <span class="at">-o</span> mynx mynx.c <span class="at">-lnsl</span> <span class="at">-lsocket</span></span></code></pre></div>
<p>I even managed to figure out a basic configure script, given last year’s
example, which is kinda of useful when you consider how many OSes put
all the network functions in a variety of places. So a simpler build
command sequence would be:</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="bu">cd</span> source <span class="kw">;</span> <span class="ex">./configure</span> <span class="kw">;</span> <span class="fu">make</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="bu">cd</span> source <span class="kw">;</span> <span class="ex">./configure</span> <span class="kw">;</span> <span class="fu">make</span></span></code></pre></div>
<p>After which, the rest of the documentation can be read by saying:</p>
<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">./mynx</span> ../manual.html</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">./mynx</span> ../manual.html</span></code></pre></div>
<!--
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
+8 -8
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make
make
```
There is an alternate version of this entry which should work for Windows by
@@ -11,14 +11,14 @@ setting binary mode on `stdout`. See [alternate code](#alternate-code) below.
## To use:
```sh
./persano p q [num frames]
./persano p q [num frames]
```
## Try:
```sh
./try.sh
./try.sh
```
Open the [GIF](https://en.wikipedia.org/wiki/GIF) files with a viewer capable of
@@ -38,7 +38,7 @@ let it work with Windows.
### Alternate build:
```
make alt
make alt
```
@@ -50,7 +50,7 @@ Use `persano.alt` as you would `persano` above.
### Alternate try:
```sh
./persano.alt 3 16 > knot3-16.gif
./persano.alt 3 16 > knot3-16.gif
```
Follow the same instructions, using different tools if necessary, as the above
@@ -81,7 +81,7 @@ knots](https://en.wikipedia.org/wiki/Torus_knot) to standard output.
### SYNOPSIS
```sh
./persano p q [num frames]
./persano p q [num frames]
```
@@ -99,14 +99,14 @@ cutting it [^1], until it ends up looking just like a circle embedded in R3 [^2]
Sample usage:
```sh
./persano 3 2 1 > foo.gif
./persano 3 2 1 > foo.gif
```
writes a non-animated GIF (a single frame) stream of a rendered trefoil
knot to the file `foo.gif`.
```sh
./persano 5 2
./persano 5 2
```
writes a GIF stream with a rendering of [Solomon's Seal
+9 -10
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Mauro_Persano">Mauro Persano</a><br>
Location: <a href="../../location.html#BR">BR</a> - <em>Federative Republic of Brazil</em> (<em>Brazil</em>)
<br><br></li>
Location: <a href="../../location.html#BR">BR</a> - <em>Federative Republic of Brazil</em> (<em>Brazil</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,13 +141,13 @@ Location: <a href="../../location.html#BR">BR</a> - <em>Federative Republic of B
<!-- 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 of this entry which should work for Windows by
setting binary mode on <code>stdout</code>. See <a href="#alternate-code">alternate code</a> below.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./persano</span> p q [num frames]</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">./persano</span> p q [num frames]</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>Open the <a href="https://en.wikipedia.org/wiki/GIF">GIF</a> files with a viewer capable of
displaying animated GIFs and watch closely at the bottom of the picture (you may
need to use <a href="https://www.lcdf.org/gifsicle/">gifsicle</a> - a great tool to
@@ -159,11 +158,11 @@ generated by the entry).</p>
functions <code>_setmode()</code> and <code>_fileno(3)</code> to set binary mode on <code>stdout</code> which should
let it work with Windows.</p>
<h3 id="alternate-build">Alternate build:</h3>
<pre><code>make alt</code></pre>
<pre><code> make alt</code></pre>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>persano.alt</code> as you would <code>persano</code> above.</p>
<h3 id="alternate-try">Alternate try:</h3>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./persano.alt</span> 3 16 <span class="op">&gt;</span> knot3-16.gif</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">./persano.alt</span> 3 16 <span class="op">&gt;</span> knot3-16.gif</span></code></pre></div>
<p>Follow the same instructions, using different tools if necessary, as the above
try section.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
@@ -180,7 +179,7 @@ linker option).</p>
<p><strong>knot</strong> writes animated GIF images of rendered <a href="https://en.wikipedia.org/wiki/Torus_knot">torus
knots</a> to standard output.</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">./persano</span> p q [num frames]</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">./persano</span> p q [num frames]</span></code></pre></div>
<h3 id="description">DESCRIPTION</h3>
<p>A <code>(p,q)</code>-<a href="https://en.wikipedia.org/wiki/Torus_knot">torus knot</a> is a closed,
non-intersecting curve on the surface of a
@@ -191,10 +190,10 @@ resulting curve will <em>not</em> be a knot (that is, imagining the resulting cu
a loop of rubber, there will be a way to bend, twist and stretch it, without
cutting it <a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a>, until it ends up looking just like a circle embedded in R3 <a href="#fn2" class="footnote-ref" id="fnref2" role="doc-noteref"><sup>2</sup></a>).</p>
<p>Sample usage:</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">./persano</span> 3 2 1 <span class="op">&gt;</span> foo.gif</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">./persano</span> 3 2 1 <span class="op">&gt;</span> foo.gif</span></code></pre></div>
<p>writes a non-animated GIF (a single frame) stream of a rendered trefoil
knot to the file <code>foo.gif</code>.</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">./persano</span> 5 2</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">./persano</span> 5 2</span></code></pre></div>
<p>writes a GIF stream with a rendering of <a href="https://en.wikipedia.org/wiki/Solomon%27s_knot">Solomon’s Seal
knot</a> to standard
output; since the number of frames is not specified, an animation with
+33 -33
View File
@@ -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 [2005 sykes bugs](../../bugs.html#2005_sykes).
@@ -19,14 +19,14 @@ For more detailed information see [2005 sykes bugs](../../bugs.html#2005_sykes).
## To use:
```sh
./sykes binary_file
./sykes binary_file
```
## Try:
```sh
./try.sh
./try.sh
```
@@ -45,16 +45,16 @@ the [emulator](https://en.wikipedia.org/wiki/Emulator) in
[PET](https://en.wikipedia.org/wiki/Commodore_PET) mode as follows:
```sh
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/basic-2-c000.901465-01.bin
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/basic-2-d000.901465-02.bin
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/edit-2-n.901447-24.bin
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/kernal-2.901465-03.bin
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/basic-2-c000.901465-01.bin
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/basic-2-d000.901465-02.bin
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/edit-2-n.901447-24.bin
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/kernal-2.901465-03.bin
```
We then created:
```sh
dd bs=2k count=1 if=/dev/zero of=nullfill.bin
dd bs=2k count=1 if=/dev/zero of=nullfill.bin
```
For your convenience, we have added the above mentioned files to this entry directory.
@@ -80,7 +80,7 @@ Compile the program, then test the
[emulation](https://en.wikipedia.org/wiki/Emulator) like this:
```sh
./sykes 6502test
./sykes 6502test
```
A basic test is done for each instruction and addressing mode, all tests
@@ -106,27 +106,27 @@ window](https://en.wikipedia.org/wiki/Terminal_emulator) of 40x25 chars or
bigger, and then run the emulator like this:
```sh
./sykes pet.rom
./sykes pet.rom
```
You should see the startup message. Try typing in some
[BASIC](https://en.wikipedia.org/wiki/BASIC) - for instance:
```
PRINT "HELLO, WORLD"
PRINT "HELLO, WORLD"
```
There is an optional numeric parameter, which controls the speed. For a
slower cursor blink, try
```sh
./sykes pet.rom 6
./sykes pet.rom 6
```
and for faster
```sh
./sykes pet.rom 2
./sykes pet.rom 2
```
The default is 4.
@@ -134,23 +134,23 @@ The default is 4.
The control keys are as follows:
```
^A HOME
^L CLR
^R RVS
^E OFF
^Y INST
^X STOP (break)
^F cursor forward
^B cursor back
^N cursor down
^A HOME
^L CLR
^R RVS
^E OFF
^Y INST
^X STOP (break)
^F cursor forward
^B cursor back
^N cursor down
```
Supplied also is a short demo program written in
[BASIC](https://en.wikipedia.org/wiki/BASIC). Try typing
```
LOAD "DEMO"
RUN
LOAD "DEMO"
RUN
```
Many other old programs will run in this emulator too. Files with a `.PRG`
@@ -162,19 +162,19 @@ The filenames must be upper case in order to be loaded by the emulator.
You can save programs too - try
```
10 PRINT "HELLO!"
SAVE "HELLO"
NEW
10 PRINT "HELLO!"
SAVE "HELLO"
NEW
LOAD "HELLO"
RUN
LOAD "HELLO"
RUN
```
You also might try typing this to see an ancient [Easter egg][]:
```
WAIT 6502,12
WAIT 6502,12
```
[Easter egg]: https://en.wikipedia.org/wiki/Easter_egg_(media)#Software
@@ -192,7 +192,7 @@ compiled-for-[6502](https://en.wikipedia.org/wiki/MOS_Technology_6502#Technical_
version a chess program (heh, I found a use for a previous losing entry :) ). Try:
```sh
./sykes chess
./sykes chess
```
It works as you would expect (it plays very badly). There's no castling
@@ -307,7 +307,7 @@ from the Internet. This is to avoid directly infringing any copyright.
What does this do?
```sh
./sykes pet.rom -1
./sykes pet.rom -1
```
Have fun!
+34 -35
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Stephen_Sykes">Stephen Sykes</a><br>
Location: <a href="../../location.html#FI">FI</a> - <em>Republic of Finland </em> (<em>Finland</em>)
<br><br></li>
Location: <a href="../../location.html#FI">FI</a> - <em>Republic of Finland </em> (<em>Finland</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,15 +141,15 @@ Location: <a href="../../location.html#FI">FI</a> - <em>Republic of Finland </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: 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#2005_sykes">2005 sykes 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">./sykes</span> binary_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">./sykes</span> binary_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">./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>For those who fondly remember their first
<a href="https://en.wikipedia.org/wiki/Commodore_PET">PET</a>, this entry will start you
@@ -161,12 +160,12 @@ after the C pre-processor gets finished with it!</p>
<p>We downloaded the <a href="https://en.wikipedia.org/wiki/ROM_image">ROM</a> contents to use
the <a href="https://en.wikipedia.org/wiki/Emulator">emulator</a> in
<a href="https://en.wikipedia.org/wiki/Commodore_PET">PET</a> mode as follows:</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">wget</span> http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/basic-2-c000.901465-01.bin</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="fu">wget</span> http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/basic-2-d000.901465-02.bin</span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a><span class="fu">wget</span> http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/edit-2-n.901447-24.bin</span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a><span class="fu">wget</span> http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/kernal-2.901465-03.bin</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">wget</span> http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/basic-2-c000.901465-01.bin</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">wget</span> http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/basic-2-d000.901465-02.bin</span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">wget</span> http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/edit-2-n.901447-24.bin</span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">wget</span> http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/kernal-2.901465-03.bin</span></code></pre></div>
<p>We then created:</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">dd</span> bs=2k count=1 if=/dev/zero of=nullfill.bin</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">dd</span> bs=2k count=1 if=/dev/zero of=nullfill.bin</span></code></pre></div>
<p>For your convenience, we have added the above mentioned files to this entry directory.
They were used to form the <code>pet.rom</code> file.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
@@ -181,7 +180,7 @@ to not infringe the rules.</p>
<p>Compile the program, then test the
<a href="https://en.wikipedia.org/wiki/MOS_Technology_6502#Technical_description">6502</a>
<a href="https://en.wikipedia.org/wiki/Emulator">emulation</a> 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">./sykes</span> 6502test</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">./sykes</span> 6502test</span></code></pre></div>
<p>A basic test is done for each instruction and addressing mode, all tests
should pass. At the end of the tests, it loops forever - break out with
control-C.</p>
@@ -197,44 +196,44 @@ Transactor.</p>
<p>Make sure you have a <a href="https://en.wikipedia.org/wiki/Terminal_emulator">terminal
window</a> of 40x25 chars or
bigger, and then run the emulator like this:</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">./sykes</span> pet.rom</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">./sykes</span> pet.rom</span></code></pre></div>
<p>You should see the startup message. Try typing in some
<a href="https://en.wikipedia.org/wiki/BASIC">BASIC</a> - for instance:</p>
<pre><code>PRINT &quot;HELLO, WORLD&quot;</code></pre>
<pre><code> PRINT &quot;HELLO, WORLD&quot;</code></pre>
<p>There is an optional numeric parameter, which controls the speed. For a
slower cursor blink, try</p>
<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">./sykes</span> pet.rom 6</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">./sykes</span> pet.rom 6</span></code></pre></div>
<p>and for faster</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">./sykes</span> pet.rom 2</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">./sykes</span> pet.rom 2</span></code></pre></div>
<p>The default is 4.</p>
<p>The control keys are as follows:</p>
<pre><code>^A HOME
^L CLR
^R RVS
^E OFF
^Y INST
^X STOP (break)
^F cursor forward
^B cursor back
^N cursor down</code></pre>
<pre><code> ^A HOME
^L CLR
^R RVS
^E OFF
^Y INST
^X STOP (break)
^F cursor forward
^B cursor back
^N cursor down</code></pre>
<p>Supplied also is a short demo program written in
<a href="https://en.wikipedia.org/wiki/BASIC">BASIC</a>. Try typing</p>
<pre><code>LOAD &quot;DEMO&quot;
RUN</code></pre>
<pre><code> LOAD &quot;DEMO&quot;
RUN</code></pre>
<p>Many other old programs will run in this emulator too. Files with a <code>.PRG</code>
extension should work. (Look, for instance, here:
<a href="http://www.zimmers.net/anonftp/pub/cbm/pet/ALLFILES.html" class="uri">http://www.zimmers.net/anonftp/pub/cbm/pet/ALLFILES.html</a>,<br />
or try this one: <a href="http://www.zimmers.net/anonftp/pub/cbm/pet/games/english/dungeon.prg" class="uri">http://www.zimmers.net/anonftp/pub/cbm/pet/games/english/dungeon.prg</a>)<br />
The filenames must be upper case in order to be loaded by the emulator.</p>
<p>You can save programs too - try</p>
<pre><code>10 PRINT &quot;HELLO!&quot;
SAVE &quot;HELLO&quot;
NEW
<pre><code> 10 PRINT &quot;HELLO!&quot;
SAVE &quot;HELLO&quot;
NEW
LOAD &quot;HELLO&quot;
RUN</code></pre>
LOAD &quot;HELLO&quot;
RUN</code></pre>
<p>You also might try typing this to see an ancient <a href="https://en.wikipedia.org/wiki/Easter_egg_(media)#Software">Easter egg</a>:</p>
<pre><code>WAIT 6502,12</code></pre>
<pre><code> WAIT 6502,12</code></pre>
<h3 id="emulation">6502 EMULATION</h3>
<p>The program is basically a
<a href="https://en.wikipedia.org/wiki/MOS_Technology_6502#Technical_description">6502</a>
@@ -244,7 +243,7 @@ RUN</code></pre>
<p>Supplied as a demonstration is a
compiled-for-<a href="https://en.wikipedia.org/wiki/MOS_Technology_6502#Technical_description">6502</a>
version a chess program (heh, I found a use for a previous losing entry :) ). Try:</p>
<div class="sourceCode" id="cb16"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./sykes</span> chess</span></code></pre></div>
<div class="sourceCode" id="cb16"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./sykes</span> chess</span></code></pre></div>
<p>It works as you would expect (it plays very badly). There’s no castling
or en-passant, and to win you must actually take the opponent’s king.</p>
<p>You can write your own programs too, any <a href="https://en.wikibooks.org/wiki/6502_Assembly">6502
@@ -328,7 +327,7 @@ course, the <code>pet.rom</code> is not my work. So I ask the user to download i
from the Internet. This is to avoid directly infringing any copyright.</p>
<h3 id="finally">Finally</h3>
<p>What does this do?</p>
<div class="sourceCode" id="cb17"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./sykes</span> pet.rom <span class="at">-1</span></span></code></pre></div>
<div class="sourceCode" id="cb17"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./sykes</span> pet.rom <span class="at">-1</span></span></code></pre></div>
<p>Have fun!</p>
<!--
+3 -3
View File
@@ -1,21 +1,21 @@
## To build:
```sh
make
make
```
## To use:
```sh
./timwi < bf_program
./timwi < bf_program
```
## Try:
```sh
./try.sh
./try.sh
```
+4 -5
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Arne_Heizmann">Arne Timwi Heizmann</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,11 +141,11 @@ Location: <a href="../../location.html#DE">DE</a> - <em>Federal Republic of Germ
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<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">./timwi</span> <span class="op">&lt;</span> bf_program</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">./timwi</span> <span class="op">&lt;</span> bf_program</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>Unlike most <a href="https://en.wikipedia.org/wiki/Brainfuck">BF</a> interpreters that we
have been receiving for the last few years, this one, in our opinion, is the
+8 -8
View File
@@ -1,22 +1,22 @@
## To build:
```sh
make
make
```
## To use:
```sh
./toledo [a ...]
./toledo [a ...]
```
## Try:
```sh
./toledo a
./toledo a b
./toledo a
./toledo a b
```
@@ -31,7 +31,7 @@ Two alternate versions of this entry, [toledo2.c](toledo2.c) and
To compile the alternate versions:
```sh
make alt
make alt
```
@@ -64,7 +64,7 @@ two modes: two-players, and one player (always white) against the machine. To
get the first mode, run the program without arguments:
```sh
./toledo
./toledo
```
The other mode is accessible running the program with one argument
@@ -72,14 +72,14 @@ The other mode is accessible running the program with one argument
analysis):
```sh
./toledo a
./toledo a
```
Two arguments for 6-[ply](https://en.wikipedia.org/wiki/Ply_(game_theory))
analysis:
```sh
./toledo a b
./toledo a b
```
And each successive argument will analyze one
+9 -10
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Oscar_Toledo">Oscar Toledo G.</a><br>
Location: <a href="../../location.html#MX">MX</a> - <em>United Mexican States</em> (<em>Mexico</em>)
<br><br></li>
Location: <a href="../../location.html#MX">MX</a> - <em>United Mexican States</em> (<em>Mexico</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,18 +141,18 @@ Location: <a href="../../location.html#MX">MX</a> - <em>United Mexican States</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">./toledo</span> [a ...]</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">./toledo</span> [a ...]</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">./toledo</span> a</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./toledo</span> a b</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">./toledo</span> a</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./toledo</span> a b</span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>Two alternate versions of this entry, <a href="toledo2.c">toledo2.c</a> and
<a href="toledo3.c">toledo3.c</a> are provided.</p>
<h3 id="alternate-build">Alternate build:</h3>
<p>To compile the alternate versions:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use Use <code>toledo2</code> and <code>toledo3</code> as you would <code>toledo</code> above.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
@@ -171,14 +170,14 @@ single function.</p>
<p>This is a <a href="https://en.wikipedia.org/wiki/Chess">chess</a> program, it can work in
two modes: two-players, and one player (always white) against the machine. To
get the first mode, run the program without arguments:</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">./toledo</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">./toledo</span></span></code></pre></div>
<p>The other mode is accessible running the program with one argument
(5-<a href="https://en.wikipedia.org/wiki/Ply_(game_theory)">ply</a>
analysis):</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./toledo</span> a</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">./toledo</span> a</span></code></pre></div>
<p>Two arguments for 6-<a href="https://en.wikipedia.org/wiki/Ply_(game_theory)">ply</a>
analysis:</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">./toledo</span> a b</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">./toledo</span> a b</span></code></pre></div>
<p>And each successive argument will analyze one
<a href="https://en.wikipedia.org/wiki/Ply_(game_theory)">ply</a> more. There is no ply
limit, but beyond 7 ply is very slow, try it at your own risk and computing
+15 -15
View File
@@ -1,21 +1,21 @@
## To build:
```sh
make
make
```
## To use:
```sh
./vik [file.map]
./vik [file.map]
```
## Try:
```sh
./vik maze.map
./vik maze.map
```
@@ -61,14 +61,14 @@ libraries](https://en.wikipedia.org/wiki/Xlib) if necessary. The program takes
three options which have to be typed in a specific order as described below.
```sh
./vik [-w <width>] [mapfile]
./vik [-w <width>] [mapfile]
```
where:
```
width - Specifies the width of the window
mapfile - Filename containing a map
width - Specifies the width of the window
mapfile - Filename containing a map
```
#### Examples
@@ -76,20 +76,20 @@ mapfile - Filename containing a map
Start the engine using a built in labyrinth and texture bitmaps:
```sh
./vik
./vik
```
Start the engine and loads the labyrinth defined in the file
[maze.map](maze.map):
```sh
./vik maze.map
./vik maze.map
```
Start the engine using [maze.map](maze.map) in a window that is 400 pixels wide:
```sh
./vik -w 400 maze.map
./vik -w 400 maze.map
```
Note that the `mapfile` has to be the last argument and the `-w` option if present
@@ -107,12 +107,12 @@ engine what bitmap texture file to use. The `*` character lets the engine know
where to position the user. The example below shows how a map file can look:
```
aaaaaaaaaaaaa
a a
a * a
a bbbb cccccccc
c c
cccccccccccccccccccc
aaaaaaaaaaaaa
a a
a * a
a bbbb cccccccc
c c
cccccccccccccccccccc
```
The engine loads the map, and creates walls. When a character in the range `a-z`
+16 -17
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Daniel_Vik">Daniel Vik</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">./vik</span> <span class="pp">[</span><span class="ss">file.map</span><span class="pp">]</span></span></code></pre></div>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./vik</span> <span class="pp">[</span><span class="ss">file.map</span><span class="pp">]</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./vik</span> maze.map</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">./vik</span> maze.map</span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>An amazing use of the X libraries with twisty code passages, all different. One
risks running in code path circles as <code>main()</code> is called again and again. Be
@@ -178,18 +177,18 @@ backward).</li>
<p>Compile the source code and link in <a href="https://en.wikipedia.org/wiki/Xlib">X
libraries</a> if necessary. The program takes
three options which have to be typed in a specific order as described below.</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">./vik</span> [-w <span class="op">&lt;</span>width<span class="op">&gt;</span>] <span class="pp">[</span><span class="ss">mapfile</span><span class="pp">]</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">./vik</span> [-w <span class="op">&lt;</span>width<span class="op">&gt;</span>] <span class="pp">[</span><span class="ss">mapfile</span><span class="pp">]</span></span></code></pre></div>
<p>where:</p>
<pre><code>width - Specifies the width of the window
mapfile - Filename containing a map</code></pre>
<pre><code> width - Specifies the width of the window
mapfile - Filename containing a map</code></pre>
<h4 id="examples">Examples</h4>
<p>Start the engine using a built in labyrinth and texture bitmaps:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./vik</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">./vik</span></span></code></pre></div>
<p>Start the engine and loads the labyrinth defined in the file
<a href="maze.map">maze.map</a>:</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">./vik</span> maze.map</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">./vik</span> maze.map</span></code></pre></div>
<p>Start the engine using <a href="maze.map">maze.map</a> in a window that is 400 pixels wide:</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">./vik</span> <span class="at">-w</span> 400 maze.map</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">./vik</span> <span class="at">-w</span> 400 maze.map</span></code></pre></div>
<p>Note that the <code>mapfile</code> has to be the last argument and the <code>-w</code> option if present
has to be the first. The map definition files and the bitmap files should be
located in the current directory.</p>
@@ -199,12 +198,12 @@ located in the current directory.</p>
ASCII text file where lower case letters represent walls. The letter tells the
engine what bitmap texture file to use. The <code>*</code> character lets the engine know
where to position the user. The example below shows how a map file can look:</p>
<pre><code>aaaaaaaaaaaaa
a a
a * a
a bbbb cccccccc
c c
cccccccccccccccccccc</code></pre>
<pre><code> aaaaaaaaaaaaa
a a
a * a
a bbbb cccccccc
c c
cccccccccccccccccccc</code></pre>
<p>The engine loads the map, and creates walls. When a character in the range <code>a-z</code>
is found, the engine will load the corresponding texture bitmap. The bitmap file
must be named <code>*.bmp</code> where <code>*</code> is substituted with the letter of the wall in
+3 -3
View File
@@ -4,14 +4,14 @@ Before building, make sure that you have the OpenGL development libraries
installed.
```sh
make
make
```
## To use:
```sh
./vince
./vince
```
@@ -32,7 +32,7 @@ also has the recursive `CPP` macro (which sneaked in accidentally) removed.
To compile this alternate version:
```sh
make alt
make alt
```
+4 -5
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Vincent_Weaver">Vincent Weaver</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 -->
@@ -144,9 +143,9 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<h2 id="to-build">To build:</h2>
<p>Before building, make sure that you have the OpenGL development libraries
installed.</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></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">./vince</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">./vince</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<p>When running this in the program’s window try hitting space a few times and see
what happens!</p>
@@ -155,7 +154,7 @@ what happens!</p>
also has the recursive <code>CPP</code> macro (which sneaked in accidentally) removed.</p>
<h3 id="alternate-build">Alternate build:</h3>
<p>To compile this alternate version:</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>vince.alt</code> as you would <code>vince</code> above.</p>
<h3 id="alternate-try">Alternate try:</h3>