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
@@ -1,6 +1,6 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
@@ -18,14 +18,14 @@ For more detailed information see [2006 birken bugs](../../bugs.html#2006_birken
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./birken < file.tofu
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
|
||||
@@ -141,15 +141,15 @@ 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: uses gets() - change to fgets() if possible</code></pre>
|
||||
<p>For more detailed information see <a href="../../bugs.html#2006_birken">2006 birken 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">./birken</span> <span class="op"><</span> file.tofu</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./birken < file.tofu</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>
|
||||
<p>etc.</p>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>Q: EDAMAME?</p>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
@@ -18,14 +18,14 @@ For more detailed information see [2006 borsanyi bugs](../../bugs.html#2006_bors
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./borsanyi string > file.gif
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
@@ -68,7 +68,7 @@ used. A typical email address is stored in less than 1-2 kilobytes.
|
||||
|
||||
### Usage:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make all
|
||||
./borsanyi my@example.com > email.gif
|
||||
my_favourite_gif_viewer email.gif
|
||||
|
||||
@@ -141,15 +141,15 @@ 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>
|
||||
<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#2006_borsanyi">2006 borsanyi 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">./borsanyi</span> string <span class="op">></span> file.gif</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./borsanyi string > file.gif</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>
|
||||
<p>We recommend you input for the filename <code>example.gif</code> and for the string
|
||||
<code>ioccc@example.com</code>. The script will not overwrite files. It runs the program in
|
||||
a loop until you answer that you do not wish to make another.</p>
|
||||
@@ -175,9 +175,9 @@ line. To avoid complications with patent issues the <a href="https://en.wikipedi
|
||||
compression</a> feature is not
|
||||
used. A typical email address is stored in less than 1-2 kilobytes.</p>
|
||||
<h3 id="usage">Usage:</h3>
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> all</span>
|
||||
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./borsanyi</span> my@example.com <span class="op">></span> email.gif</span>
|
||||
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">my_favourite_gif_viewer</span> email.gif</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make all
|
||||
./borsanyi my@example.com > email.gif
|
||||
my_favourite_gif_viewer email.gif</code></pre>
|
||||
<p>The address cannot be longer than 42 characters, and may consist of
|
||||
the characters: <code>a-z_A-Z0-9@.-</code>.</p>
|
||||
<p>The program is (like email addresses are) case insensitive.</p>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./grothe carrier_freq pixelclock horizontal_total < some_input.txt
|
||||
```
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
Put on your "electronic ears" and then try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
@@ -50,13 +50,13 @@ parameters:
|
||||
If you have `xvidtune` installed you can get the `pixelclock` and
|
||||
`horizontal_total` with the following command
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
xvidtune -show | head -n 1 | awk '{ print "pixelclock " $2 * 1000000 " horizontal_total = " $6 }'
|
||||
```
|
||||
|
||||
Example from my laptops:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./grothe 65000000 10000000 1344 < twinkle.txt
|
||||
```
|
||||
|
||||
|
||||
@@ -141,12 +141,12 @@ 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">./grothe</span> carrier_freq pixelclock horizontal_total <span class="op"><</span> some_input.txt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./grothe carrier_freq pixelclock horizontal_total < some_input.txt</code></pre>
|
||||
<h2 id="try">Try:</h2>
|
||||
<p>Put on your “electronic ears” and then try:</p>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./try.sh</code></pre>
|
||||
<p>You may find using
|
||||
a tunable scanning electronic ear helps.</p>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
@@ -165,9 +165,9 @@ parameters:</p>
|
||||
horizontal_total - total scan along the horizontal axis</code></pre>
|
||||
<p>If you have <code>xvidtune</code> installed you can get the <code>pixelclock</code> and
|
||||
<code>horizontal_total</code> with the following command</p>
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">xvidtune</span> <span class="at">-show</span> <span class="kw">|</span> <span class="fu">head</span> <span class="at">-n</span> 1 <span class="kw">|</span> <span class="fu">awk</span> <span class="st">'{ print "pixelclock " $2 * 1000000 " horizontal_total = " $6 }'</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> xvidtune -show | head -n 1 | awk '{ print "pixelclock " $2 * 1000000 " horizontal_total = " $6 }'</code></pre>
|
||||
<p>Example from my laptops:</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">./grothe</span> 65000000 10000000 1344 <span class="op"><</span> twinkle.txt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./grothe 65000000 10000000 1344 < twinkle.txt</code></pre>
|
||||
<p>Even if the user gets a setting off, the sound will usually be able to be
|
||||
heard on <a href="https://en.wikipedia.org/wiki/AM_broadcasting">AM</a> at a multiple of
|
||||
the original frequency.</p>
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./hamre math_expression_string
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
@@ -42,7 +42,7 @@ supported operators are: `+`, `-` (binary and unary), `*`, `/` and `()`. Run it
|
||||
by supplying an expression as the first argument, and the normalized
|
||||
result will be written to `stdout`.
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./hamre '-1+4/3*(2+1/(3/2*(7/2-7/3+1/6)))/2'
|
||||
2/3
|
||||
```
|
||||
|
||||
@@ -141,11 +141,11 @@ Location: <a href="../../location.html#NO">NO</a> - <em>Kingdom of Norway</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>
|
||||
<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">./hamre</span> math_expression_string</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./hamre math_expression_string</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>An irrationally coded source presents rational things!</p>
|
||||
<p>A rational person might want to attempt the
|
||||
@@ -162,8 +162,8 @@ an obfuscated one.</p>
|
||||
supported operators are: <code>+</code>, <code>-</code> (binary and unary), <code>*</code>, <code>/</code> and <code>()</code>. Run it
|
||||
by supplying an expression as the first argument, and the normalized
|
||||
result will be written to <code>stdout</code>.</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">./hamre</span> <span class="st">'-1+4/3*(2+1/(3/2*(7/2-7/3+1/6)))/2'</span></span>
|
||||
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">2/3</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./hamre '-1+4/3*(2+1/(3/2*(7/2-7/3+1/6)))/2'
|
||||
2/3</code></pre>
|
||||
<p>If you do not supply an argument, the calculator will crash. Other
|
||||
arguments are ignored. Supplying more arguments may further limit the
|
||||
number of nested operators supported.</p>
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./meyer [SEED]
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./meyer [SEED]
|
||||
```
|
||||
|
||||
@@ -75,7 +75,7 @@ you write is what it does'). It may be tempting to think that
|
||||
|
||||
might do something similar as
|
||||
|
||||
```c
|
||||
```<!---c-->
|
||||
struct not_an_object o;
|
||||
```
|
||||
|
||||
@@ -100,7 +100,7 @@ implementation in a popular object-oriented programming language.
|
||||
|
||||
### Starting the game
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./meyer [SEED]
|
||||
```
|
||||
|
||||
|
||||
@@ -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">./meyer</span> <span class="pp">[</span><span class="ss">SEED</span><span class="pp">]</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./meyer [SEED]</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">./meyer</span> <span class="pp">[</span><span class="ss">SEED</span><span class="pp">]</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./meyer [SEED]</code></pre>
|
||||
<p>For your first input try:</p>
|
||||
<pre><code> a 0 1</code></pre>
|
||||
<p>where <code>a</code> is the row (<code>a</code>-<code>i</code>), <code>0</code> is the column (<code>0</code>-<code>8</code>) and <code>1</code> is the
|
||||
@@ -183,7 +183,7 @@ it is obvious, that object-oriented code isn’t ‘<code>WYWIWID</code>’ (‘
|
||||
you write is what it does’). It may be tempting to think that</p>
|
||||
<pre><code> Object o;</code></pre>
|
||||
<p>might do something similar as</p>
|
||||
<div class="sourceCode" id="cb6"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a> <span class="kw">struct</span> not_an_object o<span class="op">;</span></span></code></pre></div>
|
||||
<pre class="<!---c-->"><code> struct not_an_object o;</code></pre>
|
||||
<p>But this program reveals that it doesn’t. Even worse, this program only
|
||||
reveals the tip of the iceberg, what kind of black magic is involved in
|
||||
a simple declaration of an object.</p>
|
||||
@@ -201,7 +201,7 @@ and <a href="https://en.wikipedia.org/wiki/Polymorphism_(computer_science)">poly
|
||||
<p>It is left as an exercise to the reader to find a corresponding
|
||||
implementation in a popular object-oriented programming language.</p>
|
||||
<h3 id="starting-the-game">Starting the game</h3>
|
||||
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./meyer</span> <span class="pp">[</span><span class="ss">SEED</span><span class="pp">]</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./meyer [SEED]</code></pre>
|
||||
<h3 id="gameplay">Gameplay</h3>
|
||||
<p>It is a <a href="https://en.wikipedia.org/wiki/Sudoku">sudoku</a> based game. The goal of
|
||||
the game is to be able to do the last valid ‘move’.</p>
|
||||
|
||||
+17
-17
@@ -2,7 +2,7 @@
|
||||
|
||||
Make sure you have the SDL1 (not SDL2!) development environment installed.
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
@@ -24,7 +24,7 @@ For more detailed information see [2006 monge bugs](../../bugs.html#2006_monge).
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./monge expression ...
|
||||
```
|
||||
|
||||
@@ -33,7 +33,7 @@ Incorrect formulas will ungracefully crash the program.
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
@@ -49,7 +49,7 @@ as the number of iterations to perform.
|
||||
To use the default values, the same as [monge.c](monge.c), just do:
|
||||
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make alt
|
||||
```
|
||||
|
||||
@@ -58,13 +58,13 @@ of the variables `W`, `H` and `I`. The defaults are (respectively) 400, 300 and
|
||||
\128. If you wish to change the image size to 500x500 but keep the iterations
|
||||
the same then do:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make clobber WIDTH=500 HEIGHT=500 alt
|
||||
```
|
||||
|
||||
If you wish to keep the dimensions the same but change the iterations to 512:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make clobber ITERATIONS=512 alt
|
||||
```
|
||||
|
||||
@@ -82,7 +82,7 @@ Use `monge.alt` exactly as you would `monge` above.
|
||||
|
||||
### Alternate try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.alt.sh
|
||||
```
|
||||
|
||||
@@ -109,13 +109,13 @@ effort to work on both `i386` and `x86_64`. Portable it is! :)
|
||||
|
||||
0. Compile using the Makefile, or just run:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
gcc monge.c -o monge -O3 `sdl-config --libs --cflags`
|
||||
```
|
||||
|
||||
1. Run:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./monge "z = 0" "z = z*z + c; Abs2(z) < 4"
|
||||
```
|
||||
|
||||
@@ -171,49 +171,49 @@ Here are a few examples of fractals you can draw:
|
||||
|
||||
- Mandelbrot:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./monge "z=1" "z=z*z+c; Abs2(z)<4"
|
||||
```
|
||||
|
||||
- Mandelbrot (return time variation):
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./monge "z=c" "z=z*z+c; Abs2(z-c)>0.0001"
|
||||
```
|
||||
|
||||
- Julia, for `c=0.31+i*0.5`:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./monge "z=c; c=0.31+i*0.5" "z=z*z+c; Abs2(z)<4"
|
||||
```
|
||||
|
||||
- Julia (return time variation), `for c=0.31+i*0.5`:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./monge "z=c; c=0.31+i*0.5" "z=z*z+c; Abs2(z-c)>0.0001"
|
||||
```
|
||||
|
||||
- Newton, for `x^3-1`:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./monge "z=c" "p=z; z=0.6666*z+0.3333/(z*z); Abs2(p-z) > 0.001"
|
||||
```
|
||||
|
||||
- Newton-Mandelbrot:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./monge "z=0" "p=z; z=z-(z*z*z + (c-1)*z - c)/(3*z*z+c-1); Abs2(p-z) > 0.001"
|
||||
```
|
||||
|
||||
- Phoenix, Mandelbrot version:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./monge "z=0; q=0" "t=z; z=z*z+Re(c)+Im(c)*q; q=t; Abs2(z)<4"
|
||||
```
|
||||
|
||||
- Phoenix, Julia version for `c=0.56667-i*0.5`:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./monge "z=c; c=0.56667-i*0.5; q=0" "t=z; z=z*z+Re(c)+Im(c)*q; q=t; Abs2(z)<4"
|
||||
```
|
||||
|
||||
|
||||
+17
-17
@@ -142,7 +142,7 @@ Location: <a href="../../location.html#IT">IT</a> - <em>Italian Republic</em> (<
|
||||
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<p>Make sure you have the SDL1 (not SDL2!) development environment 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>
|
||||
<p>There is alternate version that lets you redefine the width and height and number
|
||||
of iterations to use. See <a href="#alternate-code">Alternate code</a> below.</p>
|
||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||
@@ -151,23 +151,23 @@ of iterations to use. See <a href="#alternate-code">Alternate code</a> below.</p
|
||||
STATUS: INABIAF - please **DO NOT** fix</code></pre>
|
||||
<p>For more detailed information see <a href="../../bugs.html#2006_monge">2006 monge 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">./monge</span> expression ...</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./monge expression ...</code></pre>
|
||||
<p>Incorrect formulas will ungracefully crash the program.</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="alternate-code">Alternate code:</h2>
|
||||
<p>This alternate code lets you specify the width and height of the image as well
|
||||
as the number of iterations to perform.</p>
|
||||
<h3 id="alternate-build">Alternate build:</h3>
|
||||
<p>To use the default values, the same as <a href="monge.c">monge.c</a>, just do:</p>
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> alt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make alt</code></pre>
|
||||
<p>But if you wish to actually make use of it you will want to redefine one or more
|
||||
of the variables <code>W</code>, <code>H</code> and <code>I</code>. The defaults are (respectively) 400, 300 and
|
||||
\128. If you wish to change the image size to 500x500 but keep the iterations
|
||||
the same then do:</p>
|
||||
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> clobber WIDTH=500 HEIGHT=500 alt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make clobber WIDTH=500 HEIGHT=500 alt</code></pre>
|
||||
<p>If you wish to keep the dimensions the same but change the iterations to 512:</p>
|
||||
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> clobber ITERATIONS=512 alt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make clobber ITERATIONS=512 alt</code></pre>
|
||||
<p>If you specify a value less than 1 for any of these it sets it back to the
|
||||
default. The value 1 was selected arbitrarily and such a small number as 1 will
|
||||
not do anything useful but as long as it’s at least 1 it’ll not be redefined.
|
||||
@@ -176,7 +176,7 @@ anyway.</p>
|
||||
<h3 id="alternate-use">Alternate use:</h3>
|
||||
<p>Use <code>monge.alt</code> exactly as you would <code>monge</code> above.</p>
|
||||
<h3 id="alternate-try">Alternate try:</h3>
|
||||
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./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>For those who are familiar with the previous <a href="../../authors.html">IOCCC entries</a>,
|
||||
this program is best described as “<a href="../../1994/tvr/index.html">1994/tvr</a> meets
|
||||
@@ -193,11 +193,11 @@ effort to work on both <code>i386</code> and <code>x86_64</code>. Portable it is
|
||||
<ol start="0" type="1">
|
||||
<li>Compile using the Makefile, or just run:</li>
|
||||
</ol>
|
||||
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">gcc</span> monge.c <span class="at">-o</span> monge <span class="at">-O3</span> <span class="kw">`</span><span class="ex">sdl-config</span> <span class="at">--libs</span> <span class="at">--cflags</span><span class="kw">`</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> gcc monge.c -o monge -O3 `sdl-config --libs --cflags`</code></pre>
|
||||
<ol type="1">
|
||||
<li>Run:</li>
|
||||
</ol>
|
||||
<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">./monge</span> <span class="st">"z = 0"</span> <span class="st">"z = z*z + c; Abs2(z) < 4"</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./monge "z = 0" "z = z*z + c; Abs2(z) < 4"</code></pre>
|
||||
<ol start="2" type="1">
|
||||
<li><p>Keep clicking with left or right button to zoom in or out.</p></li>
|
||||
<li><p>Use the number pad <code>+</code> and <code>-</code> to increase/decrease the iteration count when
|
||||
@@ -240,35 +240,35 @@ as you like (as understood by the C function <code>isspace()</code>).</p>
|
||||
<ul>
|
||||
<li>Mandelbrot:</li>
|
||||
</ul>
|
||||
<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">./monge</span> <span class="st">"z=1"</span> <span class="st">"z=z*z+c; Abs2(z)<4"</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./monge "z=1" "z=z*z+c; Abs2(z)<4"</code></pre>
|
||||
<ul>
|
||||
<li>Mandelbrot (return time variation):</li>
|
||||
</ul>
|
||||
<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">./monge</span> <span class="st">"z=c"</span> <span class="st">"z=z*z+c; Abs2(z-c)>0.0001"</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./monge "z=c" "z=z*z+c; Abs2(z-c)>0.0001"</code></pre>
|
||||
<ul>
|
||||
<li>Julia, for <code>c=0.31+i*0.5</code>:</li>
|
||||
</ul>
|
||||
<div class="sourceCode" id="cb14"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./monge</span> <span class="st">"z=c; c=0.31+i*0.5"</span> <span class="st">"z=z*z+c; Abs2(z)<4"</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./monge "z=c; c=0.31+i*0.5" "z=z*z+c; Abs2(z)<4"</code></pre>
|
||||
<ul>
|
||||
<li>Julia (return time variation), <code>for c=0.31+i*0.5</code>:</li>
|
||||
</ul>
|
||||
<div class="sourceCode" id="cb15"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./monge</span> <span class="st">"z=c; c=0.31+i*0.5"</span> <span class="st">"z=z*z+c; Abs2(z-c)>0.0001"</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./monge "z=c; c=0.31+i*0.5" "z=z*z+c; Abs2(z-c)>0.0001"</code></pre>
|
||||
<ul>
|
||||
<li>Newton, for <code>x^3-1</code>:</li>
|
||||
</ul>
|
||||
<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">./monge</span> <span class="st">"z=c"</span> <span class="st">"p=z; z=0.6666*z+0.3333/(z*z); Abs2(p-z) > 0.001"</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./monge "z=c" "p=z; z=0.6666*z+0.3333/(z*z); Abs2(p-z) > 0.001"</code></pre>
|
||||
<ul>
|
||||
<li>Newton-Mandelbrot:</li>
|
||||
</ul>
|
||||
<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">./monge</span> <span class="st">"z=0"</span> <span class="st">"p=z; z=z-(z*z*z + (c-1)*z - c)/(3*z*z+c-1); Abs2(p-z) > 0.001"</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./monge "z=0" "p=z; z=z-(z*z*z + (c-1)*z - c)/(3*z*z+c-1); Abs2(p-z) > 0.001"</code></pre>
|
||||
<ul>
|
||||
<li>Phoenix, Mandelbrot version:</li>
|
||||
</ul>
|
||||
<div class="sourceCode" id="cb18"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./monge</span> <span class="st">"z=0; q=0"</span> <span class="st">"t=z; z=z*z+Re(c)+Im(c)*q; q=t; Abs2(z)<4"</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./monge "z=0; q=0" "t=z; z=z*z+Re(c)+Im(c)*q; q=t; Abs2(z)<4"</code></pre>
|
||||
<ul>
|
||||
<li>Phoenix, Julia version for <code>c=0.56667-i*0.5</code>:</li>
|
||||
</ul>
|
||||
<div class="sourceCode" id="cb19"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./monge</span> <span class="st">"z=c; c=0.56667-i*0.5; q=0"</span> <span class="st">"t=z; z=z*z+Re(c)+Im(c)*q; q=t; Abs2(z)<4"</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./monge "z=c; c=0.56667-i*0.5; q=0" "t=z; z=z*z+Re(c)+Im(c)*q; q=t; Abs2(z)<4"</code></pre>
|
||||
<h3 id="compilation-and-portability">Compilation and portability</h3>
|
||||
<p>This program will only work on x86 (with an x87 FPU) or x86_64 machines,
|
||||
but it requires the SDL library.</p>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
@@ -10,7 +10,7 @@ code](#alternate-code) section below.
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./night
|
||||
```
|
||||
|
||||
@@ -23,7 +23,7 @@ keys.
|
||||
|
||||
### Alternate build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make alt
|
||||
```
|
||||
|
||||
@@ -129,7 +129,7 @@ to deobfuscate.
|
||||
Keypad support was removed to save space. To restore, modify the
|
||||
following two macros to:
|
||||
|
||||
```c
|
||||
```<!---c-->
|
||||
#define ATG srand(time(0)); initscr(); cbreak(); noecho(); start_color(); keypad(stdscr,1);
|
||||
#define AGG A&2?KEY_UP:KEY_DOWN:A&1?KEY_RIGHT:KEY_LEFT
|
||||
```
|
||||
|
||||
@@ -141,16 +141,16 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
|
||||
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||||
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make</code></pre>
|
||||
<p>There is an alternate version that supports arrow keys. See the <a href="#alternate-code">alternate
|
||||
code</a> section below.</p>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./night</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./night</code></pre>
|
||||
<h2 id="alternate-code">Alternate code:</h2>
|
||||
<p>This version allows you to use arrow keys instead of the more awkward <code>wasd</code>
|
||||
keys.</p>
|
||||
<h3 id="alternate-build">Alternate build:</h3>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> alt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make alt</code></pre>
|
||||
<h3 id="alternate-use">Alternate use:</h3>
|
||||
<p>Use <code>night.alt</code> as you would <code>night</code> above.</p>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
@@ -217,8 +217,8 @@ preprocessed code is over 80KB in length, hindering the preprocessor’s ability
|
||||
to deobfuscate.</p>
|
||||
<p>Keypad support was removed to save space. To restore, modify the
|
||||
following two macros to:</p>
|
||||
<div class="sourceCode" id="cb4"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define ATG srand</span><span class="op">(</span><span class="pp">time</span><span class="op">(</span><span class="dv">0</span><span class="op">));</span><span class="pp"> initscr</span><span class="op">();</span><span class="pp"> cbreak</span><span class="op">();</span><span class="pp"> noecho</span><span class="op">();</span><span class="pp"> start_color</span><span class="op">();</span><span class="pp"> keypad</span><span class="op">(</span><span class="pp">stdscr</span><span class="op">,</span><span class="dv">1</span><span class="op">);</span></span>
|
||||
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="pp">#define AGG A</span><span class="op">&</span><span class="dv">2</span><span class="op">?</span><span class="pp">KEY_UP</span><span class="op">:</span><span class="pp">KEY_DOWN</span><span class="op">:</span><span class="pp">A</span><span class="op">&</span><span class="dv">1</span><span class="op">?</span><span class="pp">KEY_RIGHT</span><span class="op">:</span><span class="pp">KEY_LEFT</span></span></code></pre></div>
|
||||
<pre class="<!---c-->"><code> #define ATG srand(time(0)); initscr(); cbreak(); noecho(); start_color(); keypad(stdscr,1);
|
||||
#define AGG A&2?KEY_UP:KEY_DOWN:A&1?KEY_RIGHT:KEY_LEFT</code></pre>
|
||||
<p>Code on!</p>
|
||||
<!--
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make alt
|
||||
```
|
||||
|
||||
@@ -11,7 +11,7 @@ code](#original-code) below.
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./slone.alt
|
||||
```
|
||||
|
||||
@@ -24,7 +24,7 @@ problematic for some people, can be configured to different speeds by way of the
|
||||
value used in `usleep()`. The default is `75000` but you can easily change
|
||||
it. To do so try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make clobber SLEEP=70000 clobber alt
|
||||
./sloane.alt
|
||||
```
|
||||
@@ -32,7 +32,7 @@ it. To do so try:
|
||||
If you wish to make it like the original, as if the below [Original
|
||||
code](#original-code) was being used, you can do:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make SLEEP=0 clobber alt
|
||||
./sloane.alt
|
||||
```
|
||||
@@ -46,14 +46,14 @@ Should you wish to see the original you may do so with the original code,
|
||||
|
||||
### Original build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make clobber all
|
||||
```
|
||||
|
||||
|
||||
### Original use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./sloane
|
||||
```
|
||||
|
||||
|
||||
@@ -141,31 +141,31 @@ 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> alt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make alt</code></pre>
|
||||
<p>We recommend the alt version so that you can see what this looked like back in 2006.
|
||||
If you wish to see the original faster version see <a href="#original-code">original
|
||||
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">./slone.alt</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./slone.alt</code></pre>
|
||||
<h2 id="try">Try:</h2>
|
||||
<p>The alternate version, which we recommend that you use in order to see what is
|
||||
happening with modern systems, and to not flash too quickly, which can be
|
||||
problematic for some people, can be configured to different speeds by way of the
|
||||
value used in <code>usleep()</code>. The default is <code>75000</code> but you can easily change
|
||||
it. To do so try:</p>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> clobber SLEEP=70000 clobber alt</span>
|
||||
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./sloane.alt</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make clobber SLEEP=70000 clobber alt
|
||||
./sloane.alt</code></pre>
|
||||
<p>If you wish to make it like the original, as if the below <a href="#original-code">Original
|
||||
code</a> was being used, you can do:</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> SLEEP=0 clobber alt</span>
|
||||
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./sloane.alt</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make SLEEP=0 clobber alt
|
||||
./sloane.alt</code></pre>
|
||||
<h2 id="original-code">Original code:</h2>
|
||||
<p>Should you wish to see the original you may do so with the original code,
|
||||
<a href="sloane.c">sloane.c</a>.</p>
|
||||
<h3 id="original-build">Original build:</h3>
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> clobber all</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make clobber all</code></pre>
|
||||
<h3 id="original-use">Original use:</h3>
|
||||
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./sloane</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./sloane</code></pre>
|
||||
<p>WARNING: if you are easily overstimulated with fast movement or have
|
||||
photosensitivity please be careful running this version and instead see the
|
||||
above!</p>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./stewart width_and_height iterations file > file.xbm
|
||||
convert file.xbm file.png
|
||||
```
|
||||
@@ -29,7 +29,7 @@ NOTE: `convert(1)` belongs to [ImageMagick](https://imagemagick.org/index.php).
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
@@ -58,7 +58,7 @@ a reasonably experienced user who can parse formats in their mind. :-)
|
||||
|
||||
The program should be run with the following
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./stewart <m> <n> <ifs>
|
||||
```
|
||||
|
||||
@@ -77,7 +77,7 @@ are 3. Wrong arguments will cause the program to bomb out.
|
||||
|
||||
#### Example:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./stewart 1024 1000000 gasket > gasket.xbm
|
||||
```
|
||||
|
||||
|
||||
@@ -141,10 +141,10 @@ 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">./stewart</span> width_and_height iterations file <span class="op">></span> file.xbm</span>
|
||||
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">convert</span> file.xbm file.png</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./stewart width_and_height iterations file > file.xbm
|
||||
convert file.xbm file.png</code></pre>
|
||||
<p>where <code>file</code> is one of:</p>
|
||||
<pre><code> altar box box2 box3 build carpet circles cross cross2 cross3
|
||||
crystal curve diamonds diamonds2 dragon dragon2 dragon3
|
||||
@@ -154,7 +154,7 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
|
||||
<p>NOTE: you cannot specify a different width from height; it’s one number.</p>
|
||||
<p>NOTE: <code>convert(1)</code> belongs to <a href="https://imagemagick.org/index.php">ImageMagick</a>.</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>
|
||||
<p>After running the program on a few files it will ask you if you wish to run it
|
||||
on the remaining files.</p>
|
||||
<p>The script will try converting the xbm files created by the program to png
|
||||
@@ -171,7 +171,7 @@ a reasonably experienced user who can parse formats in their mind. :-)</p>
|
||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||
<h3 id="execution">Execution</h3>
|
||||
<p>The program should be run with the following</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">./stewart</span> <span class="op"><</span>m<span class="op">></span> <span class="op"><</span>n<span class="op">></span> <span class="op"><</span>ifs<span class="op">></span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./stewart <m> <n> <ifs></code></pre>
|
||||
<p>where:</p>
|
||||
<pre><code> m = The size of the picture (picture will be m X m in size).
|
||||
n = The number of iterations to run (More will make for a
|
||||
@@ -181,7 +181,7 @@ a reasonably experienced user who can parse formats in their mind. :-)</p>
|
||||
on standard out. Minimal checking is done on the arguments mainly that there
|
||||
are 3. Wrong arguments will cause the program to bomb out.</p>
|
||||
<h4 id="example">Example:</h4>
|
||||
<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">./stewart</span> 1024 1000000 gasket <span class="op">></span> gasket.xbm</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./stewart 1024 1000000 gasket > gasket.xbm</code></pre>
|
||||
<h3 id="compilationtesting">Compilation/Testing</h3>
|
||||
<p>The program compiles without warning with <code>gcc -ansi -Wall</code>.
|
||||
<code>lint</code> also seems to like the code. This must be a bug in <code>lint</code>.</p>
|
||||
|
||||
+13
-13
@@ -1,6 +1,6 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
@@ -22,7 +22,7 @@ For more detailed information see [2006 sykes1 bugs](../../bugs.html#2006_sykes1
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./sykes1
|
||||
```
|
||||
|
||||
@@ -31,7 +31,7 @@ Next point your browser to the file: `sykes1.html`.
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./sykes1 10
|
||||
```
|
||||
|
||||
@@ -39,7 +39,7 @@ Refresh your browser.
|
||||
|
||||
You might also try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
@@ -52,7 +52,7 @@ If you have all day :-) and wish to find out how fast your machine can solve the
|
||||
maximum:
|
||||
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
time ./sykes1 19186
|
||||
```
|
||||
|
||||
@@ -81,7 +81,7 @@ This alternate code is based on the author's remarks.
|
||||
|
||||
### Alternate build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make alt
|
||||
```
|
||||
|
||||
@@ -96,7 +96,7 @@ Use `sykes1.alt` as you would `sykes1` above.
|
||||
The [try.sh](try.sh) script will use both versions to show some differences. You
|
||||
can do so like:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
@@ -106,7 +106,7 @@ can do so like:
|
||||
Read the [sykes1.html](sykes1.html) page source.
|
||||
Now then read the C source. Confused? :-) If it's not clear try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
diff -s sykes1.c sykes1.html
|
||||
```
|
||||
|
||||
@@ -138,7 +138,7 @@ need to be very lucky indeed to stumble across a solution.
|
||||
|
||||
Compile the program, then test that it works:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./sykes1
|
||||
```
|
||||
|
||||
@@ -154,7 +154,7 @@ cube. Rendered in glorious 3D color.
|
||||
|
||||
Want to see another solution? Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./sykes1 some_number
|
||||
```
|
||||
|
||||
@@ -165,7 +165,7 @@ Try some more - there are exactly `19186` solutions to choose from.
|
||||
|
||||
If you have a fast machine you might try the last solution:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./sykes1 19186
|
||||
```
|
||||
|
||||
@@ -178,7 +178,7 @@ The implementation is an optimized recursive algorithm that tries to fit
|
||||
the pieces into the cube one by one. The cube pieces are defined near
|
||||
the start of the program:
|
||||
|
||||
```c
|
||||
```<!---c-->
|
||||
int s[ ] = { 186, 94, 1426, 3098
|
||||
,1047 , 122 , 1082 , 3083 , 1039
|
||||
, 569 , 527 , 1054 , 531 } ;
|
||||
@@ -233,7 +233,7 @@ the pieces, and provided that a solution is possible, it will be found.
|
||||
For example, if you modify line 13 of the source like this, the program
|
||||
will solve for a different piece set:
|
||||
|
||||
```c
|
||||
```<!---c-->
|
||||
int s[ ] = { 187, 94, 402, 3098
|
||||
```
|
||||
|
||||
|
||||
+15
-15
@@ -141,7 +141,7 @@ 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>
|
||||
<p>There is an alt version based on the author’s remarks. The <a href="try.sh">try.sh</a>
|
||||
script will compile and use both but if you wish to see the alternate version
|
||||
specifically see the <a href="#alternate-code">Alternate code</a> section below.</p>
|
||||
@@ -150,18 +150,18 @@ specifically see the <a href="#alternate-code">Alternate code</a> section below.
|
||||
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
|
||||
<p>For more detailed information see <a href="../../bugs.html#2006_sykes1">2006 sykes1 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">./sykes1</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./sykes1</code></pre>
|
||||
<p>Next point your browser to the file: <code>sykes1.html</code>.</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">./sykes1</span> 10</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./sykes1 10</code></pre>
|
||||
<p>Refresh your browser.</p>
|
||||
<p>You might also try:</p>
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./try.sh</code></pre>
|
||||
<p>This will run both the original entry and the alt code to show some differences.</p>
|
||||
<h3 id="also-try">Also try:</h3>
|
||||
<p>If you have all day :-) and wish to find out how fast your machine can solve the
|
||||
maximum:</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">time</span> ./sykes1 19186</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> time ./sykes1 19186</code></pre>
|
||||
<p>This was done on a Rocky Linux 9.2 server with <code>Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz</code> with 16 cores (via HyperThreading):</p>
|
||||
<pre><code> real 6m35.524s
|
||||
user 6m35.159s
|
||||
@@ -173,17 +173,17 @@ maximum:</p>
|
||||
<h2 id="alternate-code">Alternate code:</h2>
|
||||
<p>This alternate code is based on the author’s remarks.</p>
|
||||
<h3 id="alternate-build">Alternate build:</h3>
|
||||
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a> <span class="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>sykes1.alt</code> as you would <code>sykes1</code> above.</p>
|
||||
<h3 id="alternate-try">Alternate try:</h3>
|
||||
<p>The <a href="try.sh">try.sh</a> script will use both versions to show some differences. You
|
||||
can do so like:</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">./try.sh</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./try.sh</code></pre>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>Read the <a href="sykes1.html">sykes1.html</a> page source.
|
||||
Now then read the C source. Confused? :-) If it’s not clear try:</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="fu">diff</span> <span class="at">-s</span> sykes1.c sykes1.html</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> diff -s sykes1.c sykes1.html</code></pre>
|
||||
<p>For extra credit, understand what happens when you give this entry
|
||||
an negative number argument, and why.</p>
|
||||
<p>See the author’s remarks for how to make your own shapes as well.</p>
|
||||
@@ -200,7 +200,7 @@ together. I have not known anyone to solve it in this way - you would
|
||||
need to be very lucky indeed to stumble across a solution.</p>
|
||||
<h3 id="instructions">Instructions</h3>
|
||||
<p>Compile the program, then test that it works:</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">./sykes1</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./sykes1</code></pre>
|
||||
<p>Shortly you should see the first solution pop out on your screen. It
|
||||
shows you how to build the cube piece by piece, rendered in glorious
|
||||
3D ASCII.</p>
|
||||
@@ -210,20 +210,20 @@ open the file <a href="sykes1.html">sykes1.html</a>. This html file is just a co
|
||||
the browser display for you a nice animated GIF, showing you how to build the
|
||||
cube. Rendered in glorious 3D color.</p>
|
||||
<p>Want to see another solution? Try:</p>
|
||||
<div class="sourceCode" id="cb13"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./sykes1</span> some_number</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./sykes1 some_number</code></pre>
|
||||
<p>The program will discard solutions up to the number, and output numbered
|
||||
solution. Refresh your browser window to see the new solution.</p>
|
||||
<p>Try some more - there are exactly <code>19186</code> solutions to choose from.</p>
|
||||
<p>If you have a fast machine you might try the last solution:</p>
|
||||
<div class="sourceCode" id="cb14"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./sykes1</span> 19186</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./sykes1 19186</code></pre>
|
||||
<p>On my machine this takes about half an hour to run.</p>
|
||||
<h3 id="implementation">Implementation</h3>
|
||||
<p>The implementation is an optimized recursive algorithm that tries to fit
|
||||
the pieces into the cube one by one. The cube pieces are defined near
|
||||
the start of the program:</p>
|
||||
<div class="sourceCode" id="cb15"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a> <span class="dt">int</span> s<span class="op">[</span> <span class="op">]</span> <span class="op">=</span> <span class="op">{</span> <span class="dv">186</span><span class="op">,</span> <span class="dv">94</span><span class="op">,</span> <span class="dv">1426</span><span class="op">,</span> <span class="dv">3098</span></span>
|
||||
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a> <span class="op">,</span><span class="dv">1047</span> <span class="op">,</span> <span class="dv">122</span> <span class="op">,</span> <span class="dv">1082</span> <span class="op">,</span> <span class="dv">3083</span> <span class="op">,</span> <span class="dv">1039</span></span>
|
||||
<span id="cb15-3"><a href="#cb15-3" aria-hidden="true" tabindex="-1"></a> <span class="op">,</span> <span class="dv">569</span> <span class="op">,</span> <span class="dv">527</span> <span class="op">,</span> <span class="dv">1054</span> <span class="op">,</span> <span class="dv">531</span> <span class="op">}</span> <span class="op">;</span></span></code></pre></div>
|
||||
<pre class="<!---c-->"><code> int s[ ] = { 186, 94, 1426, 3098
|
||||
,1047 , 122 , 1082 , 3083 , 1039
|
||||
, 569 , 527 , 1054 , 531 } ;</code></pre>
|
||||
<p>Each piece is a bitmap, and represents a 3x3x3 cube.</p>
|
||||
<p>For instance the first piece is <code>186</code> - this is <code>010111010</code> in binary.
|
||||
Written out like this you can see that it is the cross shaped piece:</p>
|
||||
@@ -256,7 +256,7 @@ shape:</p>
|
||||
the pieces, and provided that a solution is possible, it will be found.</p>
|
||||
<p>For example, if you modify line 13 of the source like this, the program
|
||||
will solve for a different piece set:</p>
|
||||
<div class="sourceCode" id="cb19"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a> <span class="dt">int</span> s<span class="op">[</span> <span class="op">]</span> <span class="op">=</span> <span class="op">{</span> <span class="dv">187</span><span class="op">,</span> <span class="dv">94</span><span class="op">,</span> <span class="dv">402</span><span class="op">,</span> <span class="dv">3098</span></span></code></pre></div>
|
||||
<pre class="<!---c-->"><code> int s[ ] = { 187, 94, 402, 3098</code></pre>
|
||||
<p>And of course you can make your own.</p>
|
||||
<p>After the pieces are defined, the first thing the program does it to
|
||||
fit them into a 4x4 cube. It collects every possible placing of each
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./sykes2
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
|
||||
@@ -141,11 +141,11 @@ 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>
|
||||
<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">./sykes2</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./sykes2</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>This will repeatedly remake the program and run it then sleep for one second for
|
||||
a nice show of time.</p>
|
||||
<h2 id="judges-comments">Judges’ Comments:</h2>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./toledo1 [0-9][0-9]
|
||||
```
|
||||
|
||||
@@ -16,7 +16,7 @@ where `[0-9][0-9]` is a two digit number.
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
@@ -38,7 +38,7 @@ visit the 64 squares without repeating them?
|
||||
If not, this program does it, just run it with an argument
|
||||
giving initial position.
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./toledo1 11 # start is A8
|
||||
./toledo1 18 # start is H8
|
||||
./toledo1 81 # start is A1
|
||||
|
||||
@@ -141,12 +141,12 @@ 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">./toledo1</span> <span class="pp">[</span><span class="ss">0</span><span class="pp">-</span><span class="ss">9</span><span class="pp">][</span><span class="ss">0</span><span class="pp">-</span><span class="ss">9</span><span class="pp">]</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./toledo1 [0-9][0-9]</code></pre>
|
||||
<p>where <code>[0-9][0-9]</code> is a two digit 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="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>For most of the arguments (e.g. those above) the resulting path
|
||||
is not circular, but at least one starting point yields a circular path.</p>
|
||||
@@ -157,11 +157,11 @@ be expected, and some dump core?</p>
|
||||
visit the 64 squares without repeating them?</p>
|
||||
<p>If not, this program does it, just run it with an argument
|
||||
giving initial position.</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">./toledo1</span> 11 <span class="co"># start is A8</span></span>
|
||||
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./toledo1</span> 18 <span class="co"># start is H8</span></span>
|
||||
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./toledo1</span> 81 <span class="co"># start is A1</span></span>
|
||||
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">./toledo1</span> 88 <span class="co"># start is H1</span></span>
|
||||
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a> <span class="ex">./toledo1</span> 44 <span class="co"># start is D5</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./toledo1 11 # start is A8
|
||||
./toledo1 18 # start is H8
|
||||
./toledo1 81 # start is A1
|
||||
./toledo1 88 # start is H1
|
||||
./toledo1 44 # start is D5</code></pre>
|
||||
<p>It will print move order. The algorithm is so simple that you can read
|
||||
it in the source code. At the first glance it can appear checkered.
|
||||
Nevertheless, don’t be dismayed, jar, jar. :-)</p>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
@@ -22,7 +22,7 @@ For more detailed information see [2006 toledo2 bugs](../../bugs.html#2006_toled
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./toledo2
|
||||
```
|
||||
|
||||
@@ -33,7 +33,7 @@ does not seem to happen in macOS or linux in 2023.
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./toledo2
|
||||
```
|
||||
|
||||
@@ -56,7 +56,7 @@ functions in place of `read(2)` and `write(2)`.
|
||||
|
||||
### Alternate build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make alt
|
||||
```
|
||||
|
||||
@@ -112,7 +112,7 @@ Journal](https://en.wikipedia.org/wiki/Dr._Dobb%27s_Journal).
|
||||
Type using uppercase letters. Here are three example programs. Press Enter after
|
||||
each line:
|
||||
|
||||
```basic
|
||||
```<!---basic-->
|
||||
10 PRINT "Hello, world!"
|
||||
LIST
|
||||
RUN
|
||||
@@ -155,7 +155,7 @@ from the `SOURCE` directory:
|
||||
To import them, you must run the emulator with an argument, by
|
||||
example:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./toledo2 DDT.COM
|
||||
```
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ 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>
|
||||
<p>There is <a href="#alternate-code">alternate code</a> that is based on the author’s notes
|
||||
for DOS/Windows. This cannot be tested by us, not even to compile, but it appears
|
||||
that it should be fine, after the proper header files were added.</p>
|
||||
@@ -150,12 +150,12 @@ that it should be fine, after the proper header files were added.</p>
|
||||
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
|
||||
<p>For more detailed information see <a href="../../bugs.html#2006_toledo2">2006 toledo2 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">./toledo2</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./toledo2</code></pre>
|
||||
<p>To end execution press <code>ctrl-z</code>. As mentioned in the author’s remarks and in the
|
||||
below section, it is supposed to crash on termination though some noted this
|
||||
does not seem to happen in macOS or linux in 2023.</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">./toledo2</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./toledo2</code></pre>
|
||||
<p>and then type in the following:</p>
|
||||
<pre><code> 10 PRINT "HELLO WORLD!"
|
||||
LIST
|
||||
@@ -165,7 +165,7 @@ does not seem to happen in macOS or linux in 2023.</p>
|
||||
<p>This version, as noted, should work for DOS/Windows. It uses non-standard
|
||||
functions in place of <code>read(2)</code> and <code>write(2)</code>.</p>
|
||||
<h3 id="alternate-build">Alternate build:</h3>
|
||||
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> alt</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> make alt</code></pre>
|
||||
<h3 id="alternate-use">Alternate use:</h3>
|
||||
<p>The author noted that for PC/DOS you will have to add <code>ANSI.SYS</code> to your
|
||||
<code>CONFIG.SYS</code> but this is also something we can’t test.</p>
|
||||
@@ -203,7 +203,7 @@ the very first volume of <a href="https://en.wikipedia.org/wiki/Dr._Dobb%27s_Jou
|
||||
Journal</a>.</p>
|
||||
<p>Type using uppercase letters. Here are three example programs. Press Enter after
|
||||
each line:</p>
|
||||
<pre class="basic"><code> 10 PRINT "Hello, world!"
|
||||
<pre class="<!---basic-->"><code> 10 PRINT "Hello, world!"
|
||||
LIST
|
||||
RUN
|
||||
|
||||
@@ -236,7 +236,7 @@ from the <code>SOURCE</code> directory:</p>
|
||||
PIP.COM STAT.COM SUBMIT.COM XSUB.COM</code></pre>
|
||||
<p>To import them, you must run the emulator with an argument, by
|
||||
example:</p>
|
||||
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./toledo2</span> DDT.COM</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./toledo2 DDT.COM</code></pre>
|
||||
<p>When the <code>></code> prompt appears, do:</p>
|
||||
<pre><code> IMPORT DDT.COM</code></pre>
|
||||
<p>When it ends, do <code>HALT</code>, so the file is closed, and you can start
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
@@ -11,14 +11,14 @@ tested with Windows. See [alternate code](#alternate-code) below.
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./toledo3 [1 | 2 | 3 [b]]
|
||||
```
|
||||
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./toledo3 1
|
||||
```
|
||||
|
||||
@@ -62,7 +62,7 @@ So I managed to do a graphical X11 chess program ('`WYSIAIE`', or 'What You See
|
||||
Is An IOCCC Entry'). Pointing and clicking to move pieces is the only required
|
||||
action, and of course the command-line options:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./toledo3 # Two-players mode (useful if you don't have a board at hand)
|
||||
./toledo3 1 # Human white - Computer black, level 1 (fast)
|
||||
./toledo3 2 # Human white - Computer black, level 2 (medium)
|
||||
@@ -97,7 +97,7 @@ number generator.
|
||||
Because it is resource-hungry, I strongly recommend to compile it
|
||||
using maximum optimization. With GCC you can use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
gcc -O3 -fexpensive-optimizations prog.c -o prog -lX11
|
||||
```
|
||||
|
||||
|
||||
+11
-11
@@ -141,14 +141,14 @@ 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>
|
||||
<p>The author provided two alternate versions, one which adds a status bar and
|
||||
another that makes it text only. The author also provided a version that they
|
||||
tested with Windows. 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">./toledo3</span> [1 <span class="kw">|</span> <span class="ex">2</span> <span class="kw">|</span> <span class="ex">3</span> <span class="pp">[</span><span class="ss">b</span><span class="pp">]</span>]</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./toledo3 [1 | 2 | 3 [b]]</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">./toledo3</span> 1</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./toledo3 1</code></pre>
|
||||
<h2 id="alternate-code">Alternate code:</h2>
|
||||
<p>The author provided two additional versions, <a href="toledo3-sbar.c">toledo3-sbar.c</a>
|
||||
and <a href="toledo3-txt.c">toledo3-txt.c</a>. Respectively these create a status bar and
|
||||
@@ -172,13 +172,13 @@ the code for Deep Blue.</p>
|
||||
<p>So I managed to do a graphical X11 chess program (‘<code>WYSIAIE</code>’, or ‘What You See
|
||||
Is An IOCCC Entry’). Pointing and clicking to move pieces is the only required
|
||||
action, and of course the command-line options:</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">./toledo3</span> <span class="co"># Two-players mode (useful if you don't have a board at hand)</span></span>
|
||||
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./toledo3</span> 1 <span class="co"># Human white - Computer black, level 1 (fast)</span></span>
|
||||
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./toledo3</span> 2 <span class="co"># Human white - Computer black, level 2 (medium)</span></span>
|
||||
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">./toledo3</span> 3 <span class="co"># Human white - Computer black, level 3 (slow)</span></span>
|
||||
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a> <span class="ex">./toledo3</span> 1 b <span class="co"># Human black - Computer white, level 1 (fast)</span></span>
|
||||
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a> <span class="ex">./toledo3</span> 2 b <span class="co"># Human black - Computer white, level 2 (medium)</span></span>
|
||||
<span id="cb4-7"><a href="#cb4-7" aria-hidden="true" tabindex="-1"></a> <span class="ex">./toledo3</span> 3 b <span class="co"># Human black - Computer white, level 3 (slow)</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./toledo3 # Two-players mode (useful if you don't have a board at hand)
|
||||
./toledo3 1 # Human white - Computer black, level 1 (fast)
|
||||
./toledo3 2 # Human white - Computer black, level 2 (medium)
|
||||
./toledo3 3 # Human white - Computer black, level 3 (slow)
|
||||
./toledo3 1 b # Human black - Computer white, level 1 (fast)
|
||||
./toledo3 2 b # Human black - Computer white, level 2 (medium)
|
||||
./toledo3 3 b # Human black - Computer white, level 3 (slow)</code></pre>
|
||||
<p>The computer will check that your moves are legal. Full legal
|
||||
chess moves are allowed, except minor promotions on human side.</p>
|
||||
<p>The game will continue up to its logical conclusion, you make
|
||||
@@ -196,7 +196,7 @@ optimizations use valuable IOCCC characters.</p>
|
||||
number generator.</p>
|
||||
<p>Because it is resource-hungry, I strongly recommend to compile it
|
||||
using maximum optimization. With GCC you can use:</p>
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">gcc</span> <span class="at">-O3</span> <span class="at">-fexpensive-optimizations</span> prog.c <span class="at">-o</span> prog <span class="at">-lX11</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> gcc -O3 -fexpensive-optimizations prog.c -o prog -lX11</code></pre>
|
||||
<h3 id="known-features">KNOWN “FEATURES”</h3>
|
||||
<ol type="1">
|
||||
<li><p>Because this is my second X11 program (the first was
|
||||
|
||||
Reference in new issue
Block a user