add hack-a-round for language specified markdown code blocks

When language is specified in a markdown code block such as:

````
```c
    printf("Hello, world!\n");
```
````

is used, the resulting HTML as produced by `pandoc(1)` combined
with our revised `ioccc.css` is not intent the code block well.

A temporary "_hack-a-round_" is to turn the "markdown code language
specifier" into an HTML comment.  For example:

````
```<!---c-->
    printf("Hello, world!\n");
```
````

This commits turns off existing markdown code language specifiers
for now, while preserving our ability to restore them in the future
when a better  "_hack-a-round_" to the "markdown code language
specifier" problem is found.

The HTML impact if this "_hack-a-round_" is to produce HTML that
looks like this:

```
<pre class="&lt;!---c--&gt;"><code> .. </code></pre>
```

We might be able to create a complex set of classes for each markdown
code language (there won't be very many) in `ioccc.css`, or we might
find a more general CSS (or maybe `pandoc(1)`?) solution.

For now, this hack-a-round will have to do.
This commit is contained in:
Landon Curt Noll committed 2024-04-04 14:50:38 -07:00
1 parent 3919df50fb
commit b66c79254a
700 files changed
+7052 -7056

No files matched your search

+9 -9
View File
@@ -1,20 +1,20 @@
## To build:
```sh
```<!---sh-->
make
```
## To use:
```sh
```<!---sh-->
./akari [ input_file | - ] [ output_file | - ] [even]
```
## Try:
```sh
```<!---sh-->
./try.sh
```
@@ -56,7 +56,7 @@ keep odd pixels on odd [scanlines](https://en.wikipedia.org/wiki/Scan_line).
### Examples:
```sh
```<!---sh-->
gcc akari.c -o akari
./akari < example.ppm > odd_output.ppm
./akari - - even < example.ppm > even_output.ppm
@@ -82,7 +82,7 @@ Anything that is not parsable as `PGM` or `PPM` will be downsampled as
ASCII art. Since the source code is formatted as ASCII art, it's only
natural to try:
```sh
```<!---sh-->
./akari akari.c akari2.c
```
@@ -91,7 +91,7 @@ By default, this second program reads text from `stdin` and writes
expanded output to `stdout`. If the extra argument is specified, the
output text will also pass through a rot13 filter.
```sh
```<!---sh-->
gcc akari2.c -o akari2
./akari2 < input.txt > expanded_output.txt
./akari2 rot13 < input.txt > expanded_and_rot13_output.txt
@@ -100,20 +100,20 @@ output text will also pass through a rot13 filter.
You can combine the two programs together to have just a regular rot13
filter:
```sh
```<!---sh-->
./akari2 rot13 < input.txt | ./akari > rot13.txt
```
Of course, we wouldn't stop with just 2 programs, you can downsample
the source *again* and get yet another C program:
```sh
```<!---sh-->
./akari < akari.c | ./akari > akari3.c
```
We must go deeper:
```sh
```<!---sh-->
./akari < akari.c | ./akari | ./akari > akari4.c
```
+14 -14
View File
@@ -141,11 +141,11 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./akari</span> [ input_file <span class="kw">|</span> <span class="ex">-</span> ] [ output_file <span class="kw">|</span> <span class="ex">-</span> ] <span class="pp">[</span><span class="ss">even</span><span class="pp">]</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./akari [ input_file | - ] [ output_file | - ] [even]</code></pre>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p><code>Akari</code> is an image downsampling utility that accepts 3 input formats:</p>
<ul>
@@ -171,10 +171,10 @@ will read from <code>stdin</code>.</p>
<a href="https://en.wikipedia.org/wiki/Scan_line">scanlines</a>. By default <code>Akari</code> will
keep odd pixels on odd <a href="https://en.wikipedia.org/wiki/Scan_line">scanlines</a>.</p>
<h3 id="examples">Examples:</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">gcc</span> akari.c <span class="at">-o</span> akari</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./akari</span> <span class="op">&lt;</span> example.ppm <span class="op">&gt;</span> odd_output.ppm</span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./akari</span> <span class="at">-</span> <span class="at">-</span> even <span class="op">&lt;</span> example.ppm <span class="op">&gt;</span> even_output.ppm</span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> <span class="ex">./akari</span> example.ppm odd_output.ppm</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> gcc akari.c -o akari
./akari &lt; example.ppm &gt; odd_output.ppm
./akari - - even &lt; example.ppm &gt; even_output.ppm
./akari example.ppm odd_output.ppm</code></pre>
<p><code>Akari</code> accepts 3 input formats:</p>
<ul>
<li><a href="https://netpbm.sourceforge.net/doc/pgm.html">PGM</a>
@@ -192,22 +192,22 @@ the included <a href="example.ppm">example.ppm</a>.</p>
<p>Anything that is not parsable as <code>PGM</code> or <code>PPM</code> will be downsampled as
ASCII art. Since the source code is formatted as ASCII art, it’s only
natural to try:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./akari</span> akari.c akari2.c</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./akari akari.c akari2.c</code></pre>
<p><code>akari2.c</code> is also a valid C program, and accepts up to 1 argument.
By default, this second program reads text from <code>stdin</code> and writes
expanded output to <code>stdout</code>. If the extra argument is specified, the
output text will also pass through a rot13 filter.</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">gcc</span> akari2.c <span class="at">-o</span> akari2</span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./akari2</span> <span class="op">&lt;</span> input.txt <span class="op">&gt;</span> expanded_output.txt</span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a> <span class="ex">./akari2</span> rot13 <span class="op">&lt;</span> input.txt <span class="op">&gt;</span> expanded_and_rot13_output.txt</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> gcc akari2.c -o akari2
./akari2 &lt; input.txt &gt; expanded_output.txt
./akari2 rot13 &lt; input.txt &gt; expanded_and_rot13_output.txt</code></pre>
<p>You can combine the two programs together to have just a regular rot13
filter:</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">./akari2</span> rot13 <span class="op">&lt;</span> input.txt <span class="kw">|</span> <span class="ex">./akari</span> <span class="op">&gt;</span> rot13.txt</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./akari2 rot13 &lt; input.txt | ./akari &gt; rot13.txt</code></pre>
<p>Of course, we wouldn’t stop with just 2 programs, you can downsample
the source <em>again</em> and get yet another C program:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./akari</span> <span class="op">&lt;</span> akari.c <span class="kw">|</span> <span class="ex">./akari</span> <span class="op">&gt;</span> akari3.c</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./akari &lt; akari.c | ./akari &gt; akari3.c</code></pre>
<p>We must go deeper:</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">./akari</span> <span class="op">&lt;</span> akari.c <span class="kw">|</span> <span class="ex">./akari</span> <span class="kw">|</span> <span class="ex">./akari</span> <span class="op">&gt;</span> akari4.c</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./akari &lt; akari.c | ./akari | ./akari &gt; akari4.c</code></pre>
<p><code>akari3.c</code> and <code>akari4.c</code> are still (mostly valid) C programs.
<code>gcc -Wall</code> will output a few warnings, but still produce output
executables. The output executables each print a message to <code>stdout</code>.</p>
+8 -8
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make
```
@@ -9,20 +9,20 @@
Zoom out and make your terminal window 53 or more lines deep.
```sh
```<!---sh-->
./blakely < blakely.c | head -300
```
## Try:
```sh
```<!---sh-->
./try.sh
```
For those who have a lot of time, try:
```sh
```<!---sh-->
./blakely < t0_3.dat
```
@@ -40,7 +40,7 @@ is a [Garden of Eden](http://en.wikipedia.org/wiki/Garden_of_Eden_%28cellular_au
If you have enough time to spare, put the plan of your garden in a text file,
and run:
```sh
```<!---sh-->
./blakely - < garden.txt
```
@@ -54,7 +54,7 @@ over tabs.
In order to see the main feature of the code, type:
```sh
```<!---sh-->
./blakely < blakely.c
```
@@ -72,7 +72,7 @@ layout of the source-code is such that it evolves to a digital representation of
the first 15 decimal places of pi after 4 time steps. This was setup using the
other feature of the program which can be demonstrated as follows:
```sh
```<!---sh-->
./blakely - < 3.dat
```
@@ -81,7 +81,7 @@ more grids (taking a few minutes to display the last). Waiting for any more
grids will take a substantial amount of time. The final grid has been put into
[evolve_to_3.dat](evolve_to_3.dat), and if you type
```sh
```<!---sh-->
./blakely < evolve_to_3.dat
```
+8 -8
View File
@@ -141,14 +141,14 @@ Location: <a href="../../location.html#GB">GB</a> - <em>United Kingdom of Great
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h2 id="to-use">To use:</h2>
<p>Zoom out and make your terminal window 53 or more lines deep.</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./blakely</span> <span class="op">&lt;</span> blakely.c <span class="kw">|</span> <span class="fu">head</span> <span class="at">-300</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./blakely &lt; blakely.c | head -300</code></pre>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<p>For those who have a lot of time, try:</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">./blakely</span> <span class="op">&lt;</span> t0_3.dat</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./blakely &lt; t0_3.dat</code></pre>
<p>though one might or might not need to kill it, depending on your boredom
threshold.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
@@ -158,14 +158,14 @@ if given its own source as input, and allows to check if your garden
is a <a href="http://en.wikipedia.org/wiki/Garden_of_Eden_%28cellular_automaton%29">Garden of Eden</a>, all in one source.</p>
<p>If you have enough time to spare, put the plan of your garden in a text file,
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="ex">./blakely</span> <span class="at">-</span> <span class="op">&lt;</span> garden.txt</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./blakely - &lt; garden.txt</code></pre>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This program uses a well-known algorithm in order to display pi to fifteen
decimal places. The source-layout itself demonstrates the importance of using
the correct amount of whitespace in code and the clear superiority of spaces
over tabs.</p>
<p>In order to see the main feature of the code, type:</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">./blakely</span> <span class="op">&lt;</span> blakely.c</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./blakely &lt; blakely.c</code></pre>
<p>and wait for about four seconds before using Ctrl-C (or whatever) to end the program. The
results are best viewed in a terminal window at least 60 characters
high and wide. Alternatively, redirect the output to a separate file
@@ -176,12 +176,12 @@ Life</a>”, using standard input as a starting grid. The
layout of the source-code is such that it evolves to a digital representation of
the first 15 decimal places of pi after 4 time steps. This was setup using the
other feature of the program which can be demonstrated as follows:</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">./blakely</span> <span class="at">-</span> <span class="op">&lt;</span> 3.dat</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./blakely - &lt; 3.dat</code></pre>
<p>The program will first display the grid given in <a href="3.dat">3.dat</a>, and then three
more grids (taking a few minutes to display the last). Waiting for any more
grids will take a substantial amount of time. The final grid has been put into
<a href="evolve_to_3.dat">evolve_to_3.dat</a>, and if you type</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./blakely</span> <span class="op">&lt;</span> evolve_to_3.dat</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./blakely &lt; evolve_to_3.dat</code></pre>
<p>then the 3 will reappear after three time steps.</p>
<p>As should now be clear, this use of the program will attempt to evolve a given setup
backwards in time according to the Life rules. The resulting grid is clearly not
+3 -3
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make
```
@@ -18,14 +18,14 @@ For more detailed information see [2011 borsanyi bugs](../../bugs.html#2011_bors
## To use:
```sh
```<!---sh-->
./borsanyi < some_data_file
```
## Try:
```sh
```<!---sh-->
./try.sh
```
+3 -3
View File
@@ -141,15 +141,15 @@ Location: <a href="../../location.html#DE">DE</a> - <em>Federal Republic of Germ
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2011_borsanyi">2011 borsanyi bugs</a>.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./borsanyi</span> <span class="op">&lt;</span> some_data_file</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./borsanyi &lt; some_data_file</code></pre>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This is a nice quick <a href="https://en.wikipedia.org/wiki/Histogram">histogram</a>
plotter. A useful utility when you need to look at the distribution of some
+12 -12
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make
```
@@ -19,7 +19,7 @@ For more detailed information see [2011 dlowe bugs](../../bugs.html#2011_dlowe).
## To use:
```sh
```<!---sh-->
./dlowe -<n_iterations> corpus1/ [...] corpus0/ < start.net > trained.net
```
@@ -27,7 +27,7 @@ NOTE: In the above command, the directory args MUST end in a `/`.
Then to use `trained.net`:
```sh
```<!---sh-->
./dlowe file [file ...] < trained.net
```
@@ -36,7 +36,7 @@ Then to use `trained.net`:
Try these pre-trained networks:
```sh
```<!---sh-->
./try.sh
```
@@ -44,7 +44,7 @@ NOTE: The `dlowe-aux-data/` directory, which [try.sh](try.sh) refers to, was
created by:
```sh
```<!---sh-->
tar -jxf dlowe-aux-data.tar.bz2
```
@@ -63,7 +63,7 @@ on the C code of entries that were supplied to the 20Th IOCCC.
The `ioccc-winlose-trained.net` was trained using the
[earlystop.pl](earlystop.pl) tool:
```sh
```<!---sh-->
rm -f ioccc-winlose-trained.net
./earlystop.pl ioccc-winlose-trained.net ioccc_won_training/ ioccc_lost_training/ ioccc_won_test/ ioccc_lost_test/
```
@@ -101,7 +101,7 @@ The resulting `ioccc-winlose-trained.net` file was included in the
The [dlowe.c](dlowe.c) was explicitly excluded from this trailing set, so this
test is interesting:
```sh
```<!---sh-->
./dlowe dlowe.c < dlowe-aux-data/ioccc-winlose-trained.net
```
@@ -127,7 +127,7 @@ data sets on which to test:
We created the [english-trained.net](dlowe-aux-data/english-trained.net) as follows:
```sh
```<!---sh-->
./dlowe -8000 dlowe-aux-data/english-1/ dlowe-aux-data/english-0/ < /dev/null > dlowe-aux-data/english-trained.net
```
@@ -139,7 +139,7 @@ We created the [english-trained.net](dlowe-aux-data/english-trained.net) as foll
We created the [png-trained.net](dlowe-aux-data/png-trained.net) as follows:
```sh
```<!---sh-->
./dlowe -8000 png-1/ png-0/ < /dev/null > dlowe-aux-data/png-trained.net
```
@@ -151,7 +151,7 @@ We created the [png-trained.net](dlowe-aux-data/png-trained.net) as follows:
We created the [xor-trained.net](dlowe-aux-data/xor-trained.net) as follows:
```sh
```<!---sh-->
./dlowe -8000 dlowe-aux-data/xor-1/ dlowe-aux-data/xor-0/ < /dev/null > dlowe-aux-data/xor-trained.net
```
@@ -189,7 +189,7 @@ The neurons' activation function is the logistic function `1 / (1 + e ^ -x)`.
### Classifying
```sh
```<!---sh-->
./dlowe file [file ...] < trained.net
```
@@ -205,7 +205,7 @@ trained, but it's geared toward interpretation as a *probability* or a
### Training
```sh
```<!---sh-->
./dlowe -<n_iterations> corpus1/ [...] corpus0/ < start.net > end.net
```
+13 -13
View File
@@ -141,23 +141,23 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code> STATUS: missing or dead link - please provide them
STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2011_dlowe">2011 dlowe 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">./dlowe</span> <span class="at">-</span><span class="op">&lt;</span>n_iterations<span class="op">&gt;</span> corpus1/ <span class="pp">[</span><span class="ss">...</span><span class="pp">]</span> corpus0/ <span class="op">&lt;</span> start.net <span class="op">&gt;</span> trained.net</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./dlowe -&lt;n_iterations&gt; corpus1/ [...] corpus0/ &lt; start.net &gt; trained.net</code></pre>
<p>NOTE: In the above command, the directory args MUST end in a <code>/</code>.</p>
<p>Then to use <code>trained.net</code>:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./dlowe</span> file [file ...] <span class="op">&lt;</span> trained.net</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./dlowe file [file ...] &lt; trained.net</code></pre>
<h2 id="try">Try:</h2>
<p>Try these pre-trained networks:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<p>NOTE: The <code>dlowe-aux-data/</code> directory, which <a href="try.sh">try.sh</a> refers to, was
created by:</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">tar</span> <span class="at">-jxf</span> dlowe-aux-data.tar.bz2</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> tar -jxf dlowe-aux-data.tar.bz2</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This entry is a ghoulish example of a brain (dead?) neural network classifier.
It comes with a set of corpora for you to try.</p>
@@ -166,8 +166,8 @@ It comes with a set of corpora for you to try.</p>
on the C code of entries that were supplied to the 20Th IOCCC.</p>
<p>The <code>ioccc-winlose-trained.net</code> was trained using the
<a href="earlystop.pl">earlystop.pl</a> tool:</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">rm</span> <span class="at">-f</span> ioccc-winlose-trained.net</span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./earlystop.pl</span> ioccc-winlose-trained.net ioccc_won_training/ ioccc_lost_training/ ioccc_won_test/ ioccc_lost_test/</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> rm -f ioccc-winlose-trained.net
./earlystop.pl ioccc-winlose-trained.net ioccc_won_training/ ioccc_lost_training/ ioccc_won_test/ ioccc_lost_test/</code></pre>
<p>where:</p>
<ul>
<li><p><code>ioccc_won_training/</code>
@@ -191,7 +191,7 @@ that did not win were flushed to <code>/dev/null</code>.</p>
<a href="dlowe-aux-data.tar.bz2">dlowe-aux-data.tar.bz2</a> tarball.</p>
<p>The <a href="dlowe.c">dlowe.c</a> was explicitly excluded from this trailing set, so this
test is interesting:</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">./dlowe</span> dlowe.c <span class="op">&lt;</span> dlowe-aux-data/ioccc-winlose-trained.net</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./dlowe dlowe.c &lt; dlowe-aux-data/ioccc-winlose-trained.net</code></pre>
<p>NOTE: this is done in <a href="try.sh">try.sh</a>.</p>
<p>The match of <a href="dlowe.c">dlowe.c</a> to the lose/win trailed network was:</p>
<pre><code> dlowe.c 0.125108</code></pre>
@@ -203,7 +203,7 @@ mean it will win or lose a future IOCCC. On the other hand … it just might!</p
<p>While we cannot supply you with the losing IOCCC source code, the author did supply a number
data sets on which to test:</p>
<p>We created the <a href="dlowe-aux-data/english-trained.net">english-trained.net</a> as follows:</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">./dlowe</span> <span class="at">-8000</span> dlowe-aux-data/english-1/ dlowe-aux-data/english-0/ <span class="op">&lt;</span> /dev/null <span class="op">&gt;</span> dlowe-aux-data/english-trained.net</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./dlowe -8000 dlowe-aux-data/english-1/ dlowe-aux-data/english-0/ &lt; /dev/null &gt; dlowe-aux-data/english-trained.net</code></pre>
<ul>
<li><p><a href="dlowe-aux-data/english-0/">dlowe-aux-data/english-0/</a>
Non-English (French) text</p></li>
@@ -211,7 +211,7 @@ Non-English (French) text</p></li>
English (non-French) text</p></li>
</ul>
<p>We created the <a href="dlowe-aux-data/png-trained.net">png-trained.net</a> as follows:</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./dlowe</span> <span class="at">-8000</span> png-1/ png-0/ <span class="op">&lt;</span> /dev/null <span class="op">&gt;</span> dlowe-aux-data/png-trained.net</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./dlowe -8000 png-1/ png-0/ &lt; /dev/null &gt; dlowe-aux-data/png-trained.net</code></pre>
<ul>
<li><p><a href="dlowe-aux-data/png-0/">dlowe-aux-data/png-0/</a>
Non-png (gif) images</p></li>
@@ -219,7 +219,7 @@ Non-png (gif) images</p></li>
png (non-gif) images</p></li>
</ul>
<p>We created the <a href="dlowe-aux-data/xor-trained.net">xor-trained.net</a> as follows:</p>
<div class="sourceCode" id="cb13"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./dlowe</span> <span class="at">-8000</span> dlowe-aux-data/xor-1/ dlowe-aux-data/xor-0/ <span class="op">&lt;</span> /dev/null <span class="op">&gt;</span> dlowe-aux-data/xor-trained.net</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./dlowe -8000 dlowe-aux-data/xor-1/ dlowe-aux-data/xor-0/ &lt; /dev/null &gt; dlowe-aux-data/xor-trained.net</code></pre>
<ul>
<li><p><a href="dlowe-aux-data/xor-0/">dlowe-aux-data/xor-0</a>
Data that XORs to 0</p></li>
@@ -242,7 +242,7 @@ which can be trained, using on-line
neuron.</p>
<p>The neurons’ activation function is the logistic function <code>1 / (1 + e ^ -x)</code>.</p>
<h3 id="classifying">Classifying</h3>
<div class="sourceCode" id="cb14"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./dlowe</span> file [file ...] <span class="op">&lt;</span> trained.net</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./dlowe file [file ...] &lt; trained.net</code></pre>
<p>To classify files, one specifies a trained network (on <code>stdin</code>) and one or more
files to classify. The program will output one line per successfully-classified
file to <code>stderr</code>, with the filename and the classification: a number between 0
@@ -251,7 +251,7 @@ and 1.</p>
trained, but it’s geared toward interpretation as a <em>probability</em> or a
<em>confidence</em>.</p>
<h3 id="training">Training</h3>
<div class="sourceCode" id="cb15"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./dlowe</span> <span class="at">-</span><span class="op">&lt;</span>n_iterations<span class="op">&gt;</span> corpus1/ <span class="pp">[</span><span class="ss">...</span><span class="pp">]</span> corpus0/ <span class="op">&lt;</span> start.net <span class="op">&gt;</span> end.net</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./dlowe -&lt;n_iterations&gt; corpus1/ [...] corpus0/ &lt; start.net &gt; end.net</code></pre>
<p><strong>NOTE</strong>: The directory args <strong>must end in a</strong> <code>/</code> for them to work.</p>
<p>To train a network, one specifies a starting network (on <code>stdin</code>), two or more
corpora (directories containing training data), and the number of training
+4 -4
View File
@@ -1,13 +1,13 @@
## To build:
```sh
```<!---sh-->
make
```
## To use:
```sh
```<!---sh-->
./eastman
```
@@ -19,7 +19,7 @@ NOTE: to restore your cursor in your shell, try `reset`.
Run the program. Quit it (ctrl-c/intr). Resize your terminal window. Run it
again. Try doing this a number of times with different sizes each time.
```sh
```<!---sh-->
./eastman
```
@@ -60,7 +60,7 @@ program is running, though. It only checks the size once, when it starts up.
To compile:
```sh
```<!---sh-->
cc -lm eastman.c
```
+4 -4
View File
@@ -141,14 +141,14 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./eastman</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./eastman</code></pre>
<p>NOTE: to restore your cursor in your shell, try <code>reset</code>.</p>
<h2 id="try">Try:</h2>
<p>Run the program. Quit it (ctrl-c/intr). Resize your terminal window. Run it
again. Try doing this a number of times with different sizes each time.</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./eastman</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./eastman</code></pre>
<p>NOTE: to restore your cursor in your shell, try <code>reset</code>.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This round program will generate a classic spherical result!</p>
@@ -173,7 +173,7 @@ is also just part of the texture, not an actual raytraced shadow.</p>
so try enlarging the window to get higher resolution. Don’t resize while the
program is running, though. It only checks the size once, when it starts up.</p>
<p>To compile:</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">cc</span> <span class="at">-lm</span> eastman.c</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> cc -lm eastman.c</code></pre>
<h3 id="portability">Portability</h3>
<p>It should be completely portable. I’ve tested with gcc on Mac OS X 10.7 (Lion)
and Fedora 10. I would expect it to work in any Unix-like environment.</p>
+10 -10
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make
```
@@ -18,14 +18,14 @@ For more detailed information see [2011 fredriksson bugs](../../bugs.html#2011_f
## To use:
```sh
```<!---sh-->
./fredriksson [-icvtnk#] regexp < file
```
## Try:
```sh
```<!---sh-->
./try.sh
```
@@ -55,7 +55,7 @@ Implements a variant of `grep`.
To search regexp from file, do:
```sh
```<!---sh-->
./fredriksson [-icvtnk#] regexp < file
```
@@ -123,13 +123,13 @@ expressions by putting `]` as the first character, and putting `-` last.
Just say
```sh
```<!---sh-->
./fredriksson -k3 cat < file
```
* Like with `cat`, you can append line numbers too:
```sh
```<!---sh-->
./fredriksson -nk3 cat < file
```
@@ -173,7 +173,7 @@ Just say
* Depending on the file, it might require a lot of stack space. If the
program segfaults (because of this), say
```sh
```<!---sh-->
ulimit -s unlimited
```
@@ -207,7 +207,7 @@ Just say
extracts and builds that, and then calls it. More precisely, the command
to build is
```sh
```<!---sh-->
gcc -O3 ag.c -o ag
```
@@ -260,14 +260,14 @@ Just say
* No numerical values, other than in the initialized char array, try
```sh
```<!---sh-->
./fredriksson -ck0 [0-9] < fredriksson.c
```
This should print 1, as there is a number `3` in the char array (only).
You can also try
```sh
```<!---sh-->
./fredriksson -ck0 [0-9] < ag.c
```
+10 -10
View File
@@ -141,15 +141,15 @@ Location: <a href="../../location.html#FI">FI</a> - <em>Republic of Finland </em
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2011_fredriksson">2011 fredriksson 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">./fredriksson</span> <span class="pp">[-</span><span class="ss">icvtnk#</span><span class="pp">]</span> regexp <span class="op">&lt;</span> file</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./fredriksson [-icvtnk#] regexp &lt; file</code></pre>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<p>NOTE: you need to be allowed to change your stack size or else the last command
in the script would likely cause the program to dump core, which is why the
script checks the exit code of <code>ulimit</code> first.</p>
@@ -165,7 +165,7 @@ program and calls it. As an exercise, try writing the compressor.</p>
<p>Implements a variant of <code>grep</code>.</p>
<h3 id="usage">Usage</h3>
<p>To search regexp from file, do:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./fredriksson</span> <span class="pp">[-</span><span class="ss">icvtnk#</span><span class="pp">]</span> regexp <span class="op">&lt;</span> file</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./fredriksson [-icvtnk#] regexp &lt; file</code></pre>
<p>Pipes might not work, see the section Limitations.
The options <code>-i</code>, <code>-c</code>, <code>-v</code> and <code>-n</code> are the classic ones:</p>
<ul>
@@ -220,11 +220,11 @@ expressions by putting <code>]</code> as the first character, and putting <code>
<li>You can use this in place of <a href="https://en.wikipedia.org/wiki/Cat_(Unix)">cat</a>.
Just say</li>
</ul>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./fredriksson</span> <span class="at">-k3</span> cat <span class="op">&lt;</span> file</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./fredriksson -k3 cat &lt; file</code></pre>
<ul>
<li>Like with <code>cat</code>, you can append line numbers too:</li>
</ul>
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./fredriksson</span> <span class="at">-nk3</span> cat <span class="op">&lt;</span> file</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./fredriksson -nk3 cat &lt; file</code></pre>
<h3 id="other-features">Other features</h3>
<ul>
<li><p>It is assumed that the user knows how to feed correct input to the
@@ -256,7 +256,7 @@ you can easily use <code>long long</code> instead,</p></li>
<li><p>Depending on the file, it might require a lot of stack space. If the
program segfaults (because of this), say</p></li>
</ul>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a> <span class="bu">ulimit</span> <span class="at">-s</span> unlimited</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ulimit -s unlimited</code></pre>
<p>cross your fingers, hope it is enough, and try again.</p>
<ul>
<li><p>Assumes C99 standard, because of the one very long line. Most C compilers
@@ -284,7 +284,7 @@ as well as its name and commands to build and run it, all
extracts and builds that, and then calls it. More precisely, the command
to build is</li>
</ul>
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">gcc</span> <span class="at">-O3</span> ag.c <span class="at">-o</span> ag</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> gcc -O3 ag.c -o ag</code></pre>
<p>To change that you need to edit the char array <code>p[]</code> and (possibly) two
specially encoded constants, <code>-~('('*'(')</code> and <code>'C'*' '-'-'</code>.
The extracted source (<code>ag.c</code>) is obfuscated as well.</p>
@@ -333,10 +333,10 @@ Two’s complement representation of integers is also abused. E.g. instead
of writing <code>x++</code> or <code>x-1</code>, it is much better to write <code>x=-~x</code> and <code>~-x</code>.</p></li>
<li><p>No numerical values, other than in the initialized char array, try</p></li>
</ul>
<div class="sourceCode" id="cb10"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./fredriksson</span> <span class="at">-ck0</span> <span class="pp">[</span><span class="ss">0</span><span class="pp">-</span><span class="ss">9</span><span class="pp">]</span> <span class="op">&lt;</span> fredriksson.c</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./fredriksson -ck0 [0-9] &lt; fredriksson.c</code></pre>
<p>This should print 1, as there is a number <code>3</code> in the char array (only).
You can also 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">./fredriksson</span> <span class="at">-ck0</span> <span class="pp">[</span><span class="ss">0</span><span class="pp">-</span><span class="ss">9</span><span class="pp">]</span> <span class="op">&lt;</span> ag.c</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./fredriksson -ck0 [0-9] &lt; ag.c</code></pre>
<p>after running <code>fredriksson</code> at least once (since this generates that
<code>ag.c</code> file), and this should print 0.</p>
<ul>
+5 -5
View File
@@ -1,20 +1,20 @@
## To build:
```sh
```<!---sh-->
make
```
## To use:
```sh
```<!---sh-->
echo "some text" | ./goren
```
## Try:
```sh
```<!---sh-->
./try.sh
```
@@ -27,13 +27,13 @@ In the words of [René François Ghislain Magritte Magritte](http://en.wikipedia
One may ask the surrealist question:
```sh
```<!---sh-->
echo 'If | is just a representation of a pipe, then how can data stuff it?' | ./goren
```
However if one takes a firm stand and declares:
```sh
```<!---sh-->
echo '| is just a representation of a pipe because I say so! So stuff it!' | ./goren
```
+5 -5
View File
@@ -141,11 +141,11 @@ Location: <a href="../../location.html#IL">IL</a> - <em>State of Israel</em> (<e
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> <span class="st">&quot;some text&quot;</span> <span class="kw">|</span> <span class="ex">./goren</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> echo &quot;some text&quot; | ./goren</code></pre>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>In the words of <a href="http://en.wikipedia.org/wiki/Rene_Magritte">René François Ghislain Magritte Magritte</a>:</p>
<figure>
@@ -153,9 +153,9 @@ Location: <a href="../../location.html#IL">IL</a> - <em>State of Israel</em> (<e
<figcaption aria-hidden="true">This is not a pipe</figcaption>
</figure>
<p>One may ask the surrealist question:</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">&#39;If | is just a representation of a pipe, then how can data stuff it?&#39;</span> <span class="kw">|</span> <span class="ex">./goren</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> echo &#39;If | is just a representation of a pipe, then how can data stuff it?&#39; | ./goren</code></pre>
<p>However if one takes a firm stand and declares:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="bu">echo</span> <span class="st">&#39;| is just a representation of a pipe because I say so! So stuff it!&#39;</span> <span class="kw">|</span> <span class="ex">./goren</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> echo &#39;| is just a representation of a pipe because I say so! So stuff it!&#39; | ./goren</code></pre>
<p>something happens! Why?</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This program was written in homage to <a href="http://en.wikipedia.org/wiki/Rene_Magritte">Rene
+7 -7
View File
@@ -1,27 +1,27 @@
## To build:
```sh
```<!---sh-->
make
```
## To use:
```sh
```<!---sh-->
./hamaji < a_nonogram_file
```
## Try:
```sh
```<!---sh-->
./try.sh
```
If you have perl installed you should be able to reproduce
[dragon.nono](dragon.nono) like:
```sh
```<!---sh-->
perl c2nono.pl hamaji.c | ./hamaji
```
@@ -181,7 +181,7 @@ with the well obfuscated code.
This program uses two C99 features. One line comments and `long long`.
GCC's `-ansi -pedantic` check should pass:
```sh
```<!---sh-->
cc -ansi -pedantic -std=c99 hamaji.c
```
@@ -196,7 +196,7 @@ memory layout, undefined evaluation order (e.g., `a[i++]=i`), etc.
This program won't work if the size of `long long` literal is less than 8.
By grepping the source code of gcc
```sh
```<!---sh-->
grep LONG_LONG_TYPE_SIZE gcc/config/*/*
```
@@ -224,7 +224,7 @@ was randomly generated. The [codegolf.nono](codegolf.nono) and
You can reproduce [dragon.nono](dragon.nono) from [hamaji.c](hamaji.c) using
[c2nono.pl](c2nono.pl):
```sh
```<!---sh-->
perl c2nono.pl hamaji.c | ./hamaji
```
+7 -7
View File
@@ -144,14 +144,14 @@ Location: <a href="../../location.html#JP">JP</a> - <em>Japan</em></li>
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./hamaji</span> <span class="op">&lt;</span> a_nonogram_file</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./hamaji &lt; a_nonogram_file</code></pre>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<p>If you have perl installed you should be able to reproduce
<a href="dragon.nono">dragon.nono</a> 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="fu">perl</span> c2nono.pl hamaji.c <span class="kw">|</span> <span class="ex">./hamaji</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> perl c2nono.pl hamaji.c | ./hamaji</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This program solves <a href="http://en.wikipedia.org/wiki/Nonogram">Nonograms</a> which is
also known as “Paint by Numbers”.</p>
@@ -260,7 +260,7 @@ with the well obfuscated code.</p>
<h3 id="portability">Portability</h3>
<p>This program uses two C99 features. One line comments and <code>long long</code>.
GCC’s <code>-ansi -pedantic</code> check should pass:</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">cc</span> <span class="at">-ansi</span> <span class="at">-pedantic</span> <span class="at">-std</span><span class="op">=</span>c99 hamaji.c</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> cc -ansi -pedantic -std=c99 hamaji.c</code></pre>
<p>I checked my program with gcc-4.6.2 on linux, llvm-gcc-4.2 on Mac, and
clang-3.0 on Mac.</p>
<p>Note that the behavior of <code>scanf(3)</code> differs on linux and mac, but this
@@ -269,7 +269,7 @@ program supports both semantics.</p>
memory layout, undefined evaluation order (e.g., <code>a[i++]=i</code>), etc.
This program won’t work if the size of <code>long long</code> literal is less than 8.
By grepping the source code of gcc</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">grep</span> LONG_LONG_TYPE_SIZE gcc/config/<span class="pp">*</span>/<span class="pp">*</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> grep LONG_LONG_TYPE_SIZE gcc/config/*/*</code></pre>
<p>I found long long may be 32bit integers only on AVR.</p>
<h3 id="a-few-more-things">A few more things</h3>
<p>This code is considered as a <a href="http://en.wikipedia.org/wiki/Japanese_New_Year#Postcards">new year’s postcard in
@@ -287,7 +287,7 @@ was randomly generated. The <a href="codegolf.nono">codegolf.nono</a> and
<a href="https://web.archive.org/web/20130218055139/http://codegolf.com/paint-by-numbers" class="uri">https://web.archive.org/web/20130218055139/http://codegolf.com/paint-by-numbers</a>.</p>
<p>You can reproduce <a href="dragon.nono">dragon.nono</a> from <a href="hamaji.c">hamaji.c</a> using
<a href="c2nono.pl">c2nono.pl</a>:</p>
<div class="sourceCode" id="cb13"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">perl</span> c2nono.pl hamaji.c <span class="kw">|</span> <span class="ex">./hamaji</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> perl c2nono.pl hamaji.c | ./hamaji</code></pre>
<!--
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
+5 -5
View File
@@ -1,20 +1,20 @@
## To build:
```sh
```<!---sh-->
make
```
## To use:
```sh
```<!---sh-->
./hou 'expression'
```
## Try:
```sh
```<!---sh-->
./try.sh
```
@@ -32,7 +32,7 @@ source code. What does it mean?
The calculator obeys the precedence rules and allows parenthesis.
```sh
```<!---sh-->
./hou '1+2*3'
./hou '(1+2)*3'
```
@@ -41,7 +41,7 @@ What exactly does the text formatting do?
What does this evaluate to in C?
```c
```<!---c-->
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+
```
+6 -6
View File
@@ -141,11 +141,11 @@ Location: <a href="../../location.html#CN">CN</a> - <em>People’s Republic of C
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./hou</span> <span class="st">&#39;expression&#39;</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./hou &#39;expression&#39;</code></pre>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<p>As the script asks you, what does the last one mean? Can you get it to report a
different value? Hint: it’s in this file, kind of.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
@@ -154,11 +154,11 @@ warnings under the most strict pedantic mode of gcc and clang.</p>
<p>The first example, along with the correct result appears in the
source code. What does it mean?</p>
<p>The calculator obeys the precedence rules and allows parenthesis.</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">./hou</span> <span class="st">&#39;1+2*3&#39;</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./hou</span> <span class="st">&#39;(1+2)*3&#39;</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./hou &#39;1+2*3&#39;
./hou &#39;(1+2)*3&#39;</code></pre>
<p>What exactly does the text formatting do?</p>
<p>What does this evaluate to in C?</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="op">+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+</code></pre>
<h3 id="self-documenting-source">Self documenting source</h3>
<p>Comments would almost be redundant. :-}</p>
<h3 id="the-ascii-art-is-valid-c-code">The ASCII art is valid C code</h3>
+3 -3
View File
@@ -1,20 +1,20 @@
## To build:
```sh
```<!---sh-->
make
```
## To use:
```sh
```<!---sh-->
./konno lower_case_word
```
## Try:
```sh
```<!---sh-->
./try.sh
```
+3 -3
View File
@@ -141,11 +141,11 @@ Location: <a href="../../location.html#JP">JP</a> - <em>Japan</em></li>
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./konno</span> lower_case_word</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./konno lower_case_word</code></pre>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This tiny program outputs what looks like a tiny keyboard.
OK, so the letters are missing. But that is no problem because
+3 -3
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make
```
@@ -18,14 +18,14 @@ For more detailed information see [2011 richards bugs](../../bugs.html#2011_rich
## To use:
```sh
```<!---sh-->
echo expression | ./richards
```
## Try:
```sh
```<!---sh-->
./try.sh
```
+3 -3
View File
@@ -141,15 +141,15 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code> STATUS: doesn&#39;t work with some platforms - please help us fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2011_richards">2011 richards 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> expression <span class="kw">|</span> <span class="ex">./richards</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> echo expression | ./richards</code></pre>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Oh no, yet another
<a href="https://en.wikipedia.org/wiki/Dc_(computer_program)">dc</a>-style calculator? (see
+4 -4
View File
@@ -2,7 +2,7 @@
If you have X11 installed:
```sh
```<!---sh-->
make
```
@@ -13,7 +13,7 @@ Windows](toledo.alt2.c). See [Alternate code](#alternate-code) below.
## To use:
```sh
```<!---sh-->
./toledo
```
@@ -49,7 +49,7 @@ but you can change them about however you like, even with other keys. For
instance to swap `LEFT` and `RIGHT`:
```sh
```<!---sh-->
make clobber LEFT=XK_Right:XK_d RIGHT=XK_Left:XK_a alt
```
@@ -75,7 +75,7 @@ the source early on, right before the code gets hard to follow, or using the
Like Oscar's previous winning X11 program for the 19th IOCCC, if
you remove both the X11 include files and replace them with
```c
```<!---c-->
#include "layer.c"
```
+4 -4
View File
@@ -142,12 +142,12 @@ Location: <a href="../../location.html#MX">MX</a> - <em>United Mexican States</e
<h2 id="to-build">To build:</h2>
<p>If you have X11 installed:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<p>There are two alternate versions, <a href="toledo.alt.c">one that lets you reconfigure the
controls and size</a> and <a href="toledo.alt2.c">another that should work for
Windows</a>. 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">./toledo</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./toledo</code></pre>
<h2 id="alternate-code">Alternate code:</h2>
<p>The first alt version, <a href="toledo.alt.c">toledo.alt.c</a>, allows you to reconfigure
the controls and the dimensions more easily.</p>
@@ -168,7 +168,7 @@ have the right names you can define the macros <code>FIRE</code>, <code>FORWARD<
HEIGHT= 288</code></pre>
<p>but you can change them about however you like, even with other keys. For
instance to swap <code>LEFT</code> and <code>RIGHT</code>:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> clobber LEFT=XK_Right:XK_d RIGHT=XK_Left:XK_a alt</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make clobber LEFT=XK_Right:XK_d RIGHT=XK_Left:XK_a alt</code></pre>
<p>but you can specify something completely else and you can pick and choose which
controls you wish to redefine. You might also wish to change the dimensions of
the game, <code>WIDTH</code> and <code>HEIGHT</code> which have an arbitrarily selected lower limit as
@@ -184,7 +184,7 @@ the source early on, right before the code gets hard to follow, or using the
<a href="#alternate-code">alternate version</a>.</p>
<p>Like Oscar’s previous winning X11 program for the 19th IOCCC, if
you remove both the X11 include files and replace them with</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a> <span class="pp">#include </span><span class="im">&quot;layer.c&quot;</span></span></code></pre></div>
<pre class="&lt;!---c--&gt;"><code> #include &quot;layer.c&quot;</code></pre>
<p>you ought to be able to compile and run this program on Windows.
NOTE: this is what <a href="toledo.alt2.c">toledo.alt2.c</a> is for.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
+11 -11
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make
```
@@ -21,20 +21,20 @@ For more detailed information see [2011 vik bugs](../../bugs.html#2011_vik).
## To use:
```sh
```<!---sh-->
./vik file.mod > audio_file.raw
```
If you have `mplayer(1)`:
```sh
```<!---sh-->
./vik file.mod | mplayer -demuxer rawaudio -
```
Alternatively, you can convert the file to a WAV:
```sh
```<!---sh-->
./vik file.mod > file.raw; ./raw2wav file.raw > file.wav
```
@@ -43,7 +43,7 @@ and then play `file.wav` with a program that can play WAV files.
## Try:
```sh
```<!---sh-->
./try.sh
```
@@ -66,7 +66,7 @@ This version is based on the author's remarks and it should work for Windows.
Assuming that `make` is similar enough try:
```sh
```<!---sh-->
make alt
```
@@ -87,7 +87,7 @@ initialization for?
Does it take your system a long time to compile? You may want to do:
```sh
```<!---sh-->
cc -S vik.c
```
@@ -153,7 +153,7 @@ Bertilsson, also known as Deelite:
Compiling for Unix systems (including cygwin) is straight forward:
```sh
```<!---sh-->
gcc -o vik vik.c
```
@@ -162,13 +162,13 @@ Compiling for Unix systems (including cygwin) is straight forward:
#### Convert MOD file to raw 44.1kHz stereo audio file
```sh
```<!---sh-->
./vik mad_world.mod > audio_file.raw
```
#### Listen to the MOD file (streaming to mplayer)
```sh
```<!---sh-->
./vik randowan.mod | mplayer -demuxer rawaudio -
```
@@ -210,7 +210,7 @@ Microsoft compilers adds a carriage return to newlines, and to compile
the program with this platform, the following line can be added after
the main declaration in order for the program to run correctly:
```c
```<!---c-->
_setmode(_fileno(stdout), 0x8000);
```
+11 -11
View File
@@ -141,7 +141,7 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<p>There is an alternate version that should work for Windows. See <a href="#alternate-code">alternate
code</a> below.</p>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
@@ -149,14 +149,14 @@ code</a> below.</p>
<pre><code> STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#2011_vik">2011 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="ex">./vik</span> file.mod <span class="op">&gt;</span> audio_file.raw</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./vik file.mod &gt; audio_file.raw</code></pre>
<p>If you have <code>mplayer(1)</code>:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./vik</span> file.mod <span class="kw">|</span> <span class="ex">mplayer</span> <span class="at">-demuxer</span> rawaudio <span class="at">-</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./vik file.mod | mplayer -demuxer rawaudio -</code></pre>
<p>Alternatively, you can convert the file to a WAV:</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">./vik</span> file.mod <span class="op">&gt;</span> file.raw<span class="kw">;</span> <span class="ex">./raw2wav</span> file.raw <span class="op">&gt;</span> file.wav</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./vik file.mod &gt; file.raw; ./raw2wav file.raw &gt; file.wav</code></pre>
<p>and then play <code>file.wav</code> with a program that can play WAV files.</p>
<h2 id="try">Try:</h2>
<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.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<p>The script checks that you have <code>mplayer(1)</code> installed and if it is it will pipe
<code>vik</code> to <code>mplayer</code>. In this case it will also use <code>raw2wav</code> to convert the file
to a WAV file. If <code>mplayer(1)</code> cannot be found it will just use <code>raw2wav</code>. This
@@ -168,7 +168,7 @@ Archive</a>.</p>
<p>This version is based on the author’s remarks and it should work for Windows.</p>
<h3 id="alternate-build">Alternate build:</h3>
<p>Assuming that <code>make</code> is similar enough 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> alt</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make alt</code></pre>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>vik.alt</code> as you would <code>vik</code> above.</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
@@ -178,7 +178,7 @@ in a most pleasing manner if you don’t like tremolo or vibrato.</p>
initialized 32MB array. Can you tell what that partial
initialization for?</p>
<p>Does it take your system a long time to compile? You may want to do:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">cc</span> <span class="at">-S</span> vik.c</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> cc -S vik.c</code></pre>
<p>and examine the resulting assembly file <code>vik.s</code>. On some platforms
the assembly file is about 128MB in size!</p>
<p>NOTE: The <a href="randowan.mod">randowan.mod</a> and <a href="mad_world.mod">mad_world.mod</a> files were
@@ -225,12 +225,12 @@ Bertilsson, also known as Deelite:</p>
</ol>
<h3 id="build">Build</h3>
<p>Compiling for Unix systems (including cygwin) is straight forward:</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">gcc</span> <span class="at">-o</span> vik vik.c</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> gcc -o vik vik.c</code></pre>
<h3 id="usage">Usage</h3>
<h4 id="convert-mod-file-to-raw-44.1khz-stereo-audio-file">Convert MOD file to raw 44.1kHz stereo audio file</h4>
<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">./vik</span> mad_world.mod <span class="op">&gt;</span> audio_file.raw</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./vik mad_world.mod &gt; audio_file.raw</code></pre>
<h4 id="listen-to-the-mod-file-streaming-to-mplayer">Listen to the MOD file (streaming to mplayer)</h4>
<div class="sourceCode" id="cb11"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./vik</span> randowan.mod <span class="kw">|</span> <span class="ex">mplayer</span> <span class="at">-demuxer</span> rawaudio <span class="at">-</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./vik randowan.mod | mplayer -demuxer rawaudio -</code></pre>
<p>(Don’t forget the last <code>-</code> as it makes mplayer read from <code>stdin</code>.)</p>
<h3 id="obfuscation">Obfuscation</h3>
<p>The IOCCC rules did not put a limit on the entropy of the source code,
@@ -256,7 +256,7 @@ that the program relies on writing binary data to <code>stdout</code>.</p>
<p>Microsoft compilers adds a carriage return to newlines, and to compile
the program with this platform, the following line can be added after
the main declaration in order for the program to run correctly:</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> _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>
<pre class="&lt;!---c--&gt;"><code> _setmode(_fileno(stdout), 0x8000);</code></pre>
<p>NOTE: this is what the <a href="#alternate-code">alternate version</a> is for.</p>
<h3 id="limitations">Limitations</h3>
<p>The program only runs when a valid MOD file is passed as argument. If
+10 -10
View File
@@ -1,6 +1,6 @@
## To build:
```sh
```<!---sh-->
make
```
@@ -10,7 +10,7 @@ binary mode from text mode. See [alternate code](#alternate-code) below.
## To use:
```sh
```<!---sh-->
./zucker > image.ppm
```
@@ -19,7 +19,7 @@ Now open `image.ppm` with your image viewer of choice.
## Try:
```sh
```<!---sh-->
./try.sh
```
@@ -36,7 +36,7 @@ that distinguish binary and text.
### Alternate build:
```sh
```<!---sh-->
make alt
```
@@ -68,7 +68,7 @@ This entry uses no local variables. None! At! All!
This program makes pretty pictures. To see the default output, try
running
```sh
```<!---sh-->
./zucker > ioccc2011.ppm
```
@@ -82,7 +82,7 @@ Netpbm files, and are available on multiple platforms.
With macOS you can type at the command line:
```sh
```<!---sh-->
open ioccc2021.ppm
```
@@ -90,7 +90,7 @@ and it will open image in the default application Preview.app.
To use ImageMagick you might do something like:
```sh
```<!---sh-->
convert ioccc2011.ppm ioccc2011.png
```
@@ -98,7 +98,7 @@ and then open `ioccc2011.png` in your viewer of choice.
To use GraphicsMagick you might do something like:
```sh
```<!---sh-->
gm convert ioccc2011.ppm ioccc2011.png
```
@@ -107,14 +107,14 @@ and then open `ioccc2011.png` in your viewer of choice.
Aside from the default image, you may create your own by running the
program as follows:
```sh
```<!---sh-->
./zucker "your text" > image.ppm
```
To mitigate long runtime, the program can be invoked in a "preview"
mode by appending `-preview` to the command line arguments, like so:
```sh
```<!---sh-->
./zucker faster\! -preview > image.ppm
```
+10 -10
View File
@@ -141,14 +141,14 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<h2 id="to-build">To build:</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make</code></pre>
<p>There is an alternate version which should work for Windows which distinguishes
binary mode from text mode. 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">./zucker</span> <span class="op">&gt;</span> image.ppm</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./zucker &gt; image.ppm</code></pre>
<p>Now open <code>image.ppm</code> with your image viewer of choice.</p>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./try.sh</code></pre>
<p>After running <code>try.sh</code>, open the PPM images <code>ioccc.ppm</code>, <code>hello.ppm</code> and
<code>image2.ppm</code> with your image viewer of choice.</p>
<h2 id="alternate-code">Alternate code:</h2>
@@ -156,7 +156,7 @@ binary mode from text mode. See <a href="#alternate-code">alternate code</a> bel
binary mode on <code>stdout</code> which the author noted would be necessary for systems
that distinguish binary and text.</p>
<h3 id="alternate-build">Alternate build:</h3>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span> alt</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> make alt</code></pre>
<h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>zucker.alt</code> as you would <code>zucker</code> above.</p>
<h3 id="alternate-try">Alternate try:</h3>
@@ -170,7 +170,7 @@ The vector font is proportional.</p>
<h4 id="what-it-does">What it does:</h4>
<p>This program makes pretty pictures. To see the default output, try
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">./zucker</span> <span class="op">&gt;</span> ioccc2011.ppm</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./zucker &gt; ioccc2011.ppm</code></pre>
<p>On the author’s 2.5 GHz MacBook Pro, this command takes approximately 1 minute
and 18 seconds to run – your runtime may vary. You will need an image viewer
capable of displaying <a href="https://en.wikipedia.org/wiki/Netpbm">Netpbm images</a> in
@@ -179,20 +179,20 @@ well; otherwise <a href="http://www.imagemagick.org/">ImageMagick</a> and/or
<a href="http://www.graphicsmagick.org/">GraphicsMagick</a> are both capable of displaying
Netpbm files, and are available on multiple platforms.</p>
<p>With macOS you can type at the command line:</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">open</span> ioccc2021.ppm</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> open ioccc2021.ppm</code></pre>
<p>and it will open image in the default application Preview.app.</p>
<p>To use ImageMagick you might do something like:</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">convert</span> ioccc2011.ppm ioccc2011.png</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> convert ioccc2011.ppm ioccc2011.png</code></pre>
<p>and then open <code>ioccc2011.png</code> in your viewer of choice.</p>
<p>To use GraphicsMagick you might do something like:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">gm</span> convert ioccc2011.ppm ioccc2011.png</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> gm convert ioccc2011.ppm ioccc2011.png</code></pre>
<p>and then open <code>ioccc2011.png</code> in your viewer of choice.</p>
<p>Aside from the default image, you may create your own by running the
program as follows:</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">./zucker</span> <span class="st">&quot;your text&quot;</span> <span class="op">&gt;</span> image.ppm</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./zucker &quot;your text&quot; &gt; image.ppm</code></pre>
<p>To mitigate long runtime, the program can be invoked in a “preview”
mode by appending <code>-preview</code> to the command line arguments, like so:</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">./zucker</span> faster<span class="dt">\!</span> <span class="at">-preview</span> <span class="op">&gt;</span> image.ppm</span></code></pre></div>
<pre class="&lt;!---sh--&gt;"><code> ./zucker faster\! -preview &gt; image.ppm</code></pre>
<p>If your platform distinguishes between binary and text streams, you may need to
insert some code to reopen standard output in binary mode at the start of
<code>main()</code> (the provided <a href="#alternate-code">alternate version</a> will set binary mode