add hack-a-round for language specified markdown code blocks
When language is specified in a markdown code block such as:
````
```c
printf("Hello, world!\n");
```
````
is used, the resulting HTML as produced by `pandoc(1)` combined
with our revised `ioccc.css` is not intent the code block well.
A temporary "_hack-a-round_" is to turn the "markdown code language
specifier" into an HTML comment. For example:
````
```<!---c-->
printf("Hello, world!\n");
```
````
This commits turns off existing markdown code language specifiers
for now, while preserving our ability to restore them in the future
when a better "_hack-a-round_" to the "markdown code language
specifier" problem is found.
The HTML impact if this "_hack-a-round_" is to produce HTML that
looks like this:
```
<pre class="<!---c-->"><code> .. </code></pre>
```
We might be able to create a complex set of classes for each markdown
code language (there won't be very many) in `ioccc.css`, or we might
find a more general CSS (or maybe `pandoc(1)`?) solution.
For now, this hack-a-round will have to do.
This commit is contained in:
1 parent
3919df50fb
commit
b66c79254a
700 files changed
+7052
-7056
No files matched your search
+12
-12
@@ -1,6 +1,6 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
@@ -10,7 +10,7 @@ code](#alternate-code).
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./aidan < puzzle
|
||||
|
||||
./aidan seed
|
||||
@@ -21,7 +21,7 @@ where `seed` is a number.
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
@@ -34,7 +34,7 @@ which is slower, inelegant and not as obscure, as the author put it.
|
||||
|
||||
### Alternate build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make alt
|
||||
```
|
||||
|
||||
@@ -46,7 +46,7 @@ Use `aidan.alt` as you would `aidan` above.
|
||||
|
||||
### Alternate try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.alt.sh
|
||||
```
|
||||
|
||||
@@ -139,7 +139,7 @@ Telegraph](https://www.telegraph.co.uk/), a UK newspaper.
|
||||
|
||||
Now, with modern computers this **can** be solved using brute force, e.g.:
|
||||
|
||||
```c
|
||||
```<!---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;}
|
||||
@@ -186,20 +186,20 @@ reasons. That's the worst performance I've had from brute-force so far!)
|
||||
|
||||
#### Building
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
cc -o sudoku-sf sudoku-sf.c
|
||||
```
|
||||
|
||||
or, if using gcc, try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
gcc -O2 -Wall -Wextra -ansi -pedantic-errors -o sudoku-sf sudoku-sf.c
|
||||
```
|
||||
|
||||
|
||||
#### Testing (optional)
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
perl ./test-su.perl
|
||||
```
|
||||
|
||||
@@ -211,7 +211,7 @@ really.
|
||||
|
||||
#### Solving
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./aidan < somefile.txt
|
||||
```
|
||||
|
||||
@@ -232,7 +232,7 @@ though slightly slower. See if you can figure out what it does.)
|
||||
|
||||
#### Generating
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./sudoku <seed>
|
||||
```
|
||||
|
||||
@@ -292,7 +292,7 @@ least 32. (No, that isn't a typo - I did say 15, not 16).
|
||||
|
||||
Also requires that `cpp` can properly handle something like:
|
||||
|
||||
```c
|
||||
```<!---c-->
|
||||
#define foo(x,y) x y
|
||||
foo(bar,)
|
||||
```
|
||||
|
||||
+22
-22
@@ -141,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>
|
||||
<pre class="<!---sh-->"><code> make</code></pre>
|
||||
<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"><</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>
|
||||
<pre class="<!---sh-->"><code> ./aidan < puzzle
|
||||
|
||||
./aidan seed</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> ./try.sh</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> make alt</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> ./try.alt.sh</code></pre>
|
||||
<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>
|
||||
@@ -223,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"><stdio.h></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"><</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"><</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"><<</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">&</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"><</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">]++<</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"><</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"><</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">></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"><</span><span class="dv">81</span><span class="op">;</span>printf<span class="op">(</span><span class="st">"</span><span class="sc">\n%s</span><span class="st">!</span><span class="sc">\n\n</span><span class="st">"</span><span class="op">,</span>z<span class="op">?</span><span class="st">"Fail"</span><span class="op">:</span></span>
|
||||
<span id="cb7-7"><a href="#cb7-7" aria-hidden="true" tabindex="-1"></a> <span class="st">"Success"</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"><</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">"</span><span class="sc">%c</span><span class="st"> </span><span class="sc">%s</span><span class="st">"</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">'.'</span><span class="op">),(++</span>n<span class="op">%</span><span class="dv">3</span><span class="op">?</span><span class="st">""</span><span class="op">:</span>n<span class="op">%</span><span class="dv">9</span><span class="op">?</span><span class="st">"| "</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">"</span><span class="sc">\n</span><span class="st">"</span><span class="op">:</span>n<span class="op">%</span><span class="dv">81</span><span class="op">?</span><span class="st">"</span><span class="sc">\n</span><span class="st">------+-------+------</span><span class="sc">\n</span><span class="st">"</span><span class="op">:</span><span class="st">"</span><span class="sc">\n\n</span><span class="st">"</span><span class="op">));}</span><span class="cf">return</span> z<span class="op">;}</span></span></code></pre></div>
|
||||
<pre class="<!---c-->"><code> #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;}</code></pre>
|
||||
<blockquote>
|
||||
<p>Judges’ note: this was added as <a href="aidan.alt.c">aidan.alt.c</a>.</p>
|
||||
</blockquote>
|
||||
@@ -259,17 +259,17 @@ 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>
|
||||
<pre class="<!---sh-->"><code> cc -o sudoku-sf sudoku-sf.c</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> gcc -O2 -Wall -Wextra -ansi -pedantic-errors -o sudoku-sf sudoku-sf.c</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> perl ./test-su.perl</code></pre>
|
||||
<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"><</span> somefile.txt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./aidan < somefile.txt</code></pre>
|
||||
<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
|
||||
@@ -282,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"><</span>seed<span class="op">></span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./sudoku <seed></code></pre>
|
||||
<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>
|
||||
@@ -321,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>
|
||||
<pre class="<!---c-->"><code> #define foo(x,y) x y
|
||||
foo(bar,)</code></pre>
|
||||
<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
|
||||
|
||||
+13
-13
@@ -1,6 +1,6 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
@@ -8,7 +8,7 @@ NOTE: there is an alternate version for vi(m) like movements. See [alternate
|
||||
version](#alternate-code) below. If your terminal has problems with the
|
||||
`stty(1)` commands try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make anon-no_stty
|
||||
```
|
||||
|
||||
@@ -28,14 +28,14 @@ For more detailed information see [2005 anon bugs](../../bugs.html#2005_anon).
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./anon x y [z]
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./anon 4 4
|
||||
|
||||
./anon 3 3 3
|
||||
@@ -48,13 +48,13 @@ hook you) and spending too much time playing. :-)
|
||||
|
||||
If you want to see this in action you can easily do this:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
yes 'please crash on me :-)' | ./anon 4 4
|
||||
```
|
||||
|
||||
What happens if you specify a larger board? For instance:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
yes 'please crash on me :-)' | ./anon 10 10 10
|
||||
```
|
||||
|
||||
@@ -70,13 +70,13 @@ The alternate version uses `vi(m)` like movement keys.
|
||||
|
||||
### Alternate build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make alt
|
||||
```
|
||||
|
||||
To compile the version without `stty(1)`:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make alt-no_stty
|
||||
```
|
||||
|
||||
@@ -121,13 +121,13 @@ sorted in the order they appear on the screen.
|
||||
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
|
||||
```<!---sh-->
|
||||
./anon 4 4
|
||||
```
|
||||
|
||||
To play with a 3D board, do something like this:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./anon 3 3 3
|
||||
```
|
||||
|
||||
@@ -377,7 +377,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
|
||||
```<!---c-->
|
||||
if (p) { q; r } else {s}
|
||||
```
|
||||
|
||||
@@ -404,7 +404,7 @@ closes the current state and opens a new one behind the programmer's back.
|
||||
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
|
||||
```<!---c-->
|
||||
for(s,i, 0, 10,
|
||||
some_code ,
|
||||
other_code)
|
||||
@@ -412,7 +412,7 @@ is the loop body. `Z` is the post-loop code in the current state. For example:
|
||||
|
||||
is equivalent to:
|
||||
|
||||
```c
|
||||
```<!---c-->
|
||||
for (i=0; i<10; i++) {
|
||||
some_code;
|
||||
}
|
||||
|
||||
+20
-20
@@ -141,39 +141,39 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></l
|
||||
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||||
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> make anon-no_stty</code></pre>
|
||||
<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>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> ./anon x y [z]</code></pre>
|
||||
<h2 id="try">Try:</h2>
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./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>
|
||||
<pre class="<!---sh-->"><code> ./anon 4 4
|
||||
|
||||
./anon 3 3 3</code></pre>
|
||||
<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">'please crash on me :-)'</span> <span class="kw">|</span> <span class="ex">./anon</span> 4 4</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> yes 'please crash on me :-)' | ./anon 4 4</code></pre>
|
||||
<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">'please crash on me :-)'</span> <span class="kw">|</span> <span class="ex">./anon</span> 10 10 10</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> yes 'please crash on me :-)' | ./anon 10 10 10</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> make alt</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> make alt-no_stty</code></pre>
|
||||
<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
|
||||
@@ -200,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>
|
||||
<pre class="<!---sh-->"><code> ./anon 4 4</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> ./anon 3 3 3</code></pre>
|
||||
<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>
|
||||
@@ -394,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>
|
||||
<pre class="<!---c-->"><code> if (p) { q; r } else {s}</code></pre>
|
||||
<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
|
||||
@@ -415,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>
|
||||
<pre class="<!---c-->"><code> for(s,i, 0, 10,
|
||||
some_code ,
|
||||
other_code)</code></pre>
|
||||
<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">&</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>
|
||||
<pre class="<!---c-->"><code> for (i=0; i&lt;10; i++) {
|
||||
some_code;
|
||||
}
|
||||
other_code;</code></pre>
|
||||
<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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
@@ -15,20 +15,20 @@ require it?](../../faq.html#imagemagick).
|
||||
Look here to find some [SVG Viewer
|
||||
Implementations](https://www.w3.org/Graphics/SVG/WG/wiki/Implementations).
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./boutines < input > output.svg
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
If `ruby` is installed [try.sh](try.sh) will generate an SVG file by:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
ruby -e '20.times{puts "#{rand} #{rand}"}' | ./boutines > test.svg
|
||||
```
|
||||
|
||||
@@ -75,7 +75,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
|
||||
```<!---sh-->
|
||||
./boutines | gzip > result.svg.gz
|
||||
```
|
||||
|
||||
|
||||
@@ -141,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>
|
||||
<pre class="<!---sh-->"><code> make</code></pre>
|
||||
<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>.
|
||||
@@ -149,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"><</span> input <span class="op">></span> output.svg</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./boutines < input > output.svg</code></pre>
|
||||
<h2 id="try">Try:</h2>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./try.sh</code></pre>
|
||||
<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">'20.times{puts "#{rand} #{rand}"}'</span> <span class="kw">|</span> <span class="ex">./boutines</span> <span class="op">></span> test.svg</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ruby -e '20.times{puts "#{rand} #{rand}"}' | ./boutines > test.svg</code></pre>
|
||||
<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
|
||||
@@ -178,7 +178,7 @@ 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">></span> result.svg.gz</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./boutines | gzip > result.svg.gz</code></pre>
|
||||
<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
|
||||
|
||||
+2
-2
@@ -1,13 +1,13 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./chia
|
||||
```
|
||||
|
||||
|
||||
@@ -141,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>
|
||||
<pre class="<!---sh-->"><code> make</code></pre>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./chia</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./chia</code></pre>
|
||||
<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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
@@ -21,21 +21,21 @@ For more detailed information see [2005 giljade bugs](../../bugs.html#2005_gilja
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./giljade
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
|
||||
### Self-test feature to try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./giljade > out
|
||||
./giljade out
|
||||
```
|
||||
@@ -52,7 +52,7 @@ Control-F.
|
||||
|
||||
If you really understand expressions, then understand this:
|
||||
|
||||
```c
|
||||
```<!---c-->
|
||||
s=s^(b=s&s-1^s)
|
||||
```
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ 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>
|
||||
<pre class="<!---sh-->"><code> make</code></pre>
|
||||
<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>
|
||||
@@ -149,12 +149,12 @@ will not work with it enabled.</p>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> ./giljade</code></pre>
|
||||
<h2 id="try">Try:</h2>
|
||||
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./try.sh</code></pre>
|
||||
<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">></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>
|
||||
<pre class="<!---sh-->"><code> ./giljade > out
|
||||
./giljade out</code></pre>
|
||||
<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>
|
||||
@@ -162,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">&</span>s<span class="op">-</span><span class="dv">1</span><span class="op">^</span>s<span class="op">)</span></span></code></pre></div>
|
||||
<pre class="<!---c-->"><code> s=s^(b=s&s-1^s)</code></pre>
|
||||
<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>
|
||||
|
||||
@@ -6,14 +6,14 @@ haven't already.
|
||||
|
||||
If you have SDL installed:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./jetro
|
||||
```
|
||||
|
||||
|
||||
@@ -145,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>
|
||||
<pre class="<!---sh-->"><code> make</code></pre>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./jetro</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./jetro</code></pre>
|
||||
<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
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./klausler arg1 arg2 | head
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
|
||||
@@ -141,11 +141,11 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
|
||||
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||||
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make</code></pre>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./klausler</span> arg1 arg2 <span class="kw">|</span> <span class="fu">head</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./klausler arg1 arg2 | head</code></pre>
|
||||
<h2 id="try">Try:</h2>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./try.sh</code></pre>
|
||||
<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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
@@ -18,7 +18,7 @@ For more detailed information see [2005 mikeash bugs](../../bugs.html#2005_mikea
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./mikeash
|
||||
```
|
||||
|
||||
@@ -28,7 +28,7 @@ under 64-bit (x86_64, arm64) machines too.
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
@@ -67,7 +67,7 @@ functions.
|
||||
|
||||
Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
echo '(format t "~s" (+ 2 2 ))' | ./mikeash
|
||||
```
|
||||
|
||||
@@ -76,7 +76,7 @@ the lack of a newline are due to the somewhat broken implementation of
|
||||
the format function. More sophisticated arithmetic expressions may be
|
||||
used:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
echo '(format t "~s" (* (+ 2 2 ) (- 5 (/ 9 3 ))))' | ./mikeash
|
||||
```
|
||||
|
||||
@@ -130,7 +130,7 @@ nowhere near
|
||||
Basically, the [LISP][] interpreter is good for some basic math operations, and
|
||||
for running itself. To do the latter, try this:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./mikeash < mikeash.c > mikeash2.c
|
||||
diff mikeash.c mikeash2.c
|
||||
```
|
||||
|
||||
@@ -141,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>
|
||||
<pre class="<!---sh-->"><code> make</code></pre>
|
||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||
<p>The current status of this entry is:</p>
|
||||
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
|
||||
<p>For more detailed information see <a href="../../bugs.html#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>
|
||||
<pre class="<!---sh-->"><code> ./mikeash</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> ./try.sh</code></pre>
|
||||
<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
|
||||
@@ -175,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">'(format t "~s" (+ 2 2 ))'</span> <span class="kw">|</span> <span class="ex">./mikeash</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> echo '(format t "~s" (+ 2 2 ))' | ./mikeash</code></pre>
|
||||
<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">'(format t "~s" (* (+ 2 2 ) (- 5 (/ 9 3 ))))'</span> <span class="kw">|</span> <span class="ex">./mikeash</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> echo '(format t "~s" (* (+ 2 2 ) (- 5 (/ 9 3 ))))' | ./mikeash</code></pre>
|
||||
<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
|
||||
@@ -219,8 +219,8 @@ 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"><</span> mikeash.c <span class="op">></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>
|
||||
<pre class="<!---sh-->"><code> ./mikeash < mikeash.c > mikeash2.c
|
||||
diff mikeash.c mikeash2.c</code></pre>
|
||||
<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>
|
||||
|
||||
+9
-9
@@ -1,6 +1,6 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
@@ -21,7 +21,7 @@ For more detailed information see [2005 mynx bugs](../../bugs.html#2005_mynx).
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./mynx http://<domain>
|
||||
```
|
||||
|
||||
@@ -31,7 +31,7 @@ the issue of https.
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./mynx http://www.textfiles.com
|
||||
|
||||
./mynx manual.html
|
||||
@@ -58,7 +58,7 @@ must just appreciate the entry for what it once was.
|
||||
|
||||
### Alternate build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make alt
|
||||
```
|
||||
|
||||
@@ -68,7 +68,7 @@ must just appreciate the entry for what it once was.
|
||||
Use `mynx.alt` as you would `mynx`. You'd have to specify a port at the end of
|
||||
the URL like:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./mynx.alt https://www.ioccc.org:443
|
||||
```
|
||||
|
||||
@@ -92,13 +92,13 @@ it inspired me to try my hand at writing the client side complement.
|
||||
|
||||
A typical build command would be:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
cc -o mynx mynx.c
|
||||
```
|
||||
|
||||
While some others like to be a little different:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
cc -o mynx mynx.c -lnsl -lsocket
|
||||
```
|
||||
|
||||
@@ -107,13 +107,13 @@ 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:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
cd source ; ./configure ; make
|
||||
```
|
||||
|
||||
After which, the rest of the documentation can be read by saying:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./mynx ../manual.html
|
||||
```
|
||||
|
||||
|
||||
+11
-11
@@ -141,7 +141,7 @@ Location: <a href="../../location.html#CA">CA</a> - <em>Canada</em></li>
|
||||
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||||
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make</code></pre>
|
||||
<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>
|
||||
@@ -149,13 +149,13 @@ as a starting point. See <a href="#alternate-code">alternate code</a> below.</p>
|
||||
<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"><</span>domain<span class="op">></span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./mynx http://<domain></code></pre>
|
||||
<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>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> ./mynx http://www.textfiles.com
|
||||
|
||||
./mynx manual.html</code></pre>
|
||||
<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
|
||||
@@ -171,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>
|
||||
<pre class="<!---sh-->"><code> make alt</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> ./mynx.alt https://www.ioccc.org:443</code></pre>
|
||||
<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>
|
||||
@@ -188,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>
|
||||
<pre class="<!---sh-->"><code> cc -o mynx mynx.c</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> cc -o mynx mynx.c -lnsl -lsocket</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> cd source ; ./configure ; make</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> ./mynx ../manual.html</code></pre>
|
||||
<!--
|
||||
|
||||
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
@@ -10,14 +10,14 @@ setting binary mode on `stdout`. See [alternate code](#alternate-code) below.
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./persano p q [num frames]
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
@@ -49,7 +49,7 @@ Use `persano.alt` as you would `persano` above.
|
||||
|
||||
### Alternate try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./persano.alt 3 16 > knot3-16.gif
|
||||
```
|
||||
|
||||
@@ -80,7 +80,7 @@ knots](https://en.wikipedia.org/wiki/Torus_knot) to standard output.
|
||||
|
||||
### SYNOPSIS
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./persano p q [num frames]
|
||||
```
|
||||
|
||||
@@ -98,14 +98,14 @@ cutting it [^1], until it ends up looking just like a circle embedded in R3 [^2]
|
||||
|
||||
Sample usage:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./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
|
||||
```<!---sh-->
|
||||
./persano 5 2
|
||||
```
|
||||
|
||||
|
||||
@@ -141,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>
|
||||
<pre class="<!---sh-->"><code> make</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> ./persano p q [num frames]</code></pre>
|
||||
<h2 id="try">Try:</h2>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./try.sh</code></pre>
|
||||
<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
|
||||
@@ -162,7 +162,7 @@ let it work with Windows.</p>
|
||||
<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">></span> knot3-16.gif</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./persano.alt 3 16 > knot3-16.gif</code></pre>
|
||||
<p>Follow the same instructions, using different tools if necessary, as the above
|
||||
try section.</p>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
@@ -179,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>
|
||||
<pre class="<!---sh-->"><code> ./persano p q [num frames]</code></pre>
|
||||
<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
|
||||
@@ -190,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">></span> foo.gif</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./persano 3 2 1 > foo.gif</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> ./persano 5 2</code></pre>
|
||||
<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
|
||||
|
||||
+11
-11
@@ -1,6 +1,6 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
@@ -18,14 +18,14 @@ For more detailed information see [2005 sykes bugs](../../bugs.html#2005_sykes).
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./sykes binary_file
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
@@ -44,7 +44,7 @@ We downloaded the [ROM](https://en.wikipedia.org/wiki/ROM_image) contents to use
|
||||
the [emulator](https://en.wikipedia.org/wiki/Emulator) in
|
||||
[PET](https://en.wikipedia.org/wiki/Commodore_PET) mode as follows:
|
||||
|
||||
```sh
|
||||
```<!---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
|
||||
@@ -53,7 +53,7 @@ the [emulator](https://en.wikipedia.org/wiki/Emulator) in
|
||||
|
||||
We then created:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
dd bs=2k count=1 if=/dev/zero of=nullfill.bin
|
||||
```
|
||||
|
||||
@@ -79,7 +79,7 @@ Compile the program, then test the
|
||||
[6502](https://en.wikipedia.org/wiki/MOS_Technology_6502#Technical_description)
|
||||
[emulation](https://en.wikipedia.org/wiki/Emulator) like this:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./sykes 6502test
|
||||
```
|
||||
|
||||
@@ -105,7 +105,7 @@ Make sure you have a [terminal
|
||||
window](https://en.wikipedia.org/wiki/Terminal_emulator) of 40x25 chars or
|
||||
bigger, and then run the emulator like this:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./sykes pet.rom
|
||||
```
|
||||
|
||||
@@ -119,13 +119,13 @@ You should see the startup message. Try typing in some
|
||||
There is an optional numeric parameter, which controls the speed. For a
|
||||
slower cursor blink, try
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./sykes pet.rom 6
|
||||
```
|
||||
|
||||
and for faster
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./sykes pet.rom 2
|
||||
```
|
||||
|
||||
@@ -191,7 +191,7 @@ Supplied as a demonstration is a
|
||||
compiled-for-[6502](https://en.wikipedia.org/wiki/MOS_Technology_6502#Technical_description)
|
||||
version a chess program (heh, I found a use for a previous losing entry :) ). Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./sykes chess
|
||||
```
|
||||
|
||||
@@ -306,7 +306,7 @@ from the Internet. This is to avoid directly infringing any copyright.
|
||||
|
||||
What does this do?
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./sykes pet.rom -1
|
||||
```
|
||||
|
||||
|
||||
+14
-14
@@ -141,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>
|
||||
<pre class="<!---sh-->"><code> make</code></pre>
|
||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||
<p>The current status of this entry is:</p>
|
||||
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
|
||||
<p>For more detailed information see <a href="../../bugs.html#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>
|
||||
<pre class="<!---sh-->"><code> ./sykes binary_file</code></pre>
|
||||
<h2 id="try">Try:</h2>
|
||||
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./try.sh</code></pre>
|
||||
<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
|
||||
@@ -160,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>
|
||||
<pre class="<!---sh-->"><code> 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</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> dd bs=2k count=1 if=/dev/zero of=nullfill.bin</code></pre>
|
||||
<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>
|
||||
@@ -180,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>
|
||||
<pre class="<!---sh-->"><code> ./sykes 6502test</code></pre>
|
||||
<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>
|
||||
@@ -196,15 +196,15 @@ 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>
|
||||
<pre class="<!---sh-->"><code> ./sykes pet.rom</code></pre>
|
||||
<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 "HELLO, WORLD"</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>
|
||||
<pre class="<!---sh-->"><code> ./sykes pet.rom 6</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> ./sykes pet.rom 2</code></pre>
|
||||
<p>The default is 4.</p>
|
||||
<p>The control keys are as follows:</p>
|
||||
<pre><code> ^A HOME
|
||||
@@ -243,7 +243,7 @@ The filenames must be upper case in order to be loaded by the emulator.</p>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> ./sykes chess</code></pre>
|
||||
<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
|
||||
@@ -327,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>
|
||||
<pre class="<!---sh-->"><code> ./sykes pet.rom -1</code></pre>
|
||||
<p>Have fun!</p>
|
||||
<!--
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./timwi < bf_program
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
|
||||
@@ -141,11 +141,11 @@ Location: <a href="../../location.html#DE">DE</a> - <em>Federal Republic of Germ
|
||||
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||||
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make</code></pre>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./timwi</span> <span class="op"><</span> bf_program</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./timwi < bf_program</code></pre>
|
||||
<h2 id="try">Try:</h2>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./try.sh</code></pre>
|
||||
<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
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./toledo [a ...]
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./toledo a
|
||||
./toledo a b
|
||||
```
|
||||
@@ -30,7 +30,7 @@ Two alternate versions of this entry, [toledo2.c](toledo2.c) and
|
||||
|
||||
To compile the alternate versions:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make alt
|
||||
```
|
||||
|
||||
@@ -63,7 +63,7 @@ This is a [chess](https://en.wikipedia.org/wiki/Chess) 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:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./toledo
|
||||
```
|
||||
|
||||
@@ -71,14 +71,14 @@ The other mode is accessible running the program with one argument
|
||||
(5-[ply](https://en.wikipedia.org/wiki/Ply_(game_theory))
|
||||
analysis):
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./toledo a
|
||||
```
|
||||
|
||||
Two arguments for 6-[ply](https://en.wikipedia.org/wiki/Ply_(game_theory))
|
||||
analysis:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./toledo a b
|
||||
```
|
||||
|
||||
|
||||
@@ -141,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>
|
||||
<pre class="<!---sh-->"><code> make</code></pre>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./toledo</span> [a ...]</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./toledo [a ...]</code></pre>
|
||||
<h2 id="try">Try:</h2>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./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>
|
||||
<pre class="<!---sh-->"><code> ./toledo a
|
||||
./toledo a b</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> make alt</code></pre>
|
||||
<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>
|
||||
@@ -170,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>
|
||||
<pre class="<!---sh-->"><code> ./toledo</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> ./toledo a</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> ./toledo a b</code></pre>
|
||||
<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
|
||||
|
||||
+7
-7
@@ -1,20 +1,20 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./vik [file.map]
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./vik maze.map
|
||||
```
|
||||
|
||||
@@ -60,7 +60,7 @@ Compile the source code and link in [X
|
||||
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
|
||||
```<!---sh-->
|
||||
./vik [-w <width>] [mapfile]
|
||||
```
|
||||
|
||||
@@ -75,20 +75,20 @@ where:
|
||||
|
||||
Start the engine using a built in labyrinth and texture bitmaps:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./vik
|
||||
```
|
||||
|
||||
Start the engine and loads the labyrinth defined in the file
|
||||
[maze.map](maze.map):
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./vik maze.map
|
||||
```
|
||||
|
||||
Start the engine using [maze.map](maze.map) in a window that is 400 pixels wide:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./vik -w 400 maze.map
|
||||
```
|
||||
|
||||
|
||||
+7
-7
@@ -141,11 +141,11 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
|
||||
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||||
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make</code></pre>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./vik</span> <span class="pp">[</span><span class="ss">file.map</span><span class="pp">]</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./vik [file.map]</code></pre>
|
||||
<h2 id="try">Try:</h2>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./vik</span> maze.map</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./vik maze.map</code></pre>
|
||||
<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
|
||||
@@ -177,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"><</span>width<span class="op">></span>] <span class="pp">[</span><span class="ss">mapfile</span><span class="pp">]</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./vik [-w <width>] [mapfile]</code></pre>
|
||||
<p>where:</p>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> ./vik</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> ./vik maze.map</code></pre>
|
||||
<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>
|
||||
<pre class="<!---sh-->"><code> ./vik -w 400 maze.map</code></pre>
|
||||
<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>
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
Before building, make sure that you have the OpenGL development libraries
|
||||
installed.
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./vince
|
||||
```
|
||||
|
||||
@@ -31,7 +31,7 @@ also has the recursive `CPP` macro (which sneaked in accidentally) removed.
|
||||
|
||||
To compile this alternate version:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make alt
|
||||
```
|
||||
|
||||
|
||||
@@ -143,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>
|
||||
<pre class="<!---sh-->"><code> make</code></pre>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./vince</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./vince</code></pre>
|
||||
<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>
|
||||
@@ -154,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>
|
||||
<pre class="<!---sh-->"><code> make alt</code></pre>
|
||||
<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>
|
||||
|
||||
Reference in new issue
Block a user