Merge pull request #2629 from xexyl/html04
This commit is contained in:
16 files changed
+203
-139
No files matched your search
@@ -5,7 +5,7 @@
|
|||||||
```
|
```
|
||||||
|
|
||||||
There is an alternate version that allows one to control the number of numbers
|
There is an alternate version that allows one to control the number of numbers
|
||||||
to print on a line. See [alternate code](#alternate-code) below.
|
to print on a line. See [Alternate code](#alternate-code) below.
|
||||||
|
|
||||||
|
|
||||||
### Bugs and (Mis)features:
|
### Bugs and (Mis)features:
|
||||||
@@ -208,7 +208,7 @@ tailor-made for this competition!
|
|||||||
|
|
||||||
Although there are no comments, the program still manages to
|
Although there are no comments, the program still manages to
|
||||||
be self-documenting in an obscure fashion (periodic table of
|
be self-documenting in an obscure fashion (periodic table of
|
||||||
the (non-primordial) elements, "OBFUSCATED C").
|
the (non-primordial) elements, "`OBFUSCATED C`").
|
||||||
|
|
||||||
|
|
||||||
### Obfuscation
|
### Obfuscation
|
||||||
@@ -221,8 +221,8 @@ The program is obfuscated:
|
|||||||
- By the use of global constants.
|
- By the use of global constants.
|
||||||
- By the use of global functions that replace the standard ones (I particularly
|
- By the use of global functions that replace the standard ones (I particularly
|
||||||
like substituting `At` ([Astatine](https://en.wikipedia.org/wiki/Astatine),
|
like substituting `At` ([Astatine](https://en.wikipedia.org/wiki/Astatine),
|
||||||
highly unstable) for `abort()`.) By overloading symbols (For example, `B` is a
|
highly unstable) for `abort()`). By overloading symbols (for example, `B` is a
|
||||||
type, a structure, a structure member, a macro parameter, and a variable.).
|
type, a structure, a structure member, a macro parameter, and a variable).
|
||||||
- By standard tricks like writing `'\0'` as `1["3"]` or `2["22"]`.
|
- By standard tricks like writing `'\0'` as `1["3"]` or `2["22"]`.
|
||||||
- By using ternary operators to avoid `else`.
|
- By using ternary operators to avoid `else`.
|
||||||
- By using the `Sb()` function to create sub-buffers from either end.
|
- By using the `Sb()` function to create sub-buffers from either end.
|
||||||
|
|||||||
@@ -410,7 +410,7 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
|
|||||||
<h2 id="to-build">To build:</h2>
|
<h2 id="to-build">To build:</h2>
|
||||||
<pre><code> make</code></pre>
|
<pre><code> make</code></pre>
|
||||||
<p>There is an alternate version that allows one to control the number of numbers
|
<p>There is an alternate version that allows one to control the number of numbers
|
||||||
to print on a line. See <a href="#alternate-code">alternate code</a> below.</p>
|
to print on a line. See <a href="#alternate-code">Alternate code</a> below.</p>
|
||||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||||
<p>The current status of this entry is:</p>
|
<p>The current status of this entry is:</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
@@ -547,7 +547,7 @@ previous paragraph applies here also.</p>
|
|||||||
tailor-made for this competition!</p>
|
tailor-made for this competition!</p>
|
||||||
<p>Although there are no comments, the program still manages to
|
<p>Although there are no comments, the program still manages to
|
||||||
be self-documenting in an obscure fashion (periodic table of
|
be self-documenting in an obscure fashion (periodic table of
|
||||||
the (non-primordial) elements, “OBFUSCATED C”).</p>
|
the (non-primordial) elements, “<code>OBFUSCATED C</code>”).</p>
|
||||||
<h3 id="obfuscation">Obfuscation</h3>
|
<h3 id="obfuscation">Obfuscation</h3>
|
||||||
<p>The program is obfuscated:</p>
|
<p>The program is obfuscated:</p>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -557,8 +557,8 @@ the (non-primordial) elements, “OBFUSCATED C”).</p>
|
|||||||
<li>By the use of global constants.</li>
|
<li>By the use of global constants.</li>
|
||||||
<li>By the use of global functions that replace the standard ones (I particularly
|
<li>By the use of global functions that replace the standard ones (I particularly
|
||||||
like substituting <code>At</code> (<a href="https://en.wikipedia.org/wiki/Astatine">Astatine</a>,
|
like substituting <code>At</code> (<a href="https://en.wikipedia.org/wiki/Astatine">Astatine</a>,
|
||||||
highly unstable) for <code>abort()</code>.) By overloading symbols (For example, <code>B</code> is a
|
highly unstable) for <code>abort()</code>). By overloading symbols (for example, <code>B</code> is a
|
||||||
type, a structure, a structure member, a macro parameter, and a variable.).</li>
|
type, a structure, a structure member, a macro parameter, and a variable).</li>
|
||||||
<li>By standard tricks like writing <code>'\0'</code> as <code>1["3"]</code> or <code>2["22"]</code>.</li>
|
<li>By standard tricks like writing <code>'\0'</code> as <code>1["3"]</code> or <code>2["22"]</code>.</li>
|
||||||
<li>By using ternary operators to avoid <code>else</code>.</li>
|
<li>By using ternary operators to avoid <code>else</code>.</li>
|
||||||
<li>By using the <code>Sb()</code> function to create sub-buffers from either end.</li>
|
<li>By using the <code>Sb()</code> function to create sub-buffers from either end.</li>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
make
|
make
|
||||||
```
|
```
|
||||||
|
|
||||||
NOTE: We FORCE the use of -O0 even if someone overrides it because this entry
|
**NOTE**: We **FORCE** the use of `-O0` even if someone overrides it because this entry
|
||||||
will not work with it enabled.
|
will not work with it enabled.
|
||||||
|
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ we have seen in years!
|
|||||||
Compile and run without arguments. As input, give it an ASCII graphics
|
Compile and run without arguments. As input, give it an ASCII graphics
|
||||||
figure 8, 9, 10, or 11 made of pound signs and spaces, of any size,
|
figure 8, 9, 10, or 11 made of pound signs and spaces, of any size,
|
||||||
shape, or orientation (that's right, an upside down 9 is still 9 :-) ).
|
shape, or orientation (that's right, an upside down 9 is still 9 :-) ).
|
||||||
There is one restriction: the only line not containing "#" characters
|
There is one restriction: the only line not containing `#` characters
|
||||||
must be the last.
|
must be the last.
|
||||||
|
|
||||||
The program will print what it thinks you've entered. If you enter
|
The program will print what it thinks you've entered. If you enter
|
||||||
@@ -67,7 +67,7 @@ a pattern when it does not resemble 8, 9, 10 or 11?
|
|||||||
|
|
||||||
Here is a related puzzle: how to continue the sequence:
|
Here is a related puzzle: how to continue the sequence:
|
||||||
|
|
||||||
1, 0, 0, 0, 0, 0, 1, 0, 2, 1, ...
|
> `1, 0, 0, 0, 0, 0, 1, 0, 2, 1, ...`
|
||||||
|
|
||||||
With certain arguments, you can alter the exit value / output. Can you figure
|
With certain arguments, you can alter the exit value / output. Can you figure
|
||||||
out how and why?
|
out how and why?
|
||||||
@@ -85,7 +85,7 @@ This program returns the number as its exit status. (In most shells,
|
|||||||
you can see the exit status of the last command with `echo $?` (or
|
you can see the exit status of the last command with `echo $?` (or
|
||||||
just `$?`).)
|
just `$?`).)
|
||||||
|
|
||||||
**NOTE: The judges altered the primary version to output a number.**
|
**NOTE**: The judges altered the primary version to output a number.
|
||||||
|
|
||||||
On the input, give numbers formed as a sequences of empty spaces and `#`
|
On the input, give numbers formed as a sequences of empty spaces and `#`
|
||||||
signs (you can also use dots instead of spaces), ending with an empty
|
signs (you can also use dots instead of spaces), ending with an empty
|
||||||
@@ -131,10 +131,10 @@ minus the number of "edges"
|
|||||||
|
|
||||||
```
|
```
|
||||||
## # #. .#
|
## # #. .#
|
||||||
# .# #. ('.' must be empty)
|
# .# #.
|
||||||
```
|
```
|
||||||
|
|
||||||
plus the number of "faces"
|
(`.` must be empty) plus the number of "faces"
|
||||||
|
|
||||||
```
|
```
|
||||||
##
|
##
|
||||||
@@ -163,7 +163,7 @@ a "magic trick".
|
|||||||
|
|
||||||
4. I make a 16-character array; when indexed by 4-bit value which
|
4. I make a 16-character array; when indexed by 4-bit value which
|
||||||
represents the 2x2 squares, it will return a number to add/subtract
|
represents the 2x2 squares, it will return a number to add/subtract
|
||||||
`{-1,0,+1}`
|
`{-1,0,+1}`.
|
||||||
|
|
||||||
5. We convert lines of input to bitmaps (`N-bit` integers). Additionally, it is
|
5. We convert lines of input to bitmaps (`N-bit` integers). Additionally, it is
|
||||||
heavily obfuscated by using negative numbers (two's complement). For example,
|
heavily obfuscated by using negative numbers (two's complement). For example,
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ Location: <a href="../../location.html#PL">PL</a> - <em>Republic of Poland</em>
|
|||||||
<!-- BEFORE: 1st line of markdown file: 2004/kopczynski/README.md -->
|
<!-- BEFORE: 1st line of markdown file: 2004/kopczynski/README.md -->
|
||||||
<h2 id="to-build">To build:</h2>
|
<h2 id="to-build">To build:</h2>
|
||||||
<pre><code> make</code></pre>
|
<pre><code> make</code></pre>
|
||||||
<p>NOTE: We FORCE the use of -O0 even if someone overrides it because this entry
|
<p><strong>NOTE</strong>: We <strong>FORCE</strong> the use of <code>-O0</code> even if someone overrides it because this entry
|
||||||
will not work with it enabled.</p>
|
will not work with it enabled.</p>
|
||||||
<h2 id="to-use">To use:</h2>
|
<h2 id="to-use">To use:</h2>
|
||||||
<pre><code> ./kopczynski < input_file</code></pre>
|
<pre><code> ./kopczynski < input_file</code></pre>
|
||||||
@@ -434,14 +434,16 @@ we have seen in years!</p>
|
|||||||
<p>Compile and run without arguments. As input, give it an ASCII graphics
|
<p>Compile and run without arguments. As input, give it an ASCII graphics
|
||||||
figure 8, 9, 10, or 11 made of pound signs and spaces, of any size,
|
figure 8, 9, 10, or 11 made of pound signs and spaces, of any size,
|
||||||
shape, or orientation (that’s right, an upside down 9 is still 9 :-) ).
|
shape, or orientation (that’s right, an upside down 9 is still 9 :-) ).
|
||||||
There is one restriction: the only line not containing “#” characters
|
There is one restriction: the only line not containing <code>#</code> characters
|
||||||
must be the last.</p>
|
must be the last.</p>
|
||||||
<p>The program will print what it thinks you’ve entered. If you enter
|
<p>The program will print what it thinks you’ve entered. If you enter
|
||||||
anything that does not resemble 8, 9, 10, or 11, the result is
|
anything that does not resemble 8, 9, 10, or 11, the result is
|
||||||
seemingly arbitrary. Actually it is not pseudo-random; can you find
|
seemingly arbitrary. Actually it is not pseudo-random; can you find
|
||||||
a pattern when it does not resemble 8, 9, 10 or 11?</p>
|
a pattern when it does not resemble 8, 9, 10 or 11?</p>
|
||||||
<p>Here is a related puzzle: how to continue the sequence:</p>
|
<p>Here is a related puzzle: how to continue the sequence:</p>
|
||||||
<p>1, 0, 0, 0, 0, 0, 1, 0, 2, 1, …</p>
|
<blockquote>
|
||||||
|
<p><code>1, 0, 0, 0, 0, 0, 1, 0, 2, 1, ...</code></p>
|
||||||
|
</blockquote>
|
||||||
<p>With certain arguments, you can alter the exit value / output. Can you figure
|
<p>With certain arguments, you can alter the exit value / output. Can you figure
|
||||||
out how and why?</p>
|
out how and why?</p>
|
||||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||||
@@ -453,7 +455,7 @@ digits should be separated, and numbers should be “complete”.)</p>
|
|||||||
<p>This program returns the number as its exit status. (In most shells,
|
<p>This program returns the number as its exit status. (In most shells,
|
||||||
you can see the exit status of the last command with <code>echo $?</code> (or
|
you can see the exit status of the last command with <code>echo $?</code> (or
|
||||||
just <code>$?</code>).)</p>
|
just <code>$?</code>).)</p>
|
||||||
<p><strong>NOTE: The judges altered the primary version to output a number.</strong></p>
|
<p><strong>NOTE</strong>: The judges altered the primary version to output a number.</p>
|
||||||
<p>On the input, give numbers formed as a sequences of empty spaces and <code>#</code>
|
<p>On the input, give numbers formed as a sequences of empty spaces and <code>#</code>
|
||||||
signs (you can also use dots instead of spaces), ending with an empty
|
signs (you can also use dots instead of spaces), ending with an empty
|
||||||
line. (No number has an empty line in it.) The program should return
|
line. (No number has an empty line in it.) The program should return
|
||||||
@@ -488,8 +490,8 @@ characteristics</a> is the number of “vertexes”</p></li>
|
|||||||
<pre><code> #</code></pre>
|
<pre><code> #</code></pre>
|
||||||
<p>minus the number of “edges”</p>
|
<p>minus the number of “edges”</p>
|
||||||
<pre><code> ## # #. .#
|
<pre><code> ## # #. .#
|
||||||
# .# #. ('.' must be empty)</code></pre>
|
# .# #.</code></pre>
|
||||||
<p>plus the number of “faces”</p>
|
<p>(<code>.</code> must be empty) plus the number of “faces”</p>
|
||||||
<pre><code> ##
|
<pre><code> ##
|
||||||
##</code></pre>
|
##</code></pre>
|
||||||
<ol start="3" type="1">
|
<ol start="3" type="1">
|
||||||
@@ -508,7 +510,7 @@ a “magic trick”.</p>
|
|||||||
<ol start="4" type="1">
|
<ol start="4" type="1">
|
||||||
<li><p>I make a 16-character array; when indexed by 4-bit value which
|
<li><p>I make a 16-character array; when indexed by 4-bit value which
|
||||||
represents the 2x2 squares, it will return a number to add/subtract
|
represents the 2x2 squares, it will return a number to add/subtract
|
||||||
<code>{-1,0,+1}</code></p></li>
|
<code>{-1,0,+1}</code>.</p></li>
|
||||||
<li><p>We convert lines of input to bitmaps (<code>N-bit</code> integers). Additionally, it is
|
<li><p>We convert lines of input to bitmaps (<code>N-bit</code> integers). Additionally, it is
|
||||||
heavily obfuscated by using negative numbers (two’s complement). For example,
|
heavily obfuscated by using negative numbers (two’s complement). For example,
|
||||||
it turns out that <code>6</code> in <code>z=6</code> is the only 1-digit number which works here (and
|
it turns out that <code>6</code> in <code>z=6</code> is the only 1-digit number which works here (and
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ is modified to have the desired checksum! This does, we suppose,
|
|||||||
solve the problem that inserting a checksum would change the file's
|
solve the problem that inserting a checksum would change the file's
|
||||||
checksum; if you have to change it, you might as well change it!
|
checksum; if you have to change it, you might as well change it!
|
||||||
|
|
||||||
This program was submitted under the name `Rinia`, so the Author's
|
This program was submitted under the name `Rinia`, so the [Author's
|
||||||
Comments refer to it as such.
|
remarks](#authors-remarks) refer to it as such.
|
||||||
|
|
||||||
|
|
||||||
## Author's remarks:
|
## Author's remarks:
|
||||||
|
|||||||
@@ -420,8 +420,8 @@ strictly speaking, isn’t being computed at all. Rather, the file
|
|||||||
is modified to have the desired checksum! This does, we suppose,
|
is modified to have the desired checksum! This does, we suppose,
|
||||||
solve the problem that inserting a checksum would change the file’s
|
solve the problem that inserting a checksum would change the file’s
|
||||||
checksum; if you have to change it, you might as well change it!</p>
|
checksum; if you have to change it, you might as well change it!</p>
|
||||||
<p>This program was submitted under the name <code>Rinia</code>, so the Author’s
|
<p>This program was submitted under the name <code>Rinia</code>, so the <a href="#authors-remarks">Author’s
|
||||||
Comments refer to it as such.</p>
|
remarks</a> refer to it as such.</p>
|
||||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||||
<h3 id="rinia-11404"><code>Rinia</code> (1/14/04)</h3>
|
<h3 id="rinia-11404"><code>Rinia</code> (1/14/04)</h3>
|
||||||
<p><code>Rinia</code> is a tool for embedding CRCs in text files. No need to assign
|
<p><code>Rinia</code> is a tool for embedding CRCs in text files. No need to assign
|
||||||
|
|||||||
@@ -11,6 +11,9 @@
|
|||||||
./schnitzi <foo | vi -n
|
./schnitzi <foo | vi -n
|
||||||
```
|
```
|
||||||
|
|
||||||
|
where `foo` is a valid input file (see the [author's input details](#the-input)
|
||||||
|
for more details).
|
||||||
|
|
||||||
|
|
||||||
## Try:
|
## Try:
|
||||||
|
|
||||||
@@ -19,8 +22,8 @@
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
NOTE: if you're one of those who don't know how to exit `vi` :-) don't worry as
|
**NOTE**: if you're one of those who don't know how to exit `vi` :-) don't worry
|
||||||
it will exit for you.
|
as it will exit for you.
|
||||||
|
|
||||||
|
|
||||||
## Judges' remarks:
|
## Judges' remarks:
|
||||||
|
|||||||
@@ -411,10 +411,12 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
|
|||||||
<pre><code> make</code></pre>
|
<pre><code> make</code></pre>
|
||||||
<h2 id="to-use">To use:</h2>
|
<h2 id="to-use">To use:</h2>
|
||||||
<pre><code> ./schnitzi <foo | vi -n</code></pre>
|
<pre><code> ./schnitzi <foo | vi -n</code></pre>
|
||||||
|
<p>where <code>foo</code> is a valid input file (see the <a href="#the-input">author’s input details</a>
|
||||||
|
for more details).</p>
|
||||||
<h2 id="try">Try:</h2>
|
<h2 id="try">Try:</h2>
|
||||||
<pre><code> ./try.sh</code></pre>
|
<pre><code> ./try.sh</code></pre>
|
||||||
<p>NOTE: if you’re one of those who don’t know how to exit <code>vi</code> :-) don’t worry as
|
<p><strong>NOTE</strong>: if you’re one of those who don’t know how to exit <code>vi</code> :-) don’t worry
|
||||||
it will exit for you.</p>
|
as it will exit for you.</p>
|
||||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||||
<p>This exemplifies the meaning of Visual Editor, but we don’t think
|
<p>This exemplifies the meaning of Visual Editor, but we don’t think
|
||||||
that any benchmarking sites are going to use this to tout the
|
that any benchmarking sites are going to use this to tout the
|
||||||
|
|||||||
+29
-17
@@ -4,7 +4,7 @@
|
|||||||
make
|
make
|
||||||
```
|
```
|
||||||
|
|
||||||
NOTE: this entry requires the `X11/Xlib.h` header file and the X11 library to
|
**NOTE**: this entry requires the `X11/Xlib.h` header file and the X11 library to
|
||||||
compile. For more information see the
|
compile. For more information see the
|
||||||
FAQ on "[X11](../../faq.html#X11)".
|
FAQ on "[X11](../../faq.html#X11)".
|
||||||
|
|
||||||
@@ -86,26 +86,38 @@ Compile the source code and link X libraries if necessary.
|
|||||||
The program takes three options which have to be typed in a specific
|
The program takes three options which have to be typed in a specific
|
||||||
order as described below.
|
order as described below.
|
||||||
|
|
||||||
|
#### Usage:
|
||||||
|
|
||||||
``` <!---sh-->
|
``` <!---sh-->
|
||||||
Usage: ./vik1 ['a']['d'][#]
|
./vik1 ['a']['d'][#]
|
||||||
|
|
||||||
a - Advanced racing in a winter landscape
|
|
||||||
d - Racing in at night in the dark
|
|
||||||
# - Race track selection 1-3 are valid numbers
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Here are a few examples:
|
- `a`
|
||||||
|
* Advanced racing in a winter landscape.
|
||||||
|
- `d`
|
||||||
|
* Racing in at night in the dark.
|
||||||
|
- `#`
|
||||||
|
* Race track selection 1-3 are valid numbers.
|
||||||
|
|
||||||
```
|
#### Examples:
|
||||||
Command line: Description:
|
|
||||||
|
|
||||||
./vik1 Run track 1 at daytime in the summer
|
- `./vik1`
|
||||||
./vik1 a Run track 1 at daytime in the winter
|
* Run track 1 at daytime in the summer.
|
||||||
./vik1 d Run track 1 at night in the summer
|
|
||||||
./vik1 3 Run track 3 at daytime in the summer
|
- `./vik1 a`
|
||||||
./vik1 d3 Run track 3 at night in the summer
|
* Run track 1 at daytime in the winter.
|
||||||
./vik1 ad2 Run track 2 at night in the winter
|
|
||||||
```
|
- `./vik1 d`
|
||||||
|
* Run track 1 at night in the summer.
|
||||||
|
|
||||||
|
- `./vik1 3`
|
||||||
|
* Run track 3 at daytime in the summer.
|
||||||
|
|
||||||
|
- `./vik1 d3`
|
||||||
|
* Run track 3 at night in the summer.
|
||||||
|
|
||||||
|
- `./vik1 ad2`
|
||||||
|
* Run track 2 at night in the winter.
|
||||||
|
|
||||||
Note that the order in which the argument characters are entered is
|
Note that the order in which the argument characters are entered is
|
||||||
important. It is for example not possible to type `./vik1 da`. (Well it is
|
important. It is for example not possible to type `./vik1 da`. (Well it is
|
||||||
@@ -142,7 +154,7 @@ makes the program more obscure.
|
|||||||
### Compiler warnings
|
### Compiler warnings
|
||||||
|
|
||||||
There are no compiler warnings when compiling with `-ansi` but there are
|
There are no compiler warnings when compiling with `-ansi` but there are
|
||||||
many warnings from lclint. Mainly because the program is very
|
many warnings from lclint, mainly because the program is very
|
||||||
optimized for code size.
|
optimized for code size.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+45
-16
@@ -409,7 +409,7 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
|
|||||||
<!-- BEFORE: 1st line of markdown file: 2004/vik1/README.md -->
|
<!-- BEFORE: 1st line of markdown file: 2004/vik1/README.md -->
|
||||||
<h2 id="to-build">To build:</h2>
|
<h2 id="to-build">To build:</h2>
|
||||||
<pre><code> make</code></pre>
|
<pre><code> make</code></pre>
|
||||||
<p>NOTE: this entry requires the <code>X11/Xlib.h</code> header file and the X11 library to
|
<p><strong>NOTE</strong>: this entry requires the <code>X11/Xlib.h</code> header file and the X11 library to
|
||||||
compile. For more information see the
|
compile. For more information see the
|
||||||
FAQ on “<a href="../../faq.html#X11">X11</a>”.</p>
|
FAQ on “<a href="../../faq.html#X11">X11</a>”.</p>
|
||||||
<h2 id="to-use">To use:</h2>
|
<h2 id="to-use">To use:</h2>
|
||||||
@@ -454,20 +454,49 @@ glance at the feature list he provided below. Amazing!</p>
|
|||||||
<p>Compile the source code and link X libraries if necessary.
|
<p>Compile the source code and link X libraries if necessary.
|
||||||
The program takes three options which have to be typed in a specific
|
The program takes three options which have to be typed in a specific
|
||||||
order as described below.</p>
|
order as described below.</p>
|
||||||
<pre><code> Usage: ./vik1 ['a']['d'][#]
|
<h4 id="usage">Usage:</h4>
|
||||||
|
<pre><code> ./vik1 ['a']['d'][#]</code></pre>
|
||||||
a - Advanced racing in a winter landscape
|
<ul>
|
||||||
d - Racing in at night in the dark
|
<li><code>a</code>
|
||||||
# - Race track selection 1-3 are valid numbers</code></pre>
|
<ul>
|
||||||
<p>Here are a few examples:</p>
|
<li>Advanced racing in a winter landscape.</li>
|
||||||
<pre><code> Command line: Description:
|
</ul></li>
|
||||||
|
<li><code>d</code>
|
||||||
./vik1 Run track 1 at daytime in the summer
|
<ul>
|
||||||
./vik1 a Run track 1 at daytime in the winter
|
<li>Racing in at night in the dark.</li>
|
||||||
./vik1 d Run track 1 at night in the summer
|
</ul></li>
|
||||||
./vik1 3 Run track 3 at daytime in the summer
|
<li><code>#</code>
|
||||||
./vik1 d3 Run track 3 at night in the summer
|
<ul>
|
||||||
./vik1 ad2 Run track 2 at night in the winter</code></pre>
|
<li>Race track selection 1-3 are valid numbers.</li>
|
||||||
|
</ul></li>
|
||||||
|
</ul>
|
||||||
|
<h4 id="examples">Examples:</h4>
|
||||||
|
<ul>
|
||||||
|
<li><code>./vik1</code>
|
||||||
|
<ul>
|
||||||
|
<li>Run track 1 at daytime in the summer.</li>
|
||||||
|
</ul></li>
|
||||||
|
<li><code>./vik1 a</code>
|
||||||
|
<ul>
|
||||||
|
<li>Run track 1 at daytime in the winter.</li>
|
||||||
|
</ul></li>
|
||||||
|
<li><code>./vik1 d</code>
|
||||||
|
<ul>
|
||||||
|
<li>Run track 1 at night in the summer.</li>
|
||||||
|
</ul></li>
|
||||||
|
<li><code>./vik1 3</code>
|
||||||
|
<ul>
|
||||||
|
<li>Run track 3 at daytime in the summer.</li>
|
||||||
|
</ul></li>
|
||||||
|
<li><code>./vik1 d3</code>
|
||||||
|
<ul>
|
||||||
|
<li>Run track 3 at night in the summer.</li>
|
||||||
|
</ul></li>
|
||||||
|
<li><code>./vik1 ad2</code>
|
||||||
|
<ul>
|
||||||
|
<li>Run track 2 at night in the winter.</li>
|
||||||
|
</ul></li>
|
||||||
|
</ul>
|
||||||
<p>Note that the order in which the argument characters are entered is
|
<p>Note that the order in which the argument characters are entered is
|
||||||
important. It is for example not possible to type <code>./vik1 da</code>. (Well it is
|
important. It is for example not possible to type <code>./vik1 da</code>. (Well it is
|
||||||
possible, but the result will not be as expected.)</p>
|
possible, but the result will not be as expected.)</p>
|
||||||
@@ -492,7 +521,7 @@ the entry point of the application.</p>
|
|||||||
makes the program more obscure.</p>
|
makes the program more obscure.</p>
|
||||||
<h3 id="compiler-warnings">Compiler warnings</h3>
|
<h3 id="compiler-warnings">Compiler warnings</h3>
|
||||||
<p>There are no compiler warnings when compiling with <code>-ansi</code> but there are
|
<p>There are no compiler warnings when compiling with <code>-ansi</code> but there are
|
||||||
many warnings from lclint. Mainly because the program is very
|
many warnings from lclint, mainly because the program is very
|
||||||
optimized for code size.</p>
|
optimized for code size.</p>
|
||||||
<h3 id="limitations">Limitations</h3>
|
<h3 id="limitations">Limitations</h3>
|
||||||
<p>The program only compiles and runs on X based systems.</p>
|
<p>The program only compiles and runs on X based systems.</p>
|
||||||
|
|||||||
+25
-19
@@ -57,26 +57,32 @@ represented by one symbol that are either defined or undefined.
|
|||||||
|
|
||||||
The ALU has six instructions:
|
The ALU has six instructions:
|
||||||
|
|
||||||
- `CLR_X` - Clear [register](https://en.wikipedia.org/wiki/Processor_register) `X`.
|
- `CLR_X`
|
||||||
|
* Clear [register](https://en.wikipedia.org/wiki/Processor_register) `X`.
|
||||||
|
|
||||||
- `CLR_Y` - Clear [register](https://en.wikipedia.org/wiki/Processor_register) `Y`.
|
- `CLR_Y`
|
||||||
|
* Clear [register](https://en.wikipedia.org/wiki/Processor_register) `Y`.
|
||||||
|
|
||||||
- `ADD` - Calculates `X` + `Y` and stores the result in `X`. If the result
|
- `ADD`
|
||||||
is larger than 11 bits, the [CARRY
|
* Calculates `X` + `Y` and stores the result in `X`. If the result
|
||||||
bit](https://en.wikipedia.org/wiki/Carry_flag) in `SR` is set otherwise
|
is larger than 11 bits, the [CARRY
|
||||||
the `CARRY` bit is cleared.
|
bit](https://en.wikipedia.org/wiki/Carry_flag) in `SR` is set otherwise
|
||||||
|
the `CARRY` bit is cleared.
|
||||||
|
|
||||||
- `SUB` - Calculates `X` - `Y` and stores the result in `X`. If `Y` was larger
|
- `SUB`
|
||||||
than `X`, the [CARRY bit](https://en.wikipedia.org/wiki/Carry_flag)
|
* Calculates `X` - `Y` and stores the result in `X`. If `Y` was larger than
|
||||||
in `SR` is set otherwise the `CARRY` bit is cleared.
|
`X`, the [CARRY bit](https://en.wikipedia.org/wiki/Carry_flag) in `SR` is
|
||||||
|
set otherwise the `CARRY` bit is cleared.
|
||||||
|
|
||||||
- `TST` - If `X` == `Y` the `EQ` bit in `SR` is set, otherwise the `EQ` bit is
|
- `TST`
|
||||||
cleared. If `X` < `Y` the `LT` bit in `SR` is set, otherwise the `LT`
|
* If `X` == `Y` the `EQ` bit in `SR` is set, otherwise the `EQ` bit is
|
||||||
bit is cleared.
|
cleared. If `X` < `Y` the `LT` bit in `SR` is set, otherwise the `LT` bit is
|
||||||
|
cleared.
|
||||||
|
|
||||||
- `INC2` - Calculates `X` + 2 and stores the result in `X`. The [CARRY
|
- `INC2`
|
||||||
bit](https://en.wikipedia.org/wiki/Carry_flag) is handled as in the
|
* Calculates `X` + 2 and stores the result in `X`. The [CARRY
|
||||||
`ADD` instruction.
|
bit](https://en.wikipedia.org/wiki/Carry_flag) is handled as in the `ADD`
|
||||||
|
instruction.
|
||||||
|
|
||||||
Internally the [ALU](https://en.wikipedia.org/wiki/Arithmetic_logic_unit)
|
Internally the [ALU](https://en.wikipedia.org/wiki/Arithmetic_logic_unit)
|
||||||
implements a one bit adder with a carry in and carry out. This adder is the core
|
implements a one bit adder with a carry in and carry out. This adder is the core
|
||||||
@@ -108,10 +114,10 @@ The choice of application may be a bit unfortunate since we've already
|
|||||||
seen a winning entry calculating [prime
|
seen a winning entry calculating [prime
|
||||||
numbers](https://en.wikipedia.org/wiki/Prime_number) in the
|
numbers](https://en.wikipedia.org/wiki/Prime_number) in the
|
||||||
[pre-processor](https://en.wikipedia.org/wiki/C_preprocessor).
|
[pre-processor](https://en.wikipedia.org/wiki/C_preprocessor).
|
||||||
There is a big difference though. The [1988/applin](../../1988/applin/index.html) entry uses pre-
|
There is a big difference though. The
|
||||||
processor arithmetic (in a very nice way though). This program only
|
[1988/applin](../../1988/applin/index.html) entry uses pre-processor arithmetic
|
||||||
defines and undefines symbols in a well defined ;) way and doesn't do
|
(in a very nice way though). This program only defines and undefines symbols in
|
||||||
any pre-processor arithmetics.
|
a well defined ;) way and doesn't do any pre-processor arithmetics.
|
||||||
|
|
||||||
The reason why I chose to do a [prime
|
The reason why I chose to do a [prime
|
||||||
number](https://en.wikipedia.org/wiki/Prime_number) application is that the
|
number](https://en.wikipedia.org/wiki/Prime_number) application is that the
|
||||||
|
|||||||
+35
-17
@@ -444,21 +444,39 @@ calculations and one status register <code>SR</code>. Each bit in the registers
|
|||||||
represented by one symbol that are either defined or undefined.</p>
|
represented by one symbol that are either defined or undefined.</p>
|
||||||
<p>The ALU has six instructions:</p>
|
<p>The ALU has six instructions:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><p><code>CLR_X</code> - Clear <a href="https://en.wikipedia.org/wiki/Processor_register">register</a> <code>X</code>.</p></li>
|
<li><code>CLR_X</code>
|
||||||
<li><p><code>CLR_Y</code> - Clear <a href="https://en.wikipedia.org/wiki/Processor_register">register</a> <code>Y</code>.</p></li>
|
<ul>
|
||||||
<li><p><code>ADD</code> - Calculates <code>X</code> + <code>Y</code> and stores the result in <code>X</code>. If the result
|
<li>Clear <a href="https://en.wikipedia.org/wiki/Processor_register">register</a> <code>X</code>.</li>
|
||||||
|
</ul></li>
|
||||||
|
<li><code>CLR_Y</code>
|
||||||
|
<ul>
|
||||||
|
<li>Clear <a href="https://en.wikipedia.org/wiki/Processor_register">register</a> <code>Y</code>.</li>
|
||||||
|
</ul></li>
|
||||||
|
<li><code>ADD</code>
|
||||||
|
<ul>
|
||||||
|
<li>Calculates <code>X</code> + <code>Y</code> and stores the result in <code>X</code>. If the result
|
||||||
is larger than 11 bits, the <a href="https://en.wikipedia.org/wiki/Carry_flag">CARRY
|
is larger than 11 bits, the <a href="https://en.wikipedia.org/wiki/Carry_flag">CARRY
|
||||||
bit</a> in <code>SR</code> is set otherwise
|
bit</a> in <code>SR</code> is set otherwise
|
||||||
the <code>CARRY</code> bit is cleared.</p></li>
|
the <code>CARRY</code> bit is cleared.</li>
|
||||||
<li><p><code>SUB</code> - Calculates <code>X</code> - <code>Y</code> and stores the result in <code>X</code>. If <code>Y</code> was larger
|
</ul></li>
|
||||||
than <code>X</code>, the <a href="https://en.wikipedia.org/wiki/Carry_flag">CARRY bit</a>
|
<li><code>SUB</code>
|
||||||
in <code>SR</code> is set otherwise the <code>CARRY</code> bit is cleared.</p></li>
|
<ul>
|
||||||
<li><p><code>TST</code> - If <code>X</code> == <code>Y</code> the <code>EQ</code> bit in <code>SR</code> is set, otherwise the <code>EQ</code> bit is
|
<li>Calculates <code>X</code> - <code>Y</code> and stores the result in <code>X</code>. If <code>Y</code> was larger than
|
||||||
cleared. If <code>X</code> < <code>Y</code> the <code>LT</code> bit in <code>SR</code> is set, otherwise the <code>LT</code>
|
<code>X</code>, the <a href="https://en.wikipedia.org/wiki/Carry_flag">CARRY bit</a> in <code>SR</code> is
|
||||||
bit is cleared.</p></li>
|
set otherwise the <code>CARRY</code> bit is cleared.</li>
|
||||||
<li><p><code>INC2</code> - Calculates <code>X</code> + 2 and stores the result in <code>X</code>. The <a href="https://en.wikipedia.org/wiki/Carry_flag">CARRY
|
</ul></li>
|
||||||
bit</a> is handled as in the
|
<li><code>TST</code>
|
||||||
<code>ADD</code> instruction.</p></li>
|
<ul>
|
||||||
|
<li>If <code>X</code> == <code>Y</code> the <code>EQ</code> bit in <code>SR</code> is set, otherwise the <code>EQ</code> bit is
|
||||||
|
cleared. If <code>X</code> < <code>Y</code> the <code>LT</code> bit in <code>SR</code> is set, otherwise the <code>LT</code> bit is
|
||||||
|
cleared.</li>
|
||||||
|
</ul></li>
|
||||||
|
<li><code>INC2</code>
|
||||||
|
<ul>
|
||||||
|
<li>Calculates <code>X</code> + 2 and stores the result in <code>X</code>. The <a href="https://en.wikipedia.org/wiki/Carry_flag">CARRY
|
||||||
|
bit</a> is handled as in the <code>ADD</code>
|
||||||
|
instruction.</li>
|
||||||
|
</ul></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>Internally the <a href="https://en.wikipedia.org/wiki/Arithmetic_logic_unit">ALU</a>
|
<p>Internally the <a href="https://en.wikipedia.org/wiki/Arithmetic_logic_unit">ALU</a>
|
||||||
implements a one bit adder with a carry in and carry out. This adder is the core
|
implements a one bit adder with a carry in and carry out. This adder is the core
|
||||||
@@ -487,10 +505,10 @@ calculation is made and the result is moved back to the memory.</p>
|
|||||||
seen a winning entry calculating <a href="https://en.wikipedia.org/wiki/Prime_number">prime
|
seen a winning entry calculating <a href="https://en.wikipedia.org/wiki/Prime_number">prime
|
||||||
numbers</a> in the
|
numbers</a> in the
|
||||||
<a href="https://en.wikipedia.org/wiki/C_preprocessor">pre-processor</a>.
|
<a href="https://en.wikipedia.org/wiki/C_preprocessor">pre-processor</a>.
|
||||||
There is a big difference though. The <a href="../../1988/applin/index.html">1988/applin</a> entry uses pre-
|
There is a big difference though. The
|
||||||
processor arithmetic (in a very nice way though). This program only
|
<a href="../../1988/applin/index.html">1988/applin</a> entry uses pre-processor arithmetic
|
||||||
defines and undefines symbols in a well defined ;) way and doesn’t do
|
(in a very nice way though). This program only defines and undefines symbols in
|
||||||
any pre-processor arithmetics.</p>
|
a well defined ;) way and doesn’t do any pre-processor arithmetics.</p>
|
||||||
<p>The reason why I chose to do a <a href="https://en.wikipedia.org/wiki/Prime_number">prime
|
<p>The reason why I chose to do a <a href="https://en.wikipedia.org/wiki/Prime_number">prime
|
||||||
number</a> application is that the
|
number</a> application is that the
|
||||||
algorithm can be written to do a lot of calculations without a lot of nesting
|
algorithm can be written to do a lot of calculations without a lot of nesting
|
||||||
|
|||||||
@@ -2228,24 +2228,21 @@ sentence 2, and so fails to display responses from <code>hibachi</code>.</p>
|
|||||||
<h3 id="source-code-2004jdalbecjdalbec.c">Source code: <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2004/jdalbec/jdalbec.c">2004/jdalbec/jdalbec.c</a></h3>
|
<h3 id="source-code-2004jdalbecjdalbec.c">Source code: <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2004/jdalbec/jdalbec.c">2004/jdalbec/jdalbec.c</a></h3>
|
||||||
<h3 id="information-2004jdalbecindex.html">Information: <a href="2004/jdalbec/index.html">2004/jdalbec/index.html</a></h3>
|
<h3 id="information-2004jdalbecindex.html">Information: <a href="2004/jdalbec/index.html">2004/jdalbec/index.html</a></h3>
|
||||||
<p>The author stated that:</p>
|
<p>The author stated that:</p>
|
||||||
<pre><code> Arguments matching `/[^2]22$/` cause the program to segfault
|
<blockquote>
|
||||||
after rapidly exhausting the available stack space. I could
|
<p>Arguments matching <code>/[^2]22$/</code> cause the program to segfault after rapidly
|
||||||
probably fix this by adding some special cases to the code,
|
exhausting the available stack space. I could probably fix this by adding some
|
||||||
but [Blaine the Mono] it's quite a bit more exciting this way,
|
special cases to the code, but [Blaine the Mono] it’s quite a bit more exciting
|
||||||
don't you think?[/Blaine] Since the trailing `22` will be
|
this way, don’t you think?[/Blaine] Since the trailing <code>22</code> will be its own
|
||||||
its own atom anyway, you can just insert a space in front of
|
atom anyway, you can just insert a space in front of it if you run into this
|
||||||
it if you run into this feature (e.g. `1 22` instead of `122`).
|
feature (e.g. <code>1 22</code> instead of <code>122</code>).</p>
|
||||||
|
<p>Arguments matching <code>/(?:.){10,}/</code> will produce visually incorrect results
|
||||||
Arguments matching `/(?:.){10,}/` will produce visually incorrect
|
(e.g., generation 1 starting from 1111111111 will print as <code>: 1</code>), but there’s
|
||||||
results (e.g., generation 1 starting from 1111111111 will
|
nothing interesting about these arguments that can’t be modeled using shorter
|
||||||
print as `: 1`), but there's nothing interesting about these
|
runs of the same symbol.</p>
|
||||||
arguments that can't be modeled using shorter runs of the same
|
<p>Arguments matching <code>/(?:.){257,}/</code> may produce mathematically incorrect
|
||||||
symbol.
|
results (e.g., generation 1 starting from a string of 257 <code>1</code>s will be
|
||||||
|
calculated as <code>11</code>); the remark from the previous paragraph applies here also.</p>
|
||||||
Arguments matching `/(?:.){257,}/` may produce mathematically
|
</blockquote>
|
||||||
incorrect results (e.g., generation 1 starting from a string
|
|
||||||
of 257 `1`s will be calculated as `11`); the remark from the
|
|
||||||
previous paragraph applies here also.</code></pre>
|
|
||||||
<div id="2004_sds">
|
<div id="2004_sds">
|
||||||
<h2 id="sds">2004/sds</h2>
|
<h2 id="sds">2004/sds</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2676,26 +2676,21 @@ sentence 2, and so fails to display responses from `hibachi`.
|
|||||||
|
|
||||||
The author stated that:
|
The author stated that:
|
||||||
|
|
||||||
```
|
> Arguments matching `/[^2]22$/` cause the program to segfault after rapidly
|
||||||
Arguments matching `/[^2]22$/` cause the program to segfault
|
exhausting the available stack space. I could probably fix this by adding some
|
||||||
after rapidly exhausting the available stack space. I could
|
special cases to the code, but [Blaine the Mono] it's quite a bit more exciting
|
||||||
probably fix this by adding some special cases to the code,
|
this way, don't you think?[/Blaine] Since the trailing `22` will be its own
|
||||||
but [Blaine the Mono] it's quite a bit more exciting this way,
|
atom anyway, you can just insert a space in front of it if you run into this
|
||||||
don't you think?[/Blaine] Since the trailing `22` will be
|
feature (e.g. `1 22` instead of `122`).
|
||||||
its own atom anyway, you can just insert a space in front of
|
>
|
||||||
it if you run into this feature (e.g. `1 22` instead of `122`).
|
> Arguments matching `/(?:.){10,}/` will produce visually incorrect results
|
||||||
|
(e.g., generation 1 starting from 1111111111 will print as `: 1`), but there's
|
||||||
Arguments matching `/(?:.){10,}/` will produce visually incorrect
|
nothing interesting about these arguments that can't be modeled using shorter
|
||||||
results (e.g., generation 1 starting from 1111111111 will
|
runs of the same symbol.
|
||||||
print as `: 1`), but there's nothing interesting about these
|
>
|
||||||
arguments that can't be modeled using shorter runs of the same
|
> Arguments matching `/(?:.){257,}/` may produce mathematically incorrect
|
||||||
symbol.
|
results (e.g., generation 1 starting from a string of 257 `1`s will be
|
||||||
|
calculated as `11`); the remark from the previous paragraph applies here also.
|
||||||
Arguments matching `/(?:.){257,}/` may produce mathematically
|
|
||||||
incorrect results (e.g., generation 1 starting from a string
|
|
||||||
of 257 `1`s will be calculated as `11`); the remark from the
|
|
||||||
previous paragraph applies here also.
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
<div id="2004_sds">
|
<div id="2004_sds">
|
||||||
|
|||||||
@@ -3101,7 +3101,7 @@ FAQ on “<a href="faq.html#arg_count">main function args</a>”
|
|||||||
for more details.</p>
|
for more details.</p>
|
||||||
<p>Cody also added the <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2004/kopczynski/try.sh">try.sh</a> script and various data
|
<p>Cody also added the <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2004/kopczynski/try.sh">try.sh</a> script and various data
|
||||||
files: <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2004/kopczynski/kopczynski-a">kopczynski-a</a> to demonstrate what happens when art more
|
files: <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2004/kopczynski/kopczynski-a">kopczynski-a</a> to demonstrate what happens when art more
|
||||||
like a letter is fed to the program and the <code>kopczynski*-rev</code> files which are
|
like a letter is fed to the program, and the <code>kopczynski*-rev</code> files which are
|
||||||
the data files reversed with <code>rev(1)</code>. One had to be modified additionally to
|
the data files reversed with <code>rev(1)</code>. One had to be modified additionally to
|
||||||
get it to work, that being <code>kopczynski-10-rev</code>.</p>
|
get it to work, that being <code>kopczynski-10-rev</code>.</p>
|
||||||
<div id="2004_newbern">
|
<div id="2004_newbern">
|
||||||
|
|||||||
+1
-1
@@ -3836,7 +3836,7 @@ for more details.
|
|||||||
|
|
||||||
Cody also added the [try.sh](%%REPO_URL%%/2004/kopczynski/try.sh) script and various data
|
Cody also added the [try.sh](%%REPO_URL%%/2004/kopczynski/try.sh) script and various data
|
||||||
files: [kopczynski-a](%%REPO_URL%%/2004/kopczynski/kopczynski-a) to demonstrate what happens when art more
|
files: [kopczynski-a](%%REPO_URL%%/2004/kopczynski/kopczynski-a) to demonstrate what happens when art more
|
||||||
like a letter is fed to the program and the `kopczynski*-rev` files which are
|
like a letter is fed to the program, and the `kopczynski*-rev` files which are
|
||||||
the data files reversed with `rev(1)`. One had to be modified additionally to
|
the data files reversed with `rev(1)`. One had to be modified additionally to
|
||||||
get it to work, that being `kopczynski-10-rev`.
|
get it to work, that being `kopczynski-10-rev`.
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user