improved indentation and whitespace for markdown code blocks

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

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

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

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

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

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

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

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

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

No files matched your search

+21 -21
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make
make
```
There is alternate code that lets you redefine the port to bind to, in case
@@ -12,28 +12,28 @@ there is a firewall issue, and also lets you redefine the timing constant,
## To use:
```sh
./prog < some_secret_or_something
./prog < some_secret_or_something
./prog http://host[:port]
./prog http://host[:port]
```
## Try:
```sh
./prog < README.md
./prog < README.md
```
or maybe:
```sh
echo "IOCCC 2014!" | ./prog
echo "IOCCC 2014!" | ./prog
```
Next, try in another terminal, as the above one is running:
```sh
./prog http://127.0.0.1:1701
./prog http://127.0.0.1:1701
```
What happens if you specify instead of a regular file something like
@@ -56,13 +56,13 @@ described by the author. See [configuration](#configuration) below.
To specify the port to say, 31337, try:
```sh
make clobber PORT=31337 alt
make clobber PORT=31337 alt
```
To change the timing constant, `STARDATE`, try:
```sh
make clobber TIME=5000000 alt
make clobber TIME=5000000 alt
```
You can combine them both of course.
@@ -102,26 +102,26 @@ the server.
## To use web server
```sh
./prog < secret_file_to_be_downloaded
./prog < secret_file_to_be_downloaded
```
Try using the program's source code as the secret file:
```sh
./prog < prog.c
./prog < prog.c
```
## To use client-side downloader
```sh
./prog http://host[:port]
./prog http://host[:port]
```
The optional port defaults to 1701. If the web server instance is started on
the same box, try:
```sh
./prog http://127.0.0.1:1701
./prog http://127.0.0.1:1701
```
It will incrementally display the contents of the hidden file at a rate of
@@ -247,15 +247,15 @@ For space considerations, the following include statements were dropped
resulting in compiler warnings:
```c
#include <asm/byteorder.h>
#include <ctype.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <string.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/unistd.h>
#include <asm/byteorder.h>
#include <ctype.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <string.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/unistd.h>
```
It may be necessary to restore some of these under certain environments.
+22 -23
View File
@@ -135,8 +135,7 @@
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
<li>Name: <a href="../../authors.html#Michael_Birken">Michael Birken</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -145,20 +144,20 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<p>There is alternate code that lets you redefine the port to bind to, in case
there is a firewall issue, and also lets you redefine the timing constant,
<code>STARDATE</code>. See <a href="#alternate%20code">Alternate code</a> below.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./prog</span> <span class="op">&lt;</span> some_secret_or_something</span>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> <span class="op">&lt;</span> some_secret_or_something</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">./prog</span> http://host<span class="pp">[</span><span class="ss">:port</span><span class="pp">]</span></span></code></pre></div>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> http://host<span class="pp">[</span><span class="ss">:port</span><span class="pp">]</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./prog</span> <span class="op">&lt;</span> README.md</span></code></pre></div>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> <span class="op">&lt;</span> README.md</span></code></pre></div>
<p>or maybe:</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="bu">echo</span> <span class="st">&quot;IOCCC 2014!&quot;</span> <span class="kw">|</span> <span class="ex">./prog</span></span></code></pre></div>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> <span class="st">&quot;IOCCC 2014!&quot;</span> <span class="kw">|</span> <span class="ex">./prog</span></span></code></pre></div>
<p>Next, try in another terminal, as the above one is running:</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">./prog</span> http://127.0.0.1:1701</span></code></pre></div>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> http://127.0.0.1:1701</span></code></pre></div>
<p>What happens if you specify instead of a regular file something like
<code>/dev/null</code> ?</p>
<p>But there’s more! Try opening in a browser the same address and then see what
@@ -169,9 +168,9 @@ problem for some reason, and it also allows you to change the timing as
described by the author. See <a href="#configuration">configuration</a> below.</p>
<h3 id="alternate-build">Alternate build:</h3>
<p>To specify the port to say, 31337, try:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> clobber PORT=31337 alt</span></code></pre></div>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> clobber PORT=31337 alt</span></code></pre></div>
<p>To change the timing constant, <code>STARDATE</code>, try:</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 TIME=5000000 alt</span></code></pre></div>
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> clobber TIME=5000000 alt</span></code></pre></div>
<p>You can combine them both of course.</p>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>prog.alt</code> as you would <code>prog</code> above. Remember that ports &lt; 1024 are
@@ -195,14 +194,14 @@ a client-side downloader. The hidden transmitted data cannot be reconstructed
or even detected from the binary content of the traffic between the client and
the server.</p>
<h2 id="to-use-web-server">To use web server</h2>
<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">./prog</span> <span class="op">&lt;</span> secret_file_to_be_downloaded</span></code></pre></div>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> <span class="op">&lt;</span> secret_file_to_be_downloaded</span></code></pre></div>
<p>Try using the program’s source code as the secret file:</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">./prog</span> <span class="op">&lt;</span> prog.c</span></code></pre></div>
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> <span class="op">&lt;</span> prog.c</span></code></pre></div>
<h2 id="to-use-client-side-downloader">To use client-side downloader</h2>
<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">./prog</span> http://host<span class="pp">[</span><span class="ss">:port</span><span class="pp">]</span></span></code></pre></div>
<div class="sourceCode" id="cb10"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> http://host<span class="pp">[</span><span class="ss">:port</span><span class="pp">]</span></span></code></pre></div>
<p>The optional port defaults to 1701. If the web server instance is started on
the same box, 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="ex">./prog</span> http://127.0.0.1:1701</span></code></pre></div>
<div class="sourceCode" id="cb11"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> http://127.0.0.1:1701</span></code></pre></div>
<p>It will incrementally display the contents of the hidden file at a rate of
approximately 1 baud.</p>
<p>The client-side downloader will automatically terminate if the web server is
@@ -297,15 +296,15 @@ numerical values.</li>
<h3 id="compiler-warnings">Compiler warnings</h3>
<p>For space considerations, the following include statements were dropped
resulting in compiler warnings:</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;asm/byteorder.h&gt;</span></span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;ctype.h&gt;</span></span>
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;netinet/in.h&gt;</span></span>
<span id="cb12-4"><a href="#cb12-4" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;stdlib.h&gt;</span></span>
<span id="cb12-5"><a href="#cb12-5" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;string.h&gt;</span></span>
<span id="cb12-6"><a href="#cb12-6" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;sys/select.h&gt;</span></span>
<span id="cb12-7"><a href="#cb12-7" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;sys/socket.h&gt;</span></span>
<span id="cb12-8"><a href="#cb12-8" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;sys/types.h&gt;</span></span>
<span id="cb12-9"><a href="#cb12-9" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;sys/unistd.h&gt;</span></span></code></pre></div>
<div class="sourceCode" id="cb12"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a> <span class="pp">#include </span><span class="im">&lt;asm/byteorder.h&gt;</span></span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a> <span class="pp">#include </span><span class="im">&lt;ctype.h&gt;</span></span>
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a> <span class="pp">#include </span><span class="im">&lt;netinet/in.h&gt;</span></span>
<span id="cb12-4"><a href="#cb12-4" aria-hidden="true" tabindex="-1"></a> <span class="pp">#include </span><span class="im">&lt;stdlib.h&gt;</span></span>
<span id="cb12-5"><a href="#cb12-5" aria-hidden="true" tabindex="-1"></a> <span class="pp">#include </span><span class="im">&lt;string.h&gt;</span></span>
<span id="cb12-6"><a href="#cb12-6" aria-hidden="true" tabindex="-1"></a> <span class="pp">#include </span><span class="im">&lt;sys/select.h&gt;</span></span>
<span id="cb12-7"><a href="#cb12-7" aria-hidden="true" tabindex="-1"></a> <span class="pp">#include </span><span class="im">&lt;sys/socket.h&gt;</span></span>
<span id="cb12-8"><a href="#cb12-8" aria-hidden="true" tabindex="-1"></a> <span class="pp">#include </span><span class="im">&lt;sys/types.h&gt;</span></span>
<span id="cb12-9"><a href="#cb12-9" aria-hidden="true" tabindex="-1"></a> <span class="pp">#include </span><span class="im">&lt;sys/unistd.h&gt;</span></span></code></pre></div>
<p>It may be necessary to restore some of these under certain environments.</p>
<!--
+25 -25
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make
make
```
There is an alternate version that the author provided but fixed in 2023 to
@@ -13,14 +13,14 @@ code](#alternate-code) below.
## To use:
```sh
./prog
./prog
```
## Try:
```sh
./prog
./prog
```
Try changing bounding box coordinates in the source to explore
@@ -37,7 +37,7 @@ recognisable and also to let you reconfigure the coordinates.
### Alternate build:
```sh
make alt
make alt
```
If you wish to redefine the coordinates you can do so by defining `X1`, `X2`,
@@ -46,7 +46,7 @@ For instance:
```sh
make clobber X1=-3 X2=2 Y1=-2.3 Y2=2.3 alt
make clobber X1=-3 X2=2 Y1=-2.3 Y2=2.3 alt
```
You may pick and choose which ones to redefine.
@@ -60,7 +60,7 @@ Use `prog.alt` as you would `prog`.
### Alternate try:
```sh
./try.alt.sh
./try.alt.sh
```
@@ -95,25 +95,25 @@ application source code is intentionally kept to a bare minimum. If this phrase
would not be true, the application would be the following:
```c
double _[]={-2
,1,-1.3 ,1.3, 0, 0,0,0
,0 ,0,50, 80, 0,0,0 ,255
, 8,0}; int main (
int j) {if (j== 1 ){ if(
_[12] >_[10] )_[17]=1 ;} if
(_[13] >_[11 ] ||_[17]==1) return 1
;_[6] = _ [13] / _[11]*(_[1]-_[ 0])
+_[ 0]; _ [7]=_[12]/_[10]*(_[3]-_[2] )+_
[2];_[8]=_[9]=_[14]=0;l2:_[4]=_[8] * _ [8]
;_[ 5]= _ [9]*_[9];_[9]=2*_[8]*_[9]+ _[7
];_[8 ] = _ [ 4 ]-_[5]+_[6];_[14 ]++
;if((_ [14]< _ [15])&&(_[4]+ _[ 5]
<_[16 ])) goto l2; putchar(
" #@*+ "[( int) _[14]%
5 ]);_ [13 ] ++ ; main (
0) ;_[12]++; _[13] =0
;if(_ [17] !=1) putchar
(0xa); main(1);}
double _[]={-2
,1,-1.3 ,1.3, 0, 0,0,0
,0 ,0,50, 80, 0,0,0 ,255
, 8,0}; int main (
int j) {if (j== 1 ){ if(
_[12] >_[10] )_[17]=1 ;} if
(_[13] >_[11 ] ||_[17]==1) return 1
;_[6] = _ [13] / _[11]*(_[1]-_[ 0])
+_[ 0]; _ [7]=_[12]/_[10]*(_[3]-_[2] )+_
[2];_[8]=_[9]=_[14]=0;l2:_[4]=_[8] * _ [8]
;_[ 5]= _ [9]*_[9];_[9]=2*_[8]*_[9]+ _[7
];_[8 ] = _ [ 4 ]-_[5]+_[6];_[14 ]++
;if((_ [14]< _ [15])&&(_[4]+ _[ 5]
<_[16 ])) goto l2; putchar(
" #@*+ "[( int) _[14]%
5 ]);_ [13 ] ++ ; main (
0) ;_[12]++; _[13] =0
;if(_ [17] !=1) putchar
(0xa); main(1);}
```
The application expects no parameters, the only way you can change the behaviour
+26 -27
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Ferenc_Deak">Ferenc Deak</a><br>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<br><br></li>
Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,15 +141,15 @@ Location: <a href="../../location.html#ZZ">ZZ</a> - <em>Unknown location</em>
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<p>There is an alternate version that the author provided but fixed in 2023 to
compile with modern systems and to allow one to reconfigure the constants <code>X1</code>,
<code>X2</code>, <code>Y1</code> and <code>Y2</code> (which were magic numbers). 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">./prog</span></span></code></pre></div>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./prog</span></span></code></pre></div>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span></span></code></pre></div>
<p>Try changing bounding box coordinates in the source to explore
various regions of the fractal.</p>
<h2 id="alternate-code">Alternate code:</h2>
@@ -158,16 +157,16 @@ various regions of the fractal.</p>
easily see the difference in what it might look like if the C was more
recognisable and also to let you reconfigure the coordinates.</p>
<h3 id="alternate-build">Alternate build:</h3>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> alt</span></code></pre></div>
<p>If you wish to redefine the coordinates you can do so by defining <code>X1</code>, <code>X2</code>,
<code>Y1</code> and/or <code>Y2</code>, which default to: <code>-2</code>, <code>1</code>, <code>-1.3</code> and <code>1.3</code> respectively.
For instance:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> clobber X1=-3 X2=2 Y1=-2.3 Y2=2.3 alt</span></code></pre></div>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> clobber X1=-3 X2=2 Y1=-2.3 Y2=2.3 alt</span></code></pre></div>
<p>You may pick and choose which ones to redefine.</p>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>prog.alt</code> as you would <code>prog</code>.</p>
<h3 id="alternate-try">Alternate try:</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">./try.alt.sh</span></span></code></pre></div>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.alt.sh</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>We consider this entry a tribute to all “Abuse of the C preprocessor”
and Mandelbrot fractal drawing entries we’ve seen over the years.</p>
@@ -187,25 +186,25 @@ drawer. There are tools much better suited for drawing fractals.</p>
<p>The usage of recognizable elements from the C programming language in the
application source code is intentionally kept to a bare minimum. If this phrase
would not be true, the application would be the following:</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="dt">double</span> _<span class="op">[]={-</span><span class="dv">2</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="op">,</span><span class="dv">1</span><span class="op">,-</span><span class="fl">1.3</span> <span class="op">,</span><span class="fl">1.3</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span><span class="dv">0</span><span class="op">,</span><span class="dv">0</span></span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a><span class="op">,</span><span class="dv">0</span> <span class="op">,</span><span class="dv">0</span><span class="op">,</span><span class="dv">50</span><span class="op">,</span> <span class="dv">80</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span><span class="dv">0</span><span class="op">,</span><span class="dv">0</span> <span class="op">,</span><span class="dv">255</span></span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a><span class="op">,</span> <span class="dv">8</span><span class="op">,</span><span class="dv">0</span><span class="op">};</span> <span class="dt">int</span> main <span class="op">(</span></span>
<span id="cb7-5"><a href="#cb7-5" aria-hidden="true" tabindex="-1"></a> <span class="dt">int</span> j<span class="op">)</span> <span class="op">{</span><span class="cf">if</span> <span class="op">(</span>j<span class="op">==</span> <span class="dv">1</span> <span class="op">){</span> <span class="cf">if</span><span class="op">(</span></span>
<span id="cb7-6"><a href="#cb7-6" aria-hidden="true" tabindex="-1"></a> _<span class="op">[</span><span class="dv">12</span><span class="op">]</span> <span class="op">&gt;</span>_<span class="op">[</span><span class="dv">10</span><span class="op">]</span> <span class="op">)</span>_<span class="op">[</span><span class="dv">17</span><span class="op">]=</span><span class="dv">1</span> <span class="op">;}</span> <span class="cf">if</span></span>
<span id="cb7-7"><a href="#cb7-7" aria-hidden="true" tabindex="-1"></a> <span class="op">(</span>_<span class="op">[</span><span class="dv">13</span><span class="op">]</span> <span class="op">&gt;</span>_<span class="op">[</span><span class="dv">11</span> <span class="op">]</span> <span class="op">||</span>_<span class="op">[</span><span class="dv">17</span><span class="op">]==</span><span class="dv">1</span><span class="op">)</span> <span class="cf">return</span> <span class="dv">1</span></span>
<span id="cb7-8"><a href="#cb7-8" aria-hidden="true" tabindex="-1"></a> <span class="op">;</span>_<span class="op">[</span><span class="dv">6</span><span class="op">]</span> <span class="op">=</span> _ <span class="op">[</span><span class="dv">13</span><span class="op">]</span> <span class="op">/</span> _<span class="op">[</span><span class="dv">11</span><span class="op">]*(</span>_<span class="op">[</span><span class="dv">1</span><span class="op">]-</span>_<span class="op">[</span> <span class="dv">0</span><span class="op">])</span></span>
<span id="cb7-9"><a href="#cb7-9" aria-hidden="true" tabindex="-1"></a><span class="op">+</span>_<span class="op">[</span> <span class="dv">0</span><span class="op">];</span> _ <span class="op">[</span><span class="dv">7</span><span class="op">]=</span>_<span class="op">[</span><span class="dv">12</span><span class="op">]/</span>_<span class="op">[</span><span class="dv">10</span><span class="op">]*(</span>_<span class="op">[</span><span class="dv">3</span><span class="op">]-</span>_<span class="op">[</span><span class="dv">2</span><span class="op">]</span> <span class="op">)+</span>_</span>
<span id="cb7-10"><a href="#cb7-10" aria-hidden="true" tabindex="-1"></a><span class="op">[</span><span class="dv">2</span><span class="op">];</span>_<span class="op">[</span><span class="dv">8</span><span class="op">]=</span>_<span class="op">[</span><span class="dv">9</span><span class="op">]=</span>_<span class="op">[</span><span class="dv">14</span><span class="op">]=</span><span class="dv">0</span><span class="op">;</span>l2<span class="op">:</span>_<span class="op">[</span><span class="dv">4</span><span class="op">]=</span>_<span class="op">[</span><span class="dv">8</span><span class="op">]</span> <span class="op">*</span> _ <span class="op">[</span><span class="dv">8</span><span class="op">]</span></span>
<span id="cb7-11"><a href="#cb7-11" aria-hidden="true" tabindex="-1"></a><span class="op">;</span>_<span class="op">[</span> <span class="dv">5</span><span class="op">]=</span> _ <span class="op">[</span><span class="dv">9</span><span class="op">]*</span>_<span class="op">[</span><span class="dv">9</span><span class="op">];</span>_<span class="op">[</span><span class="dv">9</span><span class="op">]=</span><span class="dv">2</span><span class="op">*</span>_<span class="op">[</span><span class="dv">8</span><span class="op">]*</span>_<span class="op">[</span><span class="dv">9</span><span class="op">]+</span> _<span class="op">[</span><span class="dv">7</span></span>
<span id="cb7-12"><a href="#cb7-12" aria-hidden="true" tabindex="-1"></a> <span class="op">];</span>_<span class="op">[</span><span class="dv">8</span> <span class="op">]</span> <span class="op">=</span> _ <span class="op">[</span> <span class="dv">4</span> <span class="op">]-</span>_<span class="op">[</span><span class="dv">5</span><span class="op">]+</span>_<span class="op">[</span><span class="dv">6</span><span class="op">];</span>_<span class="op">[</span><span class="dv">14</span> <span class="op">]++</span></span>
<span id="cb7-13"><a href="#cb7-13" aria-hidden="true" tabindex="-1"></a> <span class="op">;</span><span class="cf">if</span><span class="op">((</span>_ <span class="op">[</span><span class="dv">14</span><span class="op">]&lt;</span> _ <span class="op">[</span><span class="dv">15</span><span class="op">])&amp;&amp;(</span>_<span class="op">[</span><span class="dv">4</span><span class="op">]+</span> _<span class="op">[</span> <span class="dv">5</span><span class="op">]</span></span>
<span id="cb7-14"><a href="#cb7-14" aria-hidden="true" tabindex="-1"></a> <span class="op">&lt;</span>_<span class="op">[</span><span class="dv">16</span> <span class="op">]))</span> <span class="cf">goto</span> l2<span class="op">;</span> putchar<span class="op">(</span></span>
<span id="cb7-15"><a href="#cb7-15" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot; #@*+ &quot;</span><span class="op">[(</span> <span class="dt">int</span><span class="op">)</span> _<span class="op">[</span><span class="dv">14</span><span class="op">]%</span></span>
<span id="cb7-16"><a href="#cb7-16" aria-hidden="true" tabindex="-1"></a><span class="dv">5</span> <span class="op">]);</span>_ <span class="op">[</span><span class="dv">13</span> <span class="op">]</span> <span class="op">++</span> <span class="op">;</span> main <span class="op">(</span></span>
<span id="cb7-17"><a href="#cb7-17" aria-hidden="true" tabindex="-1"></a><span class="dv">0</span><span class="op">)</span> <span class="op">;</span>_<span class="op">[</span><span class="dv">12</span><span class="op">]++;</span> _<span class="op">[</span><span class="dv">13</span><span class="op">]</span> <span class="op">=</span><span class="dv">0</span></span>
<span id="cb7-18"><a href="#cb7-18" aria-hidden="true" tabindex="-1"></a><span class="op">;</span><span class="cf">if</span><span class="op">(</span>_ <span class="op">[</span><span class="dv">17</span><span class="op">]</span> <span class="op">!=</span><span class="dv">1</span><span class="op">)</span> putchar</span>
<span id="cb7-19"><a href="#cb7-19" aria-hidden="true" tabindex="-1"></a><span class="op">(</span><span class="bn">0xa</span><span class="op">);</span> main<span class="op">(</span><span class="dv">1</span><span class="op">);}</span></span></code></pre></div>
<div class="sourceCode" id="cb7"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a> <span class="dt">double</span> _<span class="op">[]={-</span><span class="dv">2</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a> <span class="op">,</span><span class="dv">1</span><span class="op">,-</span><span class="fl">1.3</span> <span class="op">,</span><span class="fl">1.3</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span><span class="dv">0</span><span class="op">,</span><span class="dv">0</span></span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a> <span class="op">,</span><span class="dv">0</span> <span class="op">,</span><span class="dv">0</span><span class="op">,</span><span class="dv">50</span><span class="op">,</span> <span class="dv">80</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span><span class="dv">0</span><span class="op">,</span><span class="dv">0</span> <span class="op">,</span><span class="dv">255</span></span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a> <span class="op">,</span> <span class="dv">8</span><span class="op">,</span><span class="dv">0</span><span class="op">};</span> <span class="dt">int</span> main <span class="op">(</span></span>
<span id="cb7-5"><a href="#cb7-5" aria-hidden="true" tabindex="-1"></a> <span class="dt">int</span> j<span class="op">)</span> <span class="op">{</span><span class="cf">if</span> <span class="op">(</span>j<span class="op">==</span> <span class="dv">1</span> <span class="op">){</span> <span class="cf">if</span><span class="op">(</span></span>
<span id="cb7-6"><a href="#cb7-6" aria-hidden="true" tabindex="-1"></a> _<span class="op">[</span><span class="dv">12</span><span class="op">]</span> <span class="op">&gt;</span>_<span class="op">[</span><span class="dv">10</span><span class="op">]</span> <span class="op">)</span>_<span class="op">[</span><span class="dv">17</span><span class="op">]=</span><span class="dv">1</span> <span class="op">;}</span> <span class="cf">if</span></span>
<span id="cb7-7"><a href="#cb7-7" aria-hidden="true" tabindex="-1"></a> <span class="op">(</span>_<span class="op">[</span><span class="dv">13</span><span class="op">]</span> <span class="op">&gt;</span>_<span class="op">[</span><span class="dv">11</span> <span class="op">]</span> <span class="op">||</span>_<span class="op">[</span><span class="dv">17</span><span class="op">]==</span><span class="dv">1</span><span class="op">)</span> <span class="cf">return</span> <span class="dv">1</span></span>
<span id="cb7-8"><a href="#cb7-8" aria-hidden="true" tabindex="-1"></a> <span class="op">;</span>_<span class="op">[</span><span class="dv">6</span><span class="op">]</span> <span class="op">=</span> _ <span class="op">[</span><span class="dv">13</span><span class="op">]</span> <span class="op">/</span> _<span class="op">[</span><span class="dv">11</span><span class="op">]*(</span>_<span class="op">[</span><span class="dv">1</span><span class="op">]-</span>_<span class="op">[</span> <span class="dv">0</span><span class="op">])</span></span>
<span id="cb7-9"><a href="#cb7-9" aria-hidden="true" tabindex="-1"></a> <span class="op">+</span>_<span class="op">[</span> <span class="dv">0</span><span class="op">];</span> _ <span class="op">[</span><span class="dv">7</span><span class="op">]=</span>_<span class="op">[</span><span class="dv">12</span><span class="op">]/</span>_<span class="op">[</span><span class="dv">10</span><span class="op">]*(</span>_<span class="op">[</span><span class="dv">3</span><span class="op">]-</span>_<span class="op">[</span><span class="dv">2</span><span class="op">]</span> <span class="op">)+</span>_</span>
<span id="cb7-10"><a href="#cb7-10" aria-hidden="true" tabindex="-1"></a> <span class="op">[</span><span class="dv">2</span><span class="op">];</span>_<span class="op">[</span><span class="dv">8</span><span class="op">]=</span>_<span class="op">[</span><span class="dv">9</span><span class="op">]=</span>_<span class="op">[</span><span class="dv">14</span><span class="op">]=</span><span class="dv">0</span><span class="op">;</span>l2<span class="op">:</span>_<span class="op">[</span><span class="dv">4</span><span class="op">]=</span>_<span class="op">[</span><span class="dv">8</span><span class="op">]</span> <span class="op">*</span> _ <span class="op">[</span><span class="dv">8</span><span class="op">]</span></span>
<span id="cb7-11"><a href="#cb7-11" aria-hidden="true" tabindex="-1"></a> <span class="op">;</span>_<span class="op">[</span> <span class="dv">5</span><span class="op">]=</span> _ <span class="op">[</span><span class="dv">9</span><span class="op">]*</span>_<span class="op">[</span><span class="dv">9</span><span class="op">];</span>_<span class="op">[</span><span class="dv">9</span><span class="op">]=</span><span class="dv">2</span><span class="op">*</span>_<span class="op">[</span><span class="dv">8</span><span class="op">]*</span>_<span class="op">[</span><span class="dv">9</span><span class="op">]+</span> _<span class="op">[</span><span class="dv">7</span></span>
<span id="cb7-12"><a href="#cb7-12" aria-hidden="true" tabindex="-1"></a> <span class="op">];</span>_<span class="op">[</span><span class="dv">8</span> <span class="op">]</span> <span class="op">=</span> _ <span class="op">[</span> <span class="dv">4</span> <span class="op">]-</span>_<span class="op">[</span><span class="dv">5</span><span class="op">]+</span>_<span class="op">[</span><span class="dv">6</span><span class="op">];</span>_<span class="op">[</span><span class="dv">14</span> <span class="op">]++</span></span>
<span id="cb7-13"><a href="#cb7-13" aria-hidden="true" tabindex="-1"></a> <span class="op">;</span><span class="cf">if</span><span class="op">((</span>_ <span class="op">[</span><span class="dv">14</span><span class="op">]&lt;</span> _ <span class="op">[</span><span class="dv">15</span><span class="op">])&amp;&amp;(</span>_<span class="op">[</span><span class="dv">4</span><span class="op">]+</span> _<span class="op">[</span> <span class="dv">5</span><span class="op">]</span></span>
<span id="cb7-14"><a href="#cb7-14" aria-hidden="true" tabindex="-1"></a> <span class="op">&lt;</span>_<span class="op">[</span><span class="dv">16</span> <span class="op">]))</span> <span class="cf">goto</span> l2<span class="op">;</span> putchar<span class="op">(</span></span>
<span id="cb7-15"><a href="#cb7-15" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot; #@*+ &quot;</span><span class="op">[(</span> <span class="dt">int</span><span class="op">)</span> _<span class="op">[</span><span class="dv">14</span><span class="op">]%</span></span>
<span id="cb7-16"><a href="#cb7-16" aria-hidden="true" tabindex="-1"></a> <span class="dv">5</span> <span class="op">]);</span>_ <span class="op">[</span><span class="dv">13</span> <span class="op">]</span> <span class="op">++</span> <span class="op">;</span> main <span class="op">(</span></span>
<span id="cb7-17"><a href="#cb7-17" aria-hidden="true" tabindex="-1"></a> <span class="dv">0</span><span class="op">)</span> <span class="op">;</span>_<span class="op">[</span><span class="dv">12</span><span class="op">]++;</span> _<span class="op">[</span><span class="dv">13</span><span class="op">]</span> <span class="op">=</span><span class="dv">0</span></span>
<span id="cb7-18"><a href="#cb7-18" aria-hidden="true" tabindex="-1"></a> <span class="op">;</span><span class="cf">if</span><span class="op">(</span>_ <span class="op">[</span><span class="dv">17</span><span class="op">]</span> <span class="op">!=</span><span class="dv">1</span><span class="op">)</span> putchar</span>
<span id="cb7-19"><a href="#cb7-19" aria-hidden="true" tabindex="-1"></a> <span class="op">(</span><span class="bn">0xa</span><span class="op">);</span> main<span class="op">(</span><span class="dv">1</span><span class="op">);}</span></span></code></pre></div>
<p>The application expects no parameters, the only way you can change the behaviour
is to modify the source code at the indicated location: the line
<code>/* &lt;-- Configure here: X1, X2, Y1, Y2 */</code> is intentionally not obfuscated so
+8 -8
View File
@@ -1,21 +1,21 @@
## To build:
```sh
make
make
```
## To use:
```sh
./prog > foo.c
./prog > foo.c
```
## Try:
```sh
./try.sh
./try.sh
```
The script will ask you if you wish to run `make rake` but this is not necessary
@@ -37,16 +37,16 @@ Big terminals with tiny fonts have their uses in certain cases.
One of them is:
```sh
make treacl
./treacl
make treacl
./treacl
```
which is shorthand for:
```sh
./prog < prog.c > treacle.c
make treacle
./treacle
./prog < prog.c > treacle.c
make treacle
./treacle
```
+9 -10
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Yusuke_Endoh">Yusuke Endoh</a><br>
Location: <a href="../../location.html#JP">JP</a> - <em>Japan</em>
<br><br></li>
Location: <a href="../../location.html#JP">JP</a> - <em>Japan</em></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,11 +141,11 @@ Location: <a href="../../location.html#JP">JP</a> - <em>Japan</em>
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./prog</span> <span class="op">&gt;</span> foo.c</span></code></pre></div>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> <span class="op">&gt;</span> foo.c</span></code></pre></div>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<p>The script will ask you if you wish to run <code>make rake</code> but this is not necessary
to fully enjoy the entry. <code>make rake</code> will run the <a href="rake.sh">rake.sh</a> script and
then <code>prog</code> if all is built okay. If <code>rake</code> is not installed then it will check
@@ -160,12 +159,12 @@ build <code>main.c</code>.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Big terminals with tiny fonts have their uses in certain cases.
One of them is:</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> treacl</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./treacl</span></span></code></pre></div>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> treacl</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./treacl</span></span></code></pre></div>
<p>which is shorthand for:</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">./prog</span> <span class="op">&lt;</span> prog.c <span class="op">&gt;</span> treacle.c</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> treacle</span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./treacle</span></span></code></pre></div>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> <span class="op">&lt;</span> prog.c <span class="op">&gt;</span> treacle.c</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> treacle</span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./treacle</span></span></code></pre></div>
<p>When using a smartphone to read the output, you may need to
step back to see the bigger picture because that picture is worth
more than 1000 words.</p>
+41 -41
View File
@@ -134,11 +134,11 @@ the program!</p>
<h2 id="how-did-i-achieve-that">How did I achieve that?</h2>
<p>It is known that we can mitigate the quine restriction by <code>eval</code>.
For example, this is a quine written in Ruby:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode ruby"><code class="sourceCode ruby"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">eval</span> s<span class="kw">=</span><span class="st">&quot;print &#39;eval s=&#39;; p s&quot;</span></span></code></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode ruby"><code class="sourceCode ruby"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">eval</span> s<span class="kw">=</span><span class="st">&quot;print &#39;eval s=&#39;; p s&quot;</span></span></code></pre></div>
<p>Note that <code>print</code> appears just once in the program.</p>
<p>To emulate this approach in C, I adopted the following structure.</p>
<pre><code>char s[]=&quot;&lt;main code&gt;int main() { &lt;VM code&gt; }&quot;;
int main() { &lt;VM code&gt;; }</code></pre>
<pre><code> char s[]=&quot;&lt;main code&gt;int main() { &lt;VM code&gt; }&quot;;
int main() { &lt;VM code&gt;; }</code></pre>
<ul>
<li><code>&lt;VM code&gt;</code> : An own VM implementation (written in C) that executes the main
code.</li>
@@ -188,37 +188,37 @@ renaming and automatic register allocation only for this purpose.</p>
<li><a href="vm.c">vm.c</a>: the source code of the VM.</li>
</ul>
<p>The compiler tool chain is the following.</p>
<pre><code>src.rb interp.c
| |
| [parse.rb] |
V |
ast.txt |
| |
| [serialize.rb] |
V |
seq.txt |
| |
| [alpha.rb] |
V |
alpha.txt |
| |
| [register.rb] |
V |
reg.txt |
| |
| [assemble.rb] |
V |
raw.txt |
| |
+---------+---------+
|
| [link.rb]
V
main.c
|
| [gen-prog.c]
V
prog.c</code></pre>
<pre><code> src.rb interp.c
| |
| [parse.rb] |
V |
ast.txt |
| |
| [serialize.rb] |
V |
seq.txt |
| |
| [alpha.rb] |
V |
alpha.txt |
| |
| [register.rb] |
V |
reg.txt |
| |
| [assemble.rb] |
V |
raw.txt |
| |
+---------+---------+
|
| [link.rb]
V
main.c
|
| [gen-prog.c]
V
prog.c</code></pre>
<ul>
<li><a href="parse.rb">parse.rb</a> converts Ruby to AST.</li>
<li><a href="serialize.rb">serialize.rb</a> converts AST to intermediate instruction sequence.</li>
@@ -230,8 +230,8 @@ raw.txt |
<li><a href="gen-prog.c">gen-prog.c</a> generates <a href="prog.c">prog.c</a> based on <code>main.c</code>.</li>
</ul>
<p>You can run the process by <code>rake</code> command. <code>ruby-minisat</code> gem is needed.</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> gem install ruby-minisat</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> rake</span></code></pre></div>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">$</span> gem install ruby-minisat</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">$</span> rake</span></code></pre></div>
<h2 id="tools">Tools</h2>
<p>I checked that the following QR code readers can read the output of my program.</p>
<ul>
@@ -243,13 +243,13 @@ found at
<code>https://play.google.com/store/apps/details?id=com.google.zxing.client.android</code>
but it appears to no longer exist.</p>
<p>You can use <a href="tool.rb">tool.rb</a> to convert the output to a png file.</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">./main</span> Hello <span class="kw">|</span> <span class="ex">ruby</span> tool.rb <span class="op">&gt;</span> hello.png</span>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./main</span> Hello <span class="kw">|</span> <span class="ex">ruby</span> tool.rb <span class="op">&gt;</span> hello.png</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">$</span> zbarimg <span class="at">-q</span> hello.png</span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a><span class="ex">QR-Code:Hello</span></span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">$</span> zbarimg <span class="at">-q</span> hello.png</span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">QR-Code:Hello</span></span>
<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> ruby tool.rb prog.c</span>
<span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> ruby tool.rb prog.c <span class="kw">|</span> <span class="ex">ruby</span> tool.rb</span></code></pre></div>
<span id="cb5-6"><a href="#cb5-6" aria-hidden="true" tabindex="-1"></a> <span class="ex">$</span> ruby tool.rb prog.c</span>
<span id="cb5-7"><a href="#cb5-7" aria-hidden="true" tabindex="-1"></a> <span class="ex">$</span> ruby tool.rb prog.c <span class="kw">|</span> <span class="ex">ruby</span> tool.rb</span></code></pre></div>
<h2 id="limitations">Limitations</h2>
<ul>
<li>QR code error correction level is fixed to L (Low).</li>
+41 -41
View File
@@ -19,7 +19,7 @@ It is known that we can mitigate the quine restriction by `eval`.
For example, this is a quine written in Ruby:
```ruby
eval s="print 'eval s='; p s"
eval s="print 'eval s='; p s"
```
Note that `print` appears just once in the program.
@@ -27,8 +27,8 @@ Note that `print` appears just once in the program.
To emulate this approach in C, I adopted the following structure.
```
char s[]="<main code>int main() { <VM code> }";
int main() { <VM code>; }
char s[]="<main code>int main() { <VM code> }";
int main() { <VM code>; }
```
* `<VM code>` : An own VM implementation (written in C) that executes the main
@@ -78,37 +78,37 @@ renaming and automatic register allocation only for this purpose.
The compiler tool chain is the following.
```
src.rb interp.c
| |
| [parse.rb] |
V |
ast.txt |
| |
| [serialize.rb] |
V |
seq.txt |
| |
| [alpha.rb] |
V |
alpha.txt |
| |
| [register.rb] |
V |
reg.txt |
| |
| [assemble.rb] |
V |
raw.txt |
| |
+---------+---------+
|
| [link.rb]
V
main.c
|
| [gen-prog.c]
V
prog.c
src.rb interp.c
| |
| [parse.rb] |
V |
ast.txt |
| |
| [serialize.rb] |
V |
seq.txt |
| |
| [alpha.rb] |
V |
alpha.txt |
| |
| [register.rb] |
V |
reg.txt |
| |
| [assemble.rb] |
V |
raw.txt |
| |
+---------+---------+
|
| [link.rb]
V
main.c
|
| [gen-prog.c]
V
prog.c
```
* [parse.rb](parse.rb) converts Ruby to AST.
@@ -123,8 +123,8 @@ raw.txt |
You can run the process by `rake` command. `ruby-minisat` gem is needed.
```sh
$ gem install ruby-minisat
$ rake
$ gem install ruby-minisat
$ rake
```
## Tools
@@ -146,13 +146,13 @@ but it appears to no longer exist.
You can use [tool.rb](tool.rb) to convert the output to a png file.
```sh
./main Hello | ruby tool.rb > hello.png
./main Hello | ruby tool.rb > hello.png
$ zbarimg -q hello.png
QR-Code:Hello
$ zbarimg -q hello.png
QR-Code:Hello
$ ruby tool.rb prog.c
$ ruby tool.rb prog.c | ruby tool.rb
$ ruby tool.rb prog.c
$ ruby tool.rb prog.c | ruby tool.rb
```
+3 -3
View File
@@ -1,21 +1,21 @@
## To build:
```sh
make
make
```
## To use:
```sh
./prog < input > output
./prog < input > output
```
## Try:
```sh
./try.sh
./try.sh
```
+4 -5
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Yusuke_Endoh">Yusuke Endoh</a><br>
Location: <a href="../../location.html#JP">JP</a> - <em>Japan</em>
<br><br></li>
Location: <a href="../../location.html#JP">JP</a> - <em>Japan</em></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,11 +141,11 @@ Location: <a href="../../location.html#JP">JP</a> - <em>Japan</em>
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./prog</span> <span class="op">&lt;</span> input <span class="op">&gt;</span> output</span></code></pre></div>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> <span class="op">&lt;</span> input <span class="op">&gt;</span> output</span></code></pre></div>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>If you look closely at the source, you will see code that appears
to puts C code that includes itself. How and why? Perhaps it is
+37 -39
View File
@@ -3,9 +3,8 @@
This entry requires SDL to be installed. See [FAQ 3.8](../../faq.html#SDL) if you
don't know how to do this for your system.
```sh
make
make
```
@@ -14,7 +13,7 @@ make
The current status of this entry is:
```
STATUS: INABIAF - please **DO NOT** fix
STATUS: INABIAF - please **DO NOT** fix
```
For more detailed information see [2014 maffiodo1 bugs](../../bugs.html#2014_maffiodo1).
@@ -23,7 +22,7 @@ For more detailed information see [2014 maffiodo1 bugs](../../bugs.html#2014_maf
## To use:
```sh
cat game.level | ./prog 320 200 800 300 128 144 game.rgba game.wav 10343679
cat game.level | ./prog 320 200 800 300 128 144 game.rgba game.wav 10343679
```
The parameters to the program are:
@@ -43,10 +42,9 @@ note on macOS.
## Try:
```sh
./giana.sh
./mario.sh
./giana.sh
./mario.sh
```
If you end up telnetting to the server (feature of [mario.sh](mario.sh)) you can
@@ -54,19 +52,19 @@ try:
```
ls # show files including games
wumpus.bas # play Hunt the Wumpus
advent.gam # you know what this is! :-)
starwars # animated Star Wars 'film'
ls # show files including games
wumpus.bas # play Hunt the Wumpus
advent.gam # you know what this is! :-)
starwars # animated Star Wars 'film'
```
If you wish to change the width and height, defaulting at 640 x 480, say to
800 x 800, try:
```sh
ROWS=800 COLS=800 ./mario.sh
ROWS=800 COLS=800 ./mario.sh
ROWS=800 COLS=800 ./giana.sh
ROWS=800 COLS=800 ./giana.sh
```
@@ -79,7 +77,7 @@ NOTE: the author states to use `tabsize=4` to see the magic of the formatting of
the code. In `vim` you can do:
```
:set tabstop=4
:set tabstop=4
```
in command mode to see this effect. You don't need to modify your `.vimrc` file!
@@ -95,14 +93,14 @@ immediately take effect.
Use `tabsize=4` to see the magic.
```sh
expand -t 4 prog.c
expand -t 4 prog.c
```
The program returns 0 if the player wins or *non-zero* if the player loses so
you can test it and make something useful (or not), like this:
```sh
cat mario.level | ./prog 320 200 800 300 128 144 mario.rgba mario8.wav 10343679 && telnet telehack.com 23
cat mario.level | ./prog 320 200 800 300 128 144 mario.rgba mario8.wav 10343679 && telnet telehack.com 23
```
and type in: `starwars`
@@ -184,7 +182,7 @@ must be a grid of 8xN sprites. The size of a single sprite must be square. The
program calculates the size in this way:
```
sprite_size = image_width / 8
sprite_size = image_width / 8
```
Each sprite is identified by its position inside the grid, counting line by
@@ -194,27 +192,27 @@ grid, sprite 8 is the first sprite of the second row of the grid etc.).
Some positions of the grid have a predefined purpose:
```
Position | Description
:-----------------|:--------------
0 | Player standing right
1 | Player walking right frame 0
2 | Player walking right frame 1
3 | Player jumping right
4 | Player standing left
5 | Player walking left frame 0
6 | Player walking left frame 1
7 | Player jumping left
8 *(second row)* | Super player standing right
9 | Super player walking right frame 0
10 | Super player walking right frame 1
11 | Super player jumping right
12 | Super player standing left
13 | Super player walking left frame 0
14 | Super player walking left frame 1
15 | Super player jumping left
24 | Player dead
32 | Player won
40 | Super player won
Position | Description
:-----------------|:--------------
0 | Player standing right
1 | Player walking right frame 0
2 | Player walking right frame 1
3 | Player jumping right
4 | Player standing left
5 | Player walking left frame 0
6 | Player walking left frame 1
7 | Player jumping left
8 *(second row)* | Super player standing right
9 | Super player walking right frame 0
10 | Super player walking right frame 1
11 | Super player jumping right
12 | Super player standing left
13 | Super player walking left frame 0
14 | Super player walking left frame 1
15 | Super player jumping left
24 | Player dead
32 | Player won
40 | Super player won
```
All the others sprites can be used as you want, depending on the game you want
@@ -231,7 +229,7 @@ handled by the program is 333. You can modify this value by editing the source
here:
```c
C[333*7],d=333;
C[333*7],d=333;
```
Each row has six columns:
+38 -39
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Sandro_Maffiodo">Sandro Maffiodo</a><br>
Location: <a href="../../location.html#IT">IT</a> - <em>Italian Republic</em> (<em>Italy</em>)
<br><br></li>
Location: <a href="../../location.html#IT">IT</a> - <em>Italian Republic</em> (<em>Italy</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -144,13 +143,13 @@ Location: <a href="../../location.html#IT">IT</a> - <em>Italian Republic</em> (<
<h2 id="to-build">To build:</h2>
<p>This entry requires SDL to be installed. See <a href="../../faq.html#SDL">FAQ 3.8</a> if you
don’t know how to do this for your system.</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code>STATUS: INABIAF - please **DO NOT** fix</code></pre>
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2014_maffiodo1">2014 maffiodo1 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="fu">cat</span> game.level <span class="kw">|</span> <span class="ex">./prog</span> 320 200 800 300 128 144 game.rgba game.wav 10343679</span></code></pre></div>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">cat</span> game.level <span class="kw">|</span> <span class="ex">./prog</span> 320 200 800 300 128 144 game.rgba game.wav 10343679</span></code></pre></div>
<p>The parameters to the program are:</p>
<ol type="1">
<li>Window width.</li>
@@ -165,26 +164,26 @@ don’t know how to do this for your system.</p>
note on macOS.</li>
</ol>
<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">./giana.sh</span></span>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./giana.sh</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./mario.sh</span></span></code></pre></div>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./mario.sh</span></span></code></pre></div>
<p>If you end up telnetting to the server (feature of <a href="mario.sh">mario.sh</a>) you can
try:</p>
<pre><code>ls # show files including games
wumpus.bas # play Hunt the Wumpus
advent.gam # you know what this is! :-)
starwars # animated Star Wars &#39;film&#39;</code></pre>
<pre><code> ls # show files including games
wumpus.bas # play Hunt the Wumpus
advent.gam # you know what this is! :-)
starwars # animated Star Wars &#39;film&#39;</code></pre>
<p>If you wish to change the width and height, defaulting at 640 x 480, say to
800 x 800, try:</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="va">ROWS</span><span class="op">=</span>800 <span class="va">COLS</span><span class="op">=</span>800 <span class="ex">./mario.sh</span></span>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a> <span class="va">ROWS</span><span class="op">=</span>800 <span class="va">COLS</span><span class="op">=</span>800 <span class="ex">./mario.sh</span></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a><span class="va">ROWS</span><span class="op">=</span>800 <span class="va">COLS</span><span class="op">=</span>800 <span class="ex">./giana.sh</span></span></code></pre></div>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a> <span class="va">ROWS</span><span class="op">=</span>800 <span class="va">COLS</span><span class="op">=</span>800 <span class="ex">./giana.sh</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>A classic for a particular generation. Like all good programs, being data
driven means you can do fun things in small spaces.</p>
<p>NOTE: the author states to use <code>tabsize=4</code> to see the magic of the formatting of
the code. In <code>vim</code> you can do:</p>
<pre><code>:set tabstop=4</code></pre>
<pre><code> :set tabstop=4</code></pre>
<p>in command mode to see this effect. You don’t need to modify your <code>.vimrc</code> file!
You can also use <code>expand</code> as described below by the author if your terminal has
enough rows and you don’t want to move about in the code. The vim command should
@@ -192,10 +191,10 @@ immediately take effect.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="remarks">Remarks</h3>
<p>Use <code>tabsize=4</code> to see the magic.</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">expand</span> <span class="at">-t</span> 4 prog.c</span></code></pre></div>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">expand</span> <span class="at">-t</span> 4 prog.c</span></code></pre></div>
<p>The program returns 0 if the player wins or <em>non-zero</em> if the player loses so
you can test it and make something useful (or not), like this:</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">cat</span> mario.level <span class="kw">|</span> <span class="ex">./prog</span> 320 200 800 300 128 144 mario.rgba mario8.wav 10343679 <span class="kw">&amp;&amp;</span> <span class="ex">telnet</span> telehack.com 23</span></code></pre></div>
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">cat</span> mario.level <span class="kw">|</span> <span class="ex">./prog</span> 320 200 800 300 128 144 mario.rgba mario8.wav 10343679 <span class="kw">&amp;&amp;</span> <span class="ex">telnet</span> telehack.com 23</span></code></pre></div>
<p>and type in: <code>starwars</code></p>
<p>This is an engine for <a href="https://en.wikipedia.org/wiki/Platform_game">platform
game</a>. It can be used to create
@@ -255,32 +254,32 @@ note on macOS.</li>
<p>The program read a single image that contains all the game sprites. The image
must be a grid of 8xN sprites. The size of a single sprite must be square. The
program calculates the size in this way:</p>
<pre><code>sprite_size = image_width / 8</code></pre>
<pre><code> sprite_size = image_width / 8</code></pre>
<p>Each sprite is identified by its position inside the grid, counting line by
line, from left to right (for example sprite 0 is the top left sprite in the
grid, sprite 8 is the first sprite of the second row of the grid etc.).</p>
<p>Some positions of the grid have a predefined purpose:</p>
<pre><code>Position | Description
:-----------------|:--------------
0 | Player standing right
1 | Player walking right frame 0
2 | Player walking right frame 1
3 | Player jumping right
4 | Player standing left
5 | Player walking left frame 0
6 | Player walking left frame 1
7 | Player jumping left
8 *(second row)* | Super player standing right
9 | Super player walking right frame 0
10 | Super player walking right frame 1
11 | Super player jumping right
12 | Super player standing left
13 | Super player walking left frame 0
14 | Super player walking left frame 1
15 | Super player jumping left
24 | Player dead
32 | Player won
40 | Super player won</code></pre>
<pre><code> Position | Description
:-----------------|:--------------
0 | Player standing right
1 | Player walking right frame 0
2 | Player walking right frame 1
3 | Player jumping right
4 | Player standing left
5 | Player walking left frame 0
6 | Player walking left frame 1
7 | Player jumping left
8 *(second row)* | Super player standing right
9 | Super player walking right frame 0
10 | Super player walking right frame 1
11 | Super player jumping right
12 | Super player standing left
13 | Super player walking left frame 0
14 | Super player walking left frame 1
15 | Super player jumping left
24 | Player dead
32 | Player won
40 | Super player won</code></pre>
<p>All the others sprites can be used as you want, depending on the game you want
to create.</p>
<h2 id="levels">Levels</h2>
@@ -289,7 +288,7 @@ to create.</p>
You can input as many objects as you want but the maximum number of objects
handled by the program is 333. You can modify this value by editing the source
here:</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a>C<span class="op">[</span><span class="dv">333</span><span class="op">*</span><span class="dv">7</span><span class="op">],</span>d<span class="op">=</span><span class="dv">333</span><span class="op">;</span></span></code></pre></div>
<div class="sourceCode" id="cb12"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a> C<span class="op">[</span><span class="dv">333</span><span class="op">*</span><span class="dv">7</span><span class="op">],</span>d<span class="op">=</span><span class="dv">333</span><span class="op">;</span></span></code></pre></div>
<p>Each row has six columns:</p>
<ol type="1">
<li><code>Screen X</code> : <code>x</code> position of the object in the level.</li>
+14 -14
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make
make
```
There is a 121 byte version provided by the author. See [Alternate
@@ -13,7 +13,7 @@ code](#alternate-code) below.
The current status of this entry is:
```
STATUS: INABIAF - please **DO NOT** fix
STATUS: INABIAF - please **DO NOT** fix
```
For more detailed information see [2014 maffiodo2 bugs](../../bugs.html#2014_maffiodo2).
@@ -22,14 +22,14 @@ For more detailed information see [2014 maffiodo2 bugs](../../bugs.html#2014_maf
## To use:
```sh
./prog arg
./prog arg
```
## Try:
```sh
./try.sh
./try.sh
```
@@ -42,14 +42,14 @@ as fun but it's 121 bytes instead of 140.
### Alternate build:
```sh
make alt
make alt
```
### Alternate use:
```sh
cat image.rgb | ./prog.alt
cat image.rgb | ./prog.alt
```
@@ -92,7 +92,7 @@ If you have a terminal geometry than is different from the common 80x25 you can
modify the *output width* by changing the value of the first variable:
```c
d=80,
d=80,
```
### Something to try
@@ -100,14 +100,14 @@ d=80,
Type this:
```sh
cat image.rgb | ./prog " .:;Y0"
cat image.rgb | ./prog " .:;Y0"
```
You can use your own image. Convert the image to a raw RGB image. Using
ImageMagick it's very simple:
```sh
convert -geometry 80x source.jpg image.rgb
convert -geometry 80x source.jpg image.rgb
```
This program require one parameter or it will crash. The parameter of the
@@ -117,10 +117,10 @@ program is the *conversion ramp*. You can use different ramps or create your own
These are some ramps you can try:
```sh
./prog " :1"
./prog " .:;Y0"
./prog " .:-=+*#%@"
./prog " .,:!-iots&8%#@$"
./prog " :1"
./prog " .:;Y0"
./prog " .:-=+*#%@"
./prog " .,:!-iots&8%#@$"
```
### 121 byte version
@@ -128,7 +128,7 @@ These are some ramps you can try:
An alternative version of this program is only 121bytes long:
```c
d=80,e,j;g(){j+=getchar();}main(){for(;;){j=0;g();if(j<0)break;g(g());putchar(" .:#@"[j/3*5>>8]);if(!(++e%d))puts("");}}
d=80,e,j;g(){j+=getchar();}main(){for(;;){j=0;g();if(j<0)break;g(g());putchar(" .:#@"[j/3*5>>8]);if(!(++e%d))puts("");}}
```
This alternative version has a **fixed ramp**. It's smaller but it's not so fun to use...
+15 -16
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Sandro_Maffiodo">Sandro Maffiodo</a><br>
Location: <a href="../../location.html#IT">IT</a> - <em>Italian Republic</em> (<em>Italy</em>)
<br><br></li>
Location: <a href="../../location.html#IT">IT</a> - <em>Italian Republic</em> (<em>Italy</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,24 +141,24 @@ Location: <a href="../../location.html#IT">IT</a> - <em>Italian Republic</em> (<
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<p>There is a 121 byte version provided by the author. See <a href="#alternate-code">Alternate
code</a> below.</p>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code>STATUS: INABIAF - please **DO NOT** fix</code></pre>
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2014_maffiodo2">2014 maffiodo2 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">./prog</span> arg</span></code></pre></div>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> arg</span></code></pre></div>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>This shorter version is provided by the author. It has a fixed ramp and so not
as fun but it’s 121 bytes instead of 140.</p>
<h3 id="alternate-build">Alternate build:</h3>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> image.rgb <span class="kw">|</span> <span class="ex">./prog.alt</span></span></code></pre></div>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">cat</span> image.rgb <span class="kw">|</span> <span class="ex">./prog.alt</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>On the face of it :-) given what this program does one might wonder what makes
this winning entry special. But when you realize the source is small enough for posting
@@ -186,24 +185,24 @@ from <code>stdin</code> and print the ASCII ART to <code>stdout</code>.</p>
<h3 id="screen-size">Screen size</h3>
<p>If you have a terminal geometry than is different from the common 80x25 you can
modify the <em>output width</em> by changing the value of the first variable:</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>d<span class="op">=</span><span class="dv">80</span><span class="op">,</span></span></code></pre></div>
<div class="sourceCode" id="cb7"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a> d<span class="op">=</span><span class="dv">80</span><span class="op">,</span></span></code></pre></div>
<h3 id="something-to-try">Something to try</h3>
<p>Type 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="fu">cat</span> image.rgb <span class="kw">|</span> <span class="ex">./prog</span> <span class="st">&quot; .:;Y0&quot;</span></span></code></pre></div>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">cat</span> image.rgb <span class="kw">|</span> <span class="ex">./prog</span> <span class="st">&quot; .:;Y0&quot;</span></span></code></pre></div>
<p>You can use your own image. Convert the image to a raw RGB image. Using
ImageMagick it’s very simple:</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">convert</span> <span class="at">-geometry</span> 80x source.jpg image.rgb</span></code></pre></div>
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">convert</span> <span class="at">-geometry</span> 80x source.jpg image.rgb</span></code></pre></div>
<p>This program require one parameter or it will crash. The parameter of the
program is the <em>conversion ramp</em>. You can use different ramps or create your own
(for example using some letters of your name).</p>
<p>These are some ramps you can 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">./prog</span> <span class="st">&quot; :1&quot;</span></span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./prog</span> <span class="st">&quot; .:;Y0&quot;</span></span>
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./prog</span> <span class="st">&quot; .:-=+*#%@&quot;</span></span>
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a><span class="ex">./prog</span> <span class="st">&quot; .,:!-iots&amp;8%#@$&quot;</span></span></code></pre></div>
<div class="sourceCode" id="cb10"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> <span class="st">&quot; :1&quot;</span></span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> <span class="st">&quot; .:;Y0&quot;</span></span>
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> <span class="st">&quot; .:-=+*#%@&quot;</span></span>
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> <span class="st">&quot; .,:!-iots&amp;8%#@$&quot;</span></span></code></pre></div>
<h3 id="byte-version">121 byte version</h3>
<p>An alternative version of this program is only 121bytes long:</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a>d<span class="op">=</span><span class="dv">80</span><span class="op">,</span>e<span class="op">,</span>j<span class="op">;</span>g<span class="op">(){</span>j<span class="op">+=</span>getchar<span class="op">();}</span>main<span class="op">(){</span><span class="cf">for</span><span class="op">(;;){</span>j<span class="op">=</span><span class="dv">0</span><span class="op">;</span>g<span class="op">();</span><span class="cf">if</span><span class="op">(</span>j<span class="op">&lt;</span><span class="dv">0</span><span class="op">)</span><span class="cf">break</span><span class="op">;</span>g<span class="op">(</span>g<span class="op">());</span>putchar<span class="op">(</span><span class="st">&quot; .:#@&quot;</span><span class="op">[</span>j<span class="op">/</span><span class="dv">3</span><span class="op">*</span><span class="dv">5</span><span class="op">&gt;&gt;</span><span class="dv">8</span><span class="op">]);</span><span class="cf">if</span><span class="op">(!(++</span>e<span class="op">%</span>d<span class="op">))</span>puts<span class="op">(</span><span class="st">&quot;&quot;</span><span class="op">);}}</span></span></code></pre></div>
<div class="sourceCode" id="cb11"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a> d<span class="op">=</span><span class="dv">80</span><span class="op">,</span>e<span class="op">,</span>j<span class="op">;</span>g<span class="op">(){</span>j<span class="op">+=</span>getchar<span class="op">();}</span>main<span class="op">(){</span><span class="cf">for</span><span class="op">(;;){</span>j<span class="op">=</span><span class="dv">0</span><span class="op">;</span>g<span class="op">();</span><span class="cf">if</span><span class="op">(</span>j<span class="op">&lt;</span><span class="dv">0</span><span class="op">)</span><span class="cf">break</span><span class="op">;</span>g<span class="op">(</span>g<span class="op">());</span>putchar<span class="op">(</span><span class="st">&quot; .:#@&quot;</span><span class="op">[</span>j<span class="op">/</span><span class="dv">3</span><span class="op">*</span><span class="dv">5</span><span class="op">&gt;&gt;</span><span class="dv">8</span><span class="op">]);</span><span class="cf">if</span><span class="op">(!(++</span>e<span class="op">%</span>d<span class="op">))</span>puts<span class="op">(</span><span class="st">&quot;&quot;</span><span class="op">);}}</span></span></code></pre></div>
<p>This alternative version has a <strong>fixed ramp</strong>. It’s smaller but it’s not so fun to use…</p>
<!--
+6 -6
View File
@@ -1,21 +1,21 @@
## To build:
```sh
make
make
```
## To use:
```sh
./prog [arg ..]
./prog [arg ..]
```
## Try:
```sh
./try.sh
./try.sh
```
@@ -78,9 +78,9 @@ It will recursively use itself for sub-make (the `MAKE=` assignment inside
With gcc 4.8.2 on Linux Ubuntu 14.04 64-bit :
```
prog.c:22:15: warning: return makes integer from pointer without a cast [enabled by default]
prog.c:23:72: warning: signed and unsigned type in conditional expression [-Wsign-compare]
prog.c:12:11: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
prog.c:22:15: warning: return makes integer from pointer without a cast [enabled by default]
prog.c:23:72: warning: signed and unsigned type in conditional expression [-Wsign-compare]
prog.c:12:11: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
```
<!--
+7 -8
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Yves-Marie_Morgan">Yves-Marie Morgan</a><br>
Location: <a href="../../location.html#FR">FR</a> - <em>French Republic</em> (<em>France</em>)
<br><br></li>
Location: <a href="../../location.html#FR">FR</a> - <em>French Republic</em> (<em>France</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,11 +141,11 @@ Location: <a href="../../location.html#FR">FR</a> - <em>French Republic</em> (<e
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./prog</span> [arg ..]</span></code></pre></div>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> [arg ..]</span></code></pre></div>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Think of this as a Maker Faire’s make. :-)</p>
<p>It works reasonably well. While not super ultra-featured, it does fair well
@@ -191,9 +190,9 @@ It will recursively use itself for sub-make (the <code>MAKE=</code> assignment i
</ul>
<h3 id="compilation-warnings">Compilation warnings</h3>
<p>With gcc 4.8.2 on Linux Ubuntu 14.04 64-bit :</p>
<pre><code>prog.c:22:15: warning: return makes integer from pointer without a cast [enabled by default]
prog.c:23:72: warning: signed and unsigned type in conditional expression [-Wsign-compare]
prog.c:12:11: warning: suggest parentheses around ‘&amp;&amp;’ within ‘||’ [-Wparentheses]</code></pre>
<pre><code> prog.c:22:15: warning: return makes integer from pointer without a cast [enabled by default]
prog.c:23:72: warning: signed and unsigned type in conditional expression [-Wsign-compare]
prog.c:12:11: warning: suggest parentheses around ‘&amp;&amp;’ within ‘||’ [-Wparentheses]</code></pre>
<!--
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
+9 -9
View File
@@ -1,23 +1,23 @@
## To build:
```sh
make
make
```
## To use:
```sh
./hecate.sh
./hecate.sh
./glock.sh
./glock.sh
```
## Try:
```sh
./try.sh
./try.sh
```
This script will ask you if you wish to try again after each run. Type in any
@@ -42,10 +42,10 @@ To start, compile and run the program. To resume, compile and run the
output repeatedly until you have won/lost the game. For example:
```sh
cp prog.c run.c
gcc -O0 run.c -o run && ./run | tee run.c
gcc -O2 run.c -o run && ./run | tee run.c
...
cp prog.c run.c
gcc -O0 run.c -o run && ./run | tee run.c
gcc -O2 run.c -o run && ./run | tee run.c
...
```
### Details
@@ -107,7 +107,7 @@ that there are no files named "run" and "run.c" in current directory
(they will be overwritten) and run:
```sh
perl prog.c | bash
perl prog.c | bash
```
File size and CRC32 of [prog.c](prog.c) are embedded in line 7.
+10 -11
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Don_Yang">Don Yang</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,13 +141,13 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./hecate.sh</span></span>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./hecate.sh</span></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">./glock.sh</span></span></code></pre></div>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./glock.sh</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<p>This script will ask you if you wish to try again after each run. Type in any
character other than <code>y</code> or <code>Y</code> to exit at this point.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
@@ -161,10 +160,10 @@ or unspecified behavior?</p>
under one minute.</p>
<p>To start, compile and run the program. To resume, compile and run the
output repeatedly until you have won/lost the game. For example:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cp</span> prog.c run.c</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="fu">gcc</span> <span class="at">-O0</span> run.c <span class="at">-o</span> run <span class="kw">&amp;&amp;</span> <span class="ex">./run</span> <span class="kw">|</span> <span class="fu">tee</span> run.c</span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="fu">gcc</span> <span class="at">-O2</span> run.c <span class="at">-o</span> run <span class="kw">&amp;&amp;</span> <span class="ex">./run</span> <span class="kw">|</span> <span class="fu">tee</span> run.c</span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a><span class="ex">...</span></span></code></pre></div>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">cp</span> prog.c run.c</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">gcc</span> <span class="at">-O0</span> run.c <span class="at">-o</span> run <span class="kw">&amp;&amp;</span> <span class="ex">./run</span> <span class="kw">|</span> <span class="fu">tee</span> run.c</span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">gcc</span> <span class="at">-O2</span> run.c <span class="at">-o</span> run <span class="kw">&amp;&amp;</span> <span class="ex">./run</span> <span class="kw">|</span> <span class="fu">tee</span> run.c</span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">...</span></span></code></pre></div>
<h3 id="details">Details</h3>
<p><code>Sinon</code> is played by compiling and running the output repeatedly. Two
factors determine what actions are taken:</p>
@@ -212,7 +211,7 @@ a primary input.</p>
<p><code>Sinon</code> has a demo mode that plays the game automatically. Make sure
that there are no files named “run” and “run.c” in current directory
(they will be overwritten) and run:</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">perl</span> prog.c <span class="kw">|</span> <span class="fu">bash</span></span></code></pre></div>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">perl</span> prog.c <span class="kw">|</span> <span class="fu">bash</span></span></code></pre></div>
<p>File size and CRC32 of <a href="prog.c">prog.c</a> are embedded in line 7.</p>
<p>Process for making <code>Sinon</code> is included in <a href="spoiler.html">spoiler.html</a>.</p>
<p>Layout of this code is based on Asada Shino, also known as “<code>Sinon</code>”,
+6 -4
View File
@@ -1,14 +1,14 @@
## To build:
```sh
make
make
```
## To use:
```sh
./prog
./prog
```
HINT: Try pressing the left and right arrow keys as needed.
@@ -220,8 +220,10 @@ I ran out of time to test it on more systems.
* What's the length of this README file according to the
[iocccsize](../iocccsize.c) tool?
$ ./iocccsize -i < README.md
6057
```
$ ./iocccsize -i < README.md
6057
```
<!--
+6 -7
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Cel_Skeggs">Cel Skeggs</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,9 +141,9 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./prog</span></span></code></pre></div>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span></span></code></pre></div>
<p>HINT: Try pressing the left and right arrow keys as needed.
Also try pressing space/enter to select options.
Pressing Q or Escape may end the fun before you are ready. :-)</p>
@@ -294,10 +293,10 @@ require a pet fish license.</p></li>
Station 13. I didn’t, however, look at the minigame at all during the
development of this entry.</p></li>
<li><p>What’s the length of this README file according to the
<a href="../iocccsize.c">iocccsize</a> tool?</p>
<p>$ ./iocccsize -i &lt; README.md
6057</p></li>
<a href="../iocccsize.c">iocccsize</a> tool?</p></li>
</ul>
<pre><code> $ ./iocccsize -i &lt; README.md
6057</code></pre>
<!--
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
+10 -11
View File
@@ -1,7 +1,7 @@
## To build:
```sh
make
make
```
There is an alternate version that will theoretically work with Windows
@@ -14,7 +14,7 @@ code](#alternate-code) section below.
The current status of this entry is:
```
STATUS: known bug - please help us fix
STATUS: known bug - please help us fix
```
For more detailed information see [2014 vik bugs](../../bugs.html#2014_vik).
@@ -23,16 +23,16 @@ For more detailed information see [2014 vik bugs](../../bugs.html#2014_vik).
## To use:
```sh
echo foo | ./prog > audio_file.raw
echo foo | ./prog > audio_file.raw
echo foo | ./prog | mplayer -demuxer rawaudio -
echo foo | ./prog | mplayer -demuxer rawaudio -
```
## Try:
```sh
./try.sh
./try.sh
```
@@ -45,7 +45,7 @@ instructions on how to get it to work with Windows.
### Alternate build:
```sh
make alt
make alt
```
@@ -60,14 +60,13 @@ This program sets a new tone for obfuscation. But do you understand
what it says about obfuscation? Perhaps:
```sh
./prog < prog.c > prog.raw
./prog < prog.c > prog.raw
```
might speak to your coding style? If not, then perhaps:
```sh
./prog < README.md | mplayer -demuxer rawaudio -
./prog < README.md | mplayer -demuxer rawaudio -
```
might help? :-)
@@ -89,7 +88,7 @@ Don't forget the last '`-`' as it makes `mplayer(1)` read from `stdin`.
## Convert audio file with Morse signals to text
```sh
./prog e < audio_file.raw
./prog e < audio_file.raw
```
or alternatively pass a .wav file as input.
@@ -108,7 +107,7 @@ program with this platform, the following line can be added to `main()` before
any code in order for the program to run correctly:
```c
_setmode(_fileno(stdout), 0x8000);
_setmode(_fileno(stdout), 0x8000);
```
NOTE: see the [alternate code](prog.alt.c) for this.
+11 -12
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Daniel_Vik">Daniel Vik</a><br>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
<br><br></li>
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,33 +141,33 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<p>There is an alternate version that will theoretically work with Windows
compilers (if anything in Windows works :-) ). See the <a href="#alternate-code">Alternate
code</a> section below.</p>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code>STATUS: known bug - please help us fix</code></pre>
<pre><code> STATUS: known bug - please help us fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2014_vik">2014 vik 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="bu">echo</span> foo <span class="kw">|</span> <span class="ex">./prog</span> <span class="op">&gt;</span> audio_file.raw</span>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> foo <span class="kw">|</span> <span class="ex">./prog</span> <span class="op">&gt;</span> audio_file.raw</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="bu">echo</span> foo <span class="kw">|</span> <span class="ex">./prog</span> <span class="kw">|</span> <span class="ex">mplayer</span> <span class="at">-demuxer</span> rawaudio <span class="at">-</span></span></code></pre></div>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> foo <span class="kw">|</span> <span class="ex">./prog</span> <span class="kw">|</span> <span class="ex">mplayer</span> <span class="at">-demuxer</span> rawaudio <span class="at">-</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2>
<p>The alternate code, <a href="prog.alt.c">prog.alt.c</a>, is based on the author’s
instructions on how to get it to work with Windows.</p>
<h3 id="alternate-build">Alternate build:</h3>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> alt</span></code></pre></div>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>prog.alt</code> as you would <code>prog</code> above as well as below.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This program sets a new tone for obfuscation. But do you understand
what it says about obfuscation? Perhaps:</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">./prog</span> <span class="op">&lt;</span> prog.c <span class="op">&gt;</span> prog.raw</span></code></pre></div>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> <span class="op">&lt;</span> prog.c <span class="op">&gt;</span> prog.raw</span></code></pre></div>
<p>might speak to your coding style? If not, then perhaps:</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">./prog</span> <span class="op">&lt;</span> README.md <span class="kw">|</span> <span class="ex">mplayer</span> <span class="at">-demuxer</span> rawaudio <span class="at">-</span></span></code></pre></div>
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> <span class="op">&lt;</span> README.md <span class="kw">|</span> <span class="ex">mplayer</span> <span class="at">-demuxer</span> rawaudio <span class="at">-</span></span></code></pre></div>
<p>might help? :-)</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="remarks">Remarks</h3>
@@ -178,7 +177,7 @@ I can tell, there are at least six chocolate references in this program.</p>
Via streaming to <code>mplayer(1)</code>, you can listen to the Morse audio.</p>
<p>Don’t forget the last ‘<code>-</code>’ as it makes <code>mplayer(1)</code> read from <code>stdin</code>.</p>
<h2 id="convert-audio-file-with-morse-signals-to-text">Convert audio file with Morse signals to text</h2>
<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">./prog</span> e <span class="op">&lt;</span> audio_file.raw</span></code></pre></div>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span> e <span class="op">&lt;</span> audio_file.raw</span></code></pre></div>
<p>or alternatively pass a .wav file as input.</p>
<p>The preferred input format 44.1kHz stereo, but it does a decent job on mono
input and different frequencies as well.</p>
@@ -188,7 +187,7 @@ the program relies on writing binary data to <code>stdout</code>.</p>
<p>Microsoft compilers add a carriage return to newlines, and to compile the
program with this platform, the following line can be added to <code>main()</code> before
any code in order for the program to run correctly:</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>_setmode<span class="op">(</span>_fileno<span class="op">(</span>stdout<span class="op">),</span> <span class="bn">0x8000</span><span class="op">);</span></span></code></pre></div>
<div class="sourceCode" id="cb9"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a> _setmode<span class="op">(</span>_fileno<span class="op">(</span>stdout<span class="op">),</span> <span class="bn">0x8000</span><span class="op">);</span></span></code></pre></div>
<p>NOTE: see the <a href="prog.alt.c">alternate code</a> for this.</p>
<h3 id="known-issues">Known Issues</h3>
<p>The program uses a quite simple algorithm for detecting tone on and off events
+6 -6
View File
@@ -1,21 +1,21 @@
## To build:
```sh
make
make
```
## To use:
```sh
./prog
./prog
```
## Try:
```sh
./try.sh
./try.sh
```
By default that will use `indent(1)` found by the shell `type -P indent` and
@@ -23,7 +23,7 @@ By default that will use `indent(1)` found by the shell `type -P indent` and
to try a different beautifier, you can do it like:
```sh
INDENT=bcpp ./try.sh
INDENT=bcpp ./try.sh
```
which would change it to use `bcpp(1)` instead of `indent(1)`. Do similar for
@@ -57,8 +57,8 @@ executable C functions.
- The readable implementation of `Y` is on lines 29-30:
```
W_f = \x.f(xx)
Y = \f.W_f W_f
W_f = \x.f(xx)
Y = \f.W_f W_f
```
- A mixture of strict and lazy evaluation, with a `_` force function
+7 -8
View File
@@ -132,8 +132,7 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Freek_Wiedijk">Freek Wiedijk</a><br>
Location: <a href="../../location.html#NL">NL</a> - <em>Kingdom of the Netherlands</em> (<em>Netherlands</em>)
<br><br></li>
Location: <a href="../../location.html#NL">NL</a> - <em>Kingdom of the Netherlands</em> (<em>Netherlands</em>)</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -142,15 +141,15 @@ Location: <a href="../../location.html#NL">NL</a> - <em>Kingdom of the Netherlan
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./prog</span></span></code></pre></div>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./prog</span></span></code></pre></div>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<p>By default that will use <code>indent(1)</code> found by the shell <code>type -P indent</code> and
<code>sed(1)</code> found by the shell <code>type -P sed</code> but if you want to change these, say
to try a different beautifier, you can do it like:</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="va">INDENT</span><span class="op">=</span>bcpp <span class="ex">./try.sh</span></span></code></pre></div>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="va">INDENT</span><span class="op">=</span>bcpp <span class="ex">./try.sh</span></span></code></pre></div>
<p>which would change it to use <code>bcpp(1)</code> instead of <code>indent(1)</code>. Do similar for
<code>sed(1)</code> only use the name <code>SED</code>.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
@@ -173,8 +172,8 @@ executable C functions.</li>
<li>Recursion implemented through Curry’s paradoxical combinator <code>Y</code>.</li>
<li>The readable implementation of <code>Y</code> is on lines 29-30:</li>
</ul>
<pre><code>W_f = \x.f(xx)
Y = \f.W_f W_f</code></pre>
<pre><code> W_f = \x.f(xx)
Y = \f.W_f W_f</code></pre>
<ul>
<li>A mixture of strict and lazy evaluation, with a <code>_</code> force function
(John Tromp notes that if Turing’s fixed-point combinator