Merge pull request #2608 from xexyl/2khtml
This commit is contained in:
24 files changed
+315
-246
No files matched your search
@@ -20,7 +20,7 @@ its output is very specific, the internal FFT has a wide variety of uses.
|
|||||||
Can you modify this code to produce primes such as `23523*2^70000-1`,
|
Can you modify this code to produce primes such as `23523*2^70000-1`,
|
||||||
`48594^65536+1` or `6917!-1`?
|
`48594^65536+1` or `6917!-1`?
|
||||||
|
|
||||||
NOTE: as bigger primes are found as time goes by this program no longer prints
|
**NOTE**: as bigger primes are found as time goes by this program no longer prints
|
||||||
the biggest prime once noted by the author below.
|
the biggest prime once noted by the author below.
|
||||||
|
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ Fourier Transform to compute this number in a reasonable amount
|
|||||||
of time (the usual method would take ages !).
|
of time (the usual method would take ages !).
|
||||||
|
|
||||||
The program uses >= 64 bit `long long` type. It should run on any
|
The program uses >= 64 bit `long long` type. It should run on any
|
||||||
system with a gcc compiler.
|
system with a `gcc` compiler.
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
@@ -416,7 +416,7 @@ Location: <a href="../../location.html#FR">FR</a> - <em>French Republic</em> (<e
|
|||||||
its output is very specific, the internal FFT has a wide variety of uses.</p>
|
its output is very specific, the internal FFT has a wide variety of uses.</p>
|
||||||
<p>Can you modify this code to produce primes such as <code>23523*2^70000-1</code>,
|
<p>Can you modify this code to produce primes such as <code>23523*2^70000-1</code>,
|
||||||
<code>48594^65536+1</code> or <code>6917!-1</code>?</p>
|
<code>48594^65536+1</code> or <code>6917!-1</code>?</p>
|
||||||
<p>NOTE: as bigger primes are found as time goes by this program no longer prints
|
<p><strong>NOTE</strong>: as bigger primes are found as time goes by this program no longer prints
|
||||||
the biggest prime once noted by the author below.</p>
|
the biggest prime once noted by the author below.</p>
|
||||||
<h2 id="authors-comments">Author’s comments:</h2>
|
<h2 id="authors-comments">Author’s comments:</h2>
|
||||||
<p>This program prints the biggest known prime number (<code>2^6972593-1</code>)
|
<p>This program prints the biggest known prime number (<code>2^6972593-1</code>)
|
||||||
@@ -424,7 +424,7 @@ in base 10. It requires a few minutes. It uses a Modular Fast
|
|||||||
Fourier Transform to compute this number in a reasonable amount
|
Fourier Transform to compute this number in a reasonable amount
|
||||||
of time (the usual method would take ages !).</p>
|
of time (the usual method would take ages !).</p>
|
||||||
<p>The program uses >= 64 bit <code>long long</code> type. It should run on any
|
<p>The program uses >= 64 bit <code>long long</code> type. It should run on any
|
||||||
system with a gcc compiler.</p>
|
system with a <code>gcc</code> compiler.</p>
|
||||||
<!--
|
<!--
|
||||||
|
|
||||||
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
|
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
{
|
{
|
||||||
"file_path" : "lavabus.pgm",
|
"file_path" : "lavabus.pgm",
|
||||||
"inventory_order" : 100,
|
"inventory_order" : 100,
|
||||||
"OK_to_edit" : true,
|
"OK_to_edit" : false,
|
||||||
"display_as" : "image",
|
"display_as" : "image",
|
||||||
"display_via_github" : false,
|
"display_via_github" : false,
|
||||||
"entry_text" : "Kilauea volcano bus trapped in lava"
|
"entry_text" : "Kilauea volcano bus trapped in lava"
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
{
|
{
|
||||||
"file_path" : "michael.pgm",
|
"file_path" : "michael.pgm",
|
||||||
"inventory_order" : 100,
|
"inventory_order" : 100,
|
||||||
"OK_to_edit" : true,
|
"OK_to_edit" : false,
|
||||||
"display_as" : "image",
|
"display_as" : "image",
|
||||||
"display_via_github" : false,
|
"display_via_github" : false,
|
||||||
"entry_text" : "image of author’s godchild and nephew"
|
"entry_text" : "image of author’s godchild and nephew"
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
{
|
{
|
||||||
"file_path" : "lenna.glic",
|
"file_path" : "lenna.glic",
|
||||||
"inventory_order" : 150,
|
"inventory_order" : 150,
|
||||||
"OK_to_edit" : true,
|
"OK_to_edit" : false,
|
||||||
"display_as" : "binary",
|
"display_as" : "binary",
|
||||||
"display_via_github" : false,
|
"display_via_github" : false,
|
||||||
"entry_text" : "P10 scan of 1972 Playboy centerfold"
|
"entry_text" : "P10 scan of 1972 Playboy centerfold"
|
||||||
|
|||||||
+17
-17
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
## Try:
|
## Try:
|
||||||
|
|
||||||
In a video window (white text on black background):
|
In a terminal window (white text on black background):
|
||||||
|
|
||||||
``` <!---sh-->
|
``` <!---sh-->
|
||||||
./try.sh
|
./try.sh
|
||||||
@@ -33,7 +33,7 @@ The author recommended on linux/x86, glibc 2.0, libc4/5:
|
|||||||
|
|
||||||
``` <!---make-->
|
``` <!---make-->
|
||||||
bmeyer: bmeyer.c
|
bmeyer: bmeyer.c
|
||||||
CC -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm
|
cc -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm
|
||||||
```
|
```
|
||||||
|
|
||||||
However many compilers use `-O3` as the maximum level for `-O` optimization.
|
However many compilers use `-O3` as the maximum level for `-O` optimization.
|
||||||
@@ -74,9 +74,9 @@ This program is called `GLICBAWLS`
|
|||||||
Squares".
|
Squares".
|
||||||
|
|
||||||
And that's exactly what this program does --- feed it a .PGM file
|
And that's exactly what this program does --- feed it a .PGM file
|
||||||
(either raw [i.e. P5] or ASCII [i.e. P2]) on stdin, and it will
|
(either raw [i.e. P5] or ASCII [i.e. P2]) on `stdin`, and it will
|
||||||
output a compressed version to stdout. Feed it a compressed file
|
output a compressed version to `stdout`. Feed it a compressed file
|
||||||
on stdin, and it will decompress it to stdout --- as either raw or
|
on `stdin`, and it will decompress it to `stdout` --- as either raw or
|
||||||
ASCII .PGM, depending on what format it was compressed from. For
|
ASCII .PGM, depending on what format it was compressed from. For
|
||||||
example:
|
example:
|
||||||
|
|
||||||
@@ -215,7 +215,7 @@ In short --- running it through the preprocessor and the
|
|||||||
pretty-printer will give you something that looks slightly less
|
pretty-printer will give you something that looks slightly less
|
||||||
like line noise and slightly more like a C program, but unless you
|
like line noise and slightly more like a C program, but unless you
|
||||||
are a true wizard, it is unlikely to gain you any insights into
|
are a true wizard, it is unlikely to gain you any insights into
|
||||||
what is actually going on....[^0]
|
what is actually going on....[^1]
|
||||||
|
|
||||||
|
|
||||||
### Bugs, Assumptions and TODO
|
### Bugs, Assumptions and TODO
|
||||||
@@ -269,7 +269,7 @@ ordering. For each pixel, an expected value is calculated by creating a least
|
|||||||
squares predictor of order 12 based on all of the previously encoded/decoded
|
squares predictor of order 12 based on all of the previously encoded/decoded
|
||||||
pixels. However, the contribution of each pixel is weighted according to its
|
pixels. However, the contribution of each pixel is weighted according to its
|
||||||
[Manhattan-distance](https://en.wikipedia.org/wiki/Taxicab_geometry) from the
|
[Manhattan-distance](https://en.wikipedia.org/wiki/Taxicab_geometry) from the
|
||||||
current pixel, `D`. That weight used is `pow(0.8,D)`. [^1] [^2] [^3]
|
current pixel, `D`. That weight used is `pow(0.8,D)`. [^2] [^3] [^4]
|
||||||
|
|
||||||
In a similar way, the prediction *errors* for all previous pixels
|
In a similar way, the prediction *errors* for all previous pixels
|
||||||
are combined --- a weighted average (with weight `pow(0.7,D)`) of
|
are combined --- a weighted average (with weight `pow(0.7,D)`) of
|
||||||
@@ -293,27 +293,27 @@ arithmetic decoder provides the information which half the actual
|
|||||||
value is in. In both cases, the interval borders are adjusted
|
value is in. In both cases, the interval borders are adjusted
|
||||||
accordingly, the arithmetic coder/decoder updated, and the
|
accordingly, the arithmetic coder/decoder updated, and the
|
||||||
interval halving repeated until the precise value has been
|
interval halving repeated until the precise value has been
|
||||||
en/decoded[^4].
|
en/decoded[^5].
|
||||||
|
|
||||||
|
|
||||||
[^0]: Yes, this could be seen as a challenge....
|
[^1]: Yes, this could be seen as a challenge....
|
||||||
[^1]: Actually, the weight is `pow(0.8,D)/s`, where `s` is the sigma
|
[^2]: Actually, the weight is `pow(0.8,D)/s`, where `s` is the sigma
|
||||||
used for encoding/decoding the particular previous pixel. Dividing
|
used for encoding/decoding the particular previous pixel. Dividing
|
||||||
by `s` is a rather arbitrary action justified only by the
|
by `s` is a rather arbitrary action justified only by the
|
||||||
improvement in results. Mathematically, I can only justify
|
improvement in results. Mathematically, I can only justify
|
||||||
dividing by `s^2`, or not dividing at all....
|
dividing by `s^2`, or not dividing at all....
|
||||||
[^2]: Obviously, these least squares predictors are not calculated
|
[^3]: Obviously, these least squares predictors are not calculated
|
||||||
from scratch for each pixel. Some clever reuse of earlier
|
from scratch for each pixel. Some clever reuse of earlier
|
||||||
results allows `O(1)` calculation, rather than the
|
results allows `O(1)` calculation, rather than the
|
||||||
`O(previous_rows*columns)` this description would suggest.
|
`O(previous_rows*columns)` this description would suggest.
|
||||||
[^3]: As anyone who has ever tried local least squares knows from
|
[^4]: As anyone who has ever tried local least squares knows from
|
||||||
bitter experience, there is a lot of numerical instability
|
bitter experience, there is a lot of numerical instability
|
||||||
associated with them. So `glicbawls` adds a bias towards an
|
associated with them. So `glicbawls` adds a bias towards an
|
||||||
averaging predictor to the equation system the least squares
|
averaging predictor to the equation system the least squares
|
||||||
predictor is calculated from. The weight that is given to
|
predictor is calculated from. The weight that is given to
|
||||||
this bias is constantly adjusted throughout coding/decoding,
|
this bias is constantly adjusted throughout coding/decoding,
|
||||||
thus justifying the 'a' in `glicbawls`.
|
thus justifying the 'a' in `glicbawls`.
|
||||||
[^4]: In the case of near-lossless coding, the interval is not
|
[^5]: In the case of near-lossless coding, the interval is not
|
||||||
necessarily *halved*, but rather split at a convenient point
|
necessarily *halved*, but rather split at a convenient point
|
||||||
(the split points are chosen in such a way as to minimise the
|
(the split points are chosen in such a way as to minimise the
|
||||||
expected number of bits needed for coding). Also, the
|
expected number of bits needed for coding). Also, the
|
||||||
@@ -324,7 +324,7 @@ en/decoded[^4].
|
|||||||
### Photo Credit:
|
### Photo Credit:
|
||||||
|
|
||||||
[Lavabus](lavabus.pgm) was taken by the judge, Landon Curt Noll.
|
[Lavabus](lavabus.pgm) was taken by the judge, Landon Curt Noll.
|
||||||
[Michael](michael.pgm) was provided by the author. [Lenna](%%REPO_URL%%/2000/bmeyer/lenna.glic) is a
|
[Michael](michael.pgm) was provided by the author. [Lenna](lenna.glic) is a
|
||||||
1972 Playboy centerfold (doesn't show very much).
|
1972 Playboy centerfold (doesn't show very much).
|
||||||
|
|
||||||
- [michael.pgm](michael.pgm)
|
- [michael.pgm](michael.pgm)
|
||||||
@@ -333,11 +333,11 @@ en/decoded[^4].
|
|||||||
|
|
||||||
- [lavabus.pgm](lavabus.pgm)
|
- [lavabus.pgm](lavabus.pgm)
|
||||||
|
|
||||||
A bus that was trapped by lava from [Kilauea
|
A bus that was trapped by lava from [Kīlauea
|
||||||
volcano](https://en.wikipedia.org/wiki/Kīlauea) in Hawaii, US. Nobody was
|
volcano](https://en.wikipedia.org/wiki/Kīlauea) in Hawaii, US. Nobody was
|
||||||
in the bus at the time, BTW. Photo date: 1981.
|
in the bus at the time, BTW. Photo date: 1981.
|
||||||
|
|
||||||
- [lenna.glic](%%REPO_URL%%/2000/bmeyer/lenna.glic)
|
- [lenna.glic](lenna.glic)
|
||||||
|
|
||||||
A November 1972 Playboy centerfold was scanned in long ago and has been used
|
A November 1972 Playboy centerfold was scanned in long ago and has been used
|
||||||
for image compression research since then. Playboy originally threatened to
|
for image compression research since then. Playboy originally threatened to
|
||||||
|
|||||||
@@ -412,7 +412,7 @@ Location: <a href="../../location.html#AU">AU</a> - <em>Commonwealth of Australi
|
|||||||
<h2 id="to-use">To use:</h2>
|
<h2 id="to-use">To use:</h2>
|
||||||
<pre><code> ./bmeyer</code></pre>
|
<pre><code> ./bmeyer</code></pre>
|
||||||
<h2 id="try">Try:</h2>
|
<h2 id="try">Try:</h2>
|
||||||
<p>In a video window (white text on black background):</p>
|
<p>In a terminal window (white text on black background):</p>
|
||||||
<pre><code> ./try.sh</code></pre>
|
<pre><code> ./try.sh</code></pre>
|
||||||
<p>The script will suggest you compare the output of the program with images,
|
<p>The script will suggest you compare the output of the program with images,
|
||||||
prompting you to press any key to continue so that you may do so.</p>
|
prompting you to press any key to continue so that you may do so.</p>
|
||||||
@@ -421,7 +421,7 @@ prompting you to press any key to continue so that you may do so.</p>
|
|||||||
dashed argument) for compression and decompression! You’ve been warned.</p>
|
dashed argument) for compression and decompression! You’ve been warned.</p>
|
||||||
<p>The author recommended on linux/x86, glibc 2.0, libc4/5:</p>
|
<p>The author recommended on linux/x86, glibc 2.0, libc4/5:</p>
|
||||||
<pre><code> bmeyer: bmeyer.c
|
<pre><code> bmeyer: bmeyer.c
|
||||||
CC -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm</code></pre>
|
cc -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm</code></pre>
|
||||||
<p>However many compilers use <code>-O3</code> as the maximum level for <code>-O</code> optimization.</p>
|
<p>However many compilers use <code>-O3</code> as the maximum level for <code>-O</code> optimization.</p>
|
||||||
<p>And on linux/x86, glibc 2.1:</p>
|
<p>And on linux/x86, glibc 2.1:</p>
|
||||||
<pre><code> bmeyer: bmeyer.c
|
<pre><code> bmeyer: bmeyer.c
|
||||||
@@ -446,9 +446,9 @@ chance any given file produced might not be portable.</p>
|
|||||||
<p><code>GLICBAWLS</code> stands for “Grey Level Image Compression By Adaptive Weighted Least
|
<p><code>GLICBAWLS</code> stands for “Grey Level Image Compression By Adaptive Weighted Least
|
||||||
Squares”.</p>
|
Squares”.</p>
|
||||||
<p>And that’s exactly what this program does — feed it a .PGM file
|
<p>And that’s exactly what this program does — feed it a .PGM file
|
||||||
(either raw [i.e. P5] or ASCII [i.e. P2]) on stdin, and it will
|
(either raw [i.e. P5] or ASCII [i.e. P2]) on <code>stdin</code>, and it will
|
||||||
output a compressed version to stdout. Feed it a compressed file
|
output a compressed version to <code>stdout</code>. Feed it a compressed file
|
||||||
on stdin, and it will decompress it to stdout — as either raw or
|
on <code>stdin</code>, and it will decompress it to <code>stdout</code> — as either raw or
|
||||||
ASCII .PGM, depending on what format it was compressed from. For
|
ASCII .PGM, depending on what format it was compressed from. For
|
||||||
example:</p>
|
example:</p>
|
||||||
<pre><code> ./glicbawls < michael.pgm > michael.glic</code></pre>
|
<pre><code> ./glicbawls < michael.pgm > michael.glic</code></pre>
|
||||||
@@ -614,16 +614,16 @@ interval halving repeated until the precise value has been
|
|||||||
en/decoded<a href="#fn5" class="footnote-ref" id="fnref5" role="doc-noteref"><sup>5</sup></a>.</p>
|
en/decoded<a href="#fn5" class="footnote-ref" id="fnref5" role="doc-noteref"><sup>5</sup></a>.</p>
|
||||||
<h3 id="photo-credit">Photo Credit:</h3>
|
<h3 id="photo-credit">Photo Credit:</h3>
|
||||||
<p><a href="lavabus.pgm">Lavabus</a> was taken by the judge, Landon Curt Noll.
|
<p><a href="lavabus.pgm">Lavabus</a> was taken by the judge, Landon Curt Noll.
|
||||||
<a href="michael.pgm">Michael</a> was provided by the author. <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/bmeyer/lenna.glic">Lenna</a> is a
|
<a href="michael.pgm">Michael</a> was provided by the author. <a href="lenna.glic">Lenna</a> is a
|
||||||
1972 Playboy centerfold (doesn’t show very much).</p>
|
1972 Playboy centerfold (doesn’t show very much).</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><p><a href="michael.pgm">michael.pgm</a></p>
|
<li><p><a href="michael.pgm">michael.pgm</a></p>
|
||||||
<p>The author’s Godchild and nephew.</p></li>
|
<p>The author’s Godchild and nephew.</p></li>
|
||||||
<li><p><a href="lavabus.pgm">lavabus.pgm</a></p>
|
<li><p><a href="lavabus.pgm">lavabus.pgm</a></p>
|
||||||
<p>A bus that was trapped by lava from <a href="https://en.wikipedia.org/wiki/Kīlauea">Kilauea
|
<p>A bus that was trapped by lava from <a href="https://en.wikipedia.org/wiki/Kīlauea">Kīlauea
|
||||||
volcano</a> in Hawaii, US. Nobody was
|
volcano</a> in Hawaii, US. Nobody was
|
||||||
in the bus at the time, BTW. Photo date: 1981.</p></li>
|
in the bus at the time, BTW. Photo date: 1981.</p></li>
|
||||||
<li><p><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/bmeyer/lenna.glic">lenna.glic</a></p>
|
<li><p><a href="lenna.glic">lenna.glic</a></p>
|
||||||
<p>A November 1972 Playboy centerfold was scanned in long ago and has been used
|
<p>A November 1972 Playboy centerfold was scanned in long ago and has been used
|
||||||
for image compression research since then. Playboy originally threatened to
|
for image compression research since then. Playboy originally threatened to
|
||||||
prosecute unauthorized use, but eventually granted that, having been in use
|
prosecute unauthorized use, but eventually granted that, having been in use
|
||||||
|
|||||||
@@ -28,16 +28,16 @@ You might also like to try:
|
|||||||
|
|
||||||
## Judges' remarks:
|
## Judges' remarks:
|
||||||
|
|
||||||
One could argue that this program was a "diseased dumpster of tripe"
|
One could argue that this program was a "`diseased dumpster of tripe`"
|
||||||
but I suspect that would only result in the judges being heckled as a
|
but I suspect that would only result in the judges being heckled as a
|
||||||
"scum-encrusted congress of obscurity" (but only if it was in the early
|
"`scum-encrusted congress of obscurity`" (but only if it was in the early
|
||||||
evening of Dec 22, 2000).
|
evening of Dec 22, 2000).
|
||||||
|
|
||||||
Can you find out how it stores the insult strings? Can you then take
|
Can you find out how it stores the insult strings? Can you then take
|
||||||
an insult and figure out when it will be uttered?
|
an insult and figure out when it will be uttered?
|
||||||
|
|
||||||
|
|
||||||
## Author's remarks:
|
## Authors' remarks:
|
||||||
|
|
||||||
This program was broadcast from deep within the Zarbonic Cluster
|
This program was broadcast from deep within the Zarbonic Cluster
|
||||||
and received at 9:03pm on March 21st, 2000 by Moxen N. Briddlebane.
|
and received at 9:03pm on March 21st, 2000 by Moxen N. Briddlebane.
|
||||||
|
|||||||
@@ -424,13 +424,13 @@ equivalent file!</p>
|
|||||||
|
|
||||||
INSULTS=15 ./try.sh</code></pre>
|
INSULTS=15 ./try.sh</code></pre>
|
||||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||||
<p>One could argue that this program was a “diseased dumpster of tripe”
|
<p>One could argue that this program was a “<code>diseased dumpster of tripe</code>”
|
||||||
but I suspect that would only result in the judges being heckled as a
|
but I suspect that would only result in the judges being heckled as a
|
||||||
“scum-encrusted congress of obscurity” (but only if it was in the early
|
“<code>scum-encrusted congress of obscurity</code>” (but only if it was in the early
|
||||||
evening of Dec 22, 2000).</p>
|
evening of Dec 22, 2000).</p>
|
||||||
<p>Can you find out how it stores the insult strings? Can you then take
|
<p>Can you find out how it stores the insult strings? Can you then take
|
||||||
an insult and figure out when it will be uttered?</p>
|
an insult and figure out when it will be uttered?</p>
|
||||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
<h2 id="authors-remarks">Authors’ remarks:</h2>
|
||||||
<p>This program was broadcast from deep within the Zarbonic Cluster
|
<p>This program was broadcast from deep within the Zarbonic Cluster
|
||||||
and received at 9:03pm on March 21st, 2000 by Moxen N. Briddlebane.
|
and received at 9:03pm on March 21st, 2000 by Moxen N. Briddlebane.
|
||||||
The original author, as designated by other components of the
|
The original author, as designated by other components of the
|
||||||
|
|||||||
+49
-39
@@ -43,8 +43,8 @@ When this entry was submitted the rules of the IOCCC did not prohibit
|
|||||||
the use of embedded language interpreters. The judges considered
|
the use of embedded language interpreters. The judges considered
|
||||||
disqualifying this entry because of the use of perl, but on the other
|
disqualifying this entry because of the use of perl, but on the other
|
||||||
hand it qualifies as the Worst Abuse of the Rules. As a previous author,
|
hand it qualifies as the Worst Abuse of the Rules. As a previous author,
|
||||||
[David Lowe](../../authors.html#J_David_Lowe) continues to inflict the highest quality "poot" on the
|
[David Lowe](../../authors.html#J_David_Lowe) continues to inflict the highest
|
||||||
Judges.
|
quality "`poot`" on the Judges.
|
||||||
|
|
||||||
The program also contains an undocumented command for Chad and Chongo (Landon).
|
The program also contains an undocumented command for Chad and Chongo (Landon).
|
||||||
The judges' remarks contain a clue to the hidden command :-).
|
The judges' remarks contain a clue to the hidden command :-).
|
||||||
@@ -71,31 +71,41 @@ based on the `dc(1)` unix calculator.
|
|||||||
|
|
||||||
This program understands the following `dc(1)` commands:
|
This program understands the following `dc(1)` commands:
|
||||||
|
|
||||||
```
|
- `p`
|
||||||
p prints the top stack value without altering the stack.
|
* prints the top stack value without altering the stack.
|
||||||
P prints the top stack value, removing it from the stack, and
|
- `P`
|
||||||
doesn't print a trailing newline.
|
* prints the top stack value, removing it from the stack, and
|
||||||
f prints the contents of the stack, one number per line,
|
doesn't print a trailing newline.
|
||||||
without modifying it.
|
- `f`
|
||||||
c clears the stack.
|
* prints the contents of the stack, one number per line,
|
||||||
d pushes a copy of the top stack value onto the stack.
|
without modifying it.
|
||||||
r reverses the order of the top two stack values.
|
- `c`
|
||||||
```
|
* clears the stack.
|
||||||
|
- `d`
|
||||||
|
* pushes a copy of the top stack value onto the stack.
|
||||||
|
- `r`
|
||||||
|
* reverses the order of the top two stack values.
|
||||||
|
|
||||||
And the following arithmetic operators are supported:
|
And the following arithmetic operators are supported:
|
||||||
|
|
||||||
```
|
- `+`
|
||||||
+ Pops 2 values and pushes their sum.
|
* Pops 2 values and pushes their sum.
|
||||||
- Pops 2 values and pushes the result of subtracting the first
|
|
||||||
from the second.
|
- `-`
|
||||||
* Pops 2 values and pushes their product.
|
* Pops 2 values and pushes the result of subtracting the first
|
||||||
/ Pops 2 values and pushes the result of dividing the second
|
from the second.
|
||||||
by the first.
|
|
||||||
^ Pops 2 values and pushes the result of raising the second
|
- `*`
|
||||||
to the power of the first.
|
* Pops 2 values and pushes their product.
|
||||||
% Pops 2 values and pushes the remainder of the division that
|
- `/`
|
||||||
/ would do.
|
* Pops 2 values and pushes the result of dividing the second
|
||||||
```
|
by the first.
|
||||||
|
- `^`
|
||||||
|
* Pops 2 values and pushes the result of raising the second
|
||||||
|
to the power of the first.
|
||||||
|
- `%`
|
||||||
|
* Pops 2 values and pushes the remainder of the division that
|
||||||
|
`/` would do.
|
||||||
|
|
||||||
The precision and range are double, like it or not, except that the
|
The precision and range are double, like it or not, except that the
|
||||||
modulus operator actually returns `(p1 - (p2 * (p1 / p2)))`, but with
|
modulus operator actually returns `(p1 - (p2 * (p1 / p2)))`, but with
|
||||||
@@ -110,16 +120,16 @@ or EOF is encountered.
|
|||||||
|
|
||||||
### Diagnostics:
|
### Diagnostics:
|
||||||
|
|
||||||
```
|
- "stack empty"
|
||||||
"stack empty" Not enough on the stack for the requested command
|
* Not enough on the stack for the requested command
|
||||||
"divide by zero" Attempt to divide by zero
|
- "divide by zero"
|
||||||
"unimplemented" Invalid input
|
* Attempt to divide by zero
|
||||||
|
- "unimplemented"
|
||||||
Floating point exception (core dumped) (or something to that effect)
|
* Invalid input
|
||||||
Bug in Perl_sv_upgrade causes this in some cases when
|
- "Floating point exception (core dumped)" (or something to that effect)
|
||||||
the results of an operation are really huge (> 10^308)
|
* Bug in Perl_sv_upgrade causes this in some cases when the results of an
|
||||||
This bug appears to be fixed in perl5.6.0
|
operation are really huge (> 10^308) This bug appears to be fixed in
|
||||||
```
|
perl5.6.0.
|
||||||
|
|
||||||
|
|
||||||
### Examples:
|
### Examples:
|
||||||
@@ -244,7 +254,7 @@ possible to write (even more) obfuscated reverse Polish commands
|
|||||||
(I figure this explanation moves the synonyms from 'bug' to
|
(I figure this explanation moves the synonyms from 'bug' to
|
||||||
'feature'!)
|
'feature'!)
|
||||||
|
|
||||||
. The first IOCCC entry with an "easter egg"?...
|
- The first IOCCC entry with an "easter egg"?...
|
||||||
|
|
||||||
|
|
||||||
### Aside: on unobfuscated Perl
|
### Aside: on unobfuscated Perl
|
||||||
@@ -266,15 +276,15 @@ If you don't change the rules, it'll be embedded Ada next year!
|
|||||||
|
|
||||||
### Auto defend
|
### Auto defend
|
||||||
|
|
||||||
A. Isn't this the obfuscated C contest? What's this Perl `$#_&&$_`?
|
0. Isn't this the obfuscated C contest? What's this Perl `$#_&&$_`?
|
||||||
|
|
||||||
D. Hey, this program *is* 100% C, and does not exec an external Perl
|
1. Hey, this program *is* 100% C, and does not exec an external Perl
|
||||||
interpreter. It simply links against the Perl language library.
|
interpreter. It simply links against the Perl language library.
|
||||||
The "Perl code" is just a C string constant.
|
The "Perl code" is just a C string constant.
|
||||||
|
|
||||||
A. Perl isn't portable enough, or ubiquitous enough.
|
2. Perl isn't portable enough, or ubiquitous enough.
|
||||||
|
|
||||||
D. I'd argue that it is more portable than X. According to the Perl
|
3. I'd argue that it is more portable than X. According to the Perl
|
||||||
folks, it runs on the following platforms: Acorn, AIX, Amiga, AS/400,
|
folks, it runs on the following platforms: Acorn, AIX, Amiga, AS/400,
|
||||||
BeOS, Concurrent, Debian, DEC OSF/1, Digital UNIX, EPOC, FreeBSD,
|
BeOS, Concurrent, Debian, DEC OSF/1, Digital UNIX, EPOC, FreeBSD,
|
||||||
Guardian, HP-UX, IRIX, LinuxPPC, LynxOS, MacOS, MachTen, Minix, MPE/iX,
|
Guardian, HP-UX, IRIX, LinuxPPC, LynxOS, MacOS, MachTen, Minix, MPE/iX,
|
||||||
|
|||||||
+89
-35
@@ -428,8 +428,8 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
|
|||||||
the use of embedded language interpreters. The judges considered
|
the use of embedded language interpreters. The judges considered
|
||||||
disqualifying this entry because of the use of perl, but on the other
|
disqualifying this entry because of the use of perl, but on the other
|
||||||
hand it qualifies as the Worst Abuse of the Rules. As a previous author,
|
hand it qualifies as the Worst Abuse of the Rules. As a previous author,
|
||||||
<a href="../../authors.html#J_David_Lowe">David Lowe</a> continues to inflict the highest quality “poot” on the
|
<a href="../../authors.html#J_David_Lowe">David Lowe</a> continues to inflict the highest
|
||||||
Judges.</p>
|
quality “<code>poot</code>” on the Judges.</p>
|
||||||
<p>The program also contains an undocumented command for Chad and Chongo (Landon).
|
<p>The program also contains an undocumented command for Chad and Chongo (Landon).
|
||||||
The judges’ remarks contain a clue to the hidden command :-).</p>
|
The judges’ remarks contain a clue to the hidden command :-).</p>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -445,25 +445,65 @@ calculator</a>, loosely
|
|||||||
based on the <code>dc(1)</code> unix calculator.</p>
|
based on the <code>dc(1)</code> unix calculator.</p>
|
||||||
<h1 id="syntax">Syntax</h1>
|
<h1 id="syntax">Syntax</h1>
|
||||||
<p>This program understands the following <code>dc(1)</code> commands:</p>
|
<p>This program understands the following <code>dc(1)</code> commands:</p>
|
||||||
<pre><code> p prints the top stack value without altering the stack.
|
<ul>
|
||||||
P prints the top stack value, removing it from the stack, and
|
<li><code>p</code>
|
||||||
doesn't print a trailing newline.
|
<ul>
|
||||||
f prints the contents of the stack, one number per line,
|
<li>prints the top stack value without altering the stack.</li>
|
||||||
without modifying it.
|
</ul></li>
|
||||||
c clears the stack.
|
<li><code>P</code>
|
||||||
d pushes a copy of the top stack value onto the stack.
|
<ul>
|
||||||
r reverses the order of the top two stack values.</code></pre>
|
<li>prints the top stack value, removing it from the stack, and
|
||||||
|
doesn’t print a trailing newline.</li>
|
||||||
|
</ul></li>
|
||||||
|
<li><code>f</code>
|
||||||
|
<ul>
|
||||||
|
<li>prints the contents of the stack, one number per line,
|
||||||
|
without modifying it.</li>
|
||||||
|
</ul></li>
|
||||||
|
<li><code>c</code>
|
||||||
|
<ul>
|
||||||
|
<li>clears the stack.</li>
|
||||||
|
</ul></li>
|
||||||
|
<li><code>d</code>
|
||||||
|
<ul>
|
||||||
|
<li>pushes a copy of the top stack value onto the stack.</li>
|
||||||
|
</ul></li>
|
||||||
|
<li><code>r</code>
|
||||||
|
<ul>
|
||||||
|
<li>reverses the order of the top two stack values.</li>
|
||||||
|
</ul></li>
|
||||||
|
</ul>
|
||||||
<p>And the following arithmetic operators are supported:</p>
|
<p>And the following arithmetic operators are supported:</p>
|
||||||
<pre><code> + Pops 2 values and pushes their sum.
|
<ul>
|
||||||
- Pops 2 values and pushes the result of subtracting the first
|
<li><code>+</code>
|
||||||
from the second.
|
<ul>
|
||||||
* Pops 2 values and pushes their product.
|
<li>Pops 2 values and pushes their sum.</li>
|
||||||
/ Pops 2 values and pushes the result of dividing the second
|
</ul></li>
|
||||||
by the first.
|
<li><code>-</code>
|
||||||
^ Pops 2 values and pushes the result of raising the second
|
<ul>
|
||||||
to the power of the first.
|
<li>Pops 2 values and pushes the result of subtracting the first
|
||||||
% Pops 2 values and pushes the remainder of the division that
|
from the second.</li>
|
||||||
/ would do.</code></pre>
|
</ul></li>
|
||||||
|
<li><code>*</code>
|
||||||
|
<ul>
|
||||||
|
<li>Pops 2 values and pushes their product.</li>
|
||||||
|
</ul></li>
|
||||||
|
<li><code>/</code>
|
||||||
|
<ul>
|
||||||
|
<li>Pops 2 values and pushes the result of dividing the second
|
||||||
|
by the first.</li>
|
||||||
|
</ul></li>
|
||||||
|
<li><code>^</code>
|
||||||
|
<ul>
|
||||||
|
<li>Pops 2 values and pushes the result of raising the second
|
||||||
|
to the power of the first.</li>
|
||||||
|
</ul></li>
|
||||||
|
<li><code>%</code>
|
||||||
|
<ul>
|
||||||
|
<li>Pops 2 values and pushes the remainder of the division that
|
||||||
|
<code>/</code> would do.</li>
|
||||||
|
</ul></li>
|
||||||
|
</ul>
|
||||||
<p>The precision and range are double, like it or not, except that the
|
<p>The precision and range are double, like it or not, except that the
|
||||||
modulus operator actually returns <code>(p1 - (p2 * (p1 / p2)))</code>, but with
|
modulus operator actually returns <code>(p1 - (p2 * (p1 / p2)))</code>, but with
|
||||||
the innermost division calculated at integer precision. This is
|
the innermost division calculated at integer precision. This is
|
||||||
@@ -473,14 +513,26 @@ the command line. Unlike <code>dc(1)</code>, multiple commands on the same line
|
|||||||
must be space separated. Commands are only executed when a newline
|
must be space separated. Commands are only executed when a newline
|
||||||
or EOF is encountered.</p>
|
or EOF is encountered.</p>
|
||||||
<h3 id="diagnostics">Diagnostics:</h3>
|
<h3 id="diagnostics">Diagnostics:</h3>
|
||||||
<pre><code> "stack empty" Not enough on the stack for the requested command
|
<ul>
|
||||||
"divide by zero" Attempt to divide by zero
|
<li>“stack empty”
|
||||||
"unimplemented" Invalid input
|
<ul>
|
||||||
|
<li>Not enough on the stack for the requested command</li>
|
||||||
Floating point exception (core dumped) (or something to that effect)
|
</ul></li>
|
||||||
Bug in Perl_sv_upgrade causes this in some cases when
|
<li>“divide by zero”
|
||||||
the results of an operation are really huge (> 10^308)
|
<ul>
|
||||||
This bug appears to be fixed in perl5.6.0</code></pre>
|
<li>Attempt to divide by zero</li>
|
||||||
|
</ul></li>
|
||||||
|
<li>“unimplemented”
|
||||||
|
<ul>
|
||||||
|
<li>Invalid input</li>
|
||||||
|
</ul></li>
|
||||||
|
<li>“Floating point exception (core dumped)” (or something to that effect)
|
||||||
|
<ul>
|
||||||
|
<li>Bug in Perl_sv_upgrade causes this in some cases when the results of an
|
||||||
|
operation are really huge (> 10^308) This bug appears to be fixed in
|
||||||
|
perl5.6.0.</li>
|
||||||
|
</ul></li>
|
||||||
|
</ul>
|
||||||
<h3 id="examples">Examples:</h3>
|
<h3 id="examples">Examples:</h3>
|
||||||
<pre><code> $ echo '12 13 14 15 16 + + + + f' | ./dlowe
|
<pre><code> $ echo '12 13 14 15 16 + + + + f' | ./dlowe
|
||||||
70
|
70
|
||||||
@@ -577,8 +629,8 @@ easier to remember, <code>=</code> is synonymous with <code>d</code>. This also
|
|||||||
possible to write (even more) obfuscated reverse Polish commands
|
possible to write (even more) obfuscated reverse Polish commands
|
||||||
(I figure this explanation moves the synonyms from ‘bug’ to
|
(I figure this explanation moves the synonyms from ‘bug’ to
|
||||||
‘feature’!)</p></li>
|
‘feature’!)</p></li>
|
||||||
|
<li><p>The first IOCCC entry with an “easter egg”?…</p></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>. The first IOCCC entry with an “easter egg”?…</p>
|
|
||||||
<h3 id="aside-on-unobfuscated-perl">Aside: on unobfuscated Perl</h3>
|
<h3 id="aside-on-unobfuscated-perl">Aside: on unobfuscated Perl</h3>
|
||||||
<p>My original intent was to write obfuscated C and crystal-clear Perl,
|
<p>My original intent was to write obfuscated C and crystal-clear Perl,
|
||||||
to highlight my bending of the rules. Unfortunately, Perl really
|
to highlight my bending of the rules. Unfortunately, Perl really
|
||||||
@@ -590,12 +642,13 @@ the list of qualifications for judges… Oh dear, I guess your C
|
|||||||
beautifier won’t help too much, either ;)</p>
|
beautifier won’t help too much, either ;)</p>
|
||||||
<p>If you don’t change the rules, it’ll be embedded Ada next year!</p>
|
<p>If you don’t change the rules, it’ll be embedded Ada next year!</p>
|
||||||
<h3 id="auto-defend">Auto defend</h3>
|
<h3 id="auto-defend">Auto defend</h3>
|
||||||
<p>A. Isn’t this the obfuscated C contest? What’s this Perl <code>$#_&&$_</code>?</p>
|
<ol start="0" type="1">
|
||||||
<p>D. Hey, this program <em>is</em> 100% C, and does not exec an external Perl
|
<li><p>Isn’t this the obfuscated C contest? What’s this Perl <code>$#_&&$_</code>?</p></li>
|
||||||
|
<li><p>Hey, this program <em>is</em> 100% C, and does not exec an external Perl
|
||||||
interpreter. It simply links against the Perl language library.
|
interpreter. It simply links against the Perl language library.
|
||||||
The “Perl code” is just a C string constant.</p>
|
The “Perl code” is just a C string constant.</p></li>
|
||||||
<p>A. Perl isn’t portable enough, or ubiquitous enough.</p>
|
<li><p>Perl isn’t portable enough, or ubiquitous enough.</p></li>
|
||||||
<p>D. I’d argue that it is more portable than X. According to the Perl
|
<li><p>I’d argue that it is more portable than X. According to the Perl
|
||||||
folks, it runs on the following platforms: Acorn, AIX, Amiga, AS/400,
|
folks, it runs on the following platforms: Acorn, AIX, Amiga, AS/400,
|
||||||
BeOS, Concurrent, Debian, DEC OSF/1, Digital UNIX, EPOC, FreeBSD,
|
BeOS, Concurrent, Debian, DEC OSF/1, Digital UNIX, EPOC, FreeBSD,
|
||||||
Guardian, HP-UX, IRIX, LinuxPPC, LynxOS, MacOS, MachTen, Minix, MPE/iX,
|
Guardian, HP-UX, IRIX, LinuxPPC, LynxOS, MacOS, MachTen, Minix, MPE/iX,
|
||||||
@@ -603,7 +656,8 @@ MS-DOS, MVS, NetBSD, Netware, NextStep, OpenBSD, OpenLinux, ODT, OpenVMS,
|
|||||||
OS/2, OS390, OSR, PowerMAX, Psion, QNX, Redhat, Reliant UNIX, RISCOS,
|
OS/2, OS390, OSR, PowerMAX, Psion, QNX, Redhat, Reliant UNIX, RISCOS,
|
||||||
SCO, SGI, SINIX, Slackware, Solaris, Sun, SuSE, Tandem, Tru64, UNIX,
|
SCO, SGI, SINIX, Slackware, Solaris, Sun, SuSE, Tandem, Tru64, UNIX,
|
||||||
U/WIN, Unixware, VMS, Win31, Win32, Windows 3.1, and Windows 95/98/NT/2K.
|
U/WIN, Unixware, VMS, Win31, Win32, Windows 3.1, and Windows 95/98/NT/2K.
|
||||||
Granted, embeddable Perl isn’t quite so portable, but still…</p>
|
Granted, embeddable Perl isn’t quite so portable, but still…</p></li>
|
||||||
|
</ol>
|
||||||
<p>Also, Perl 5 is bundled with the following OS distributions: AIX 4.3.3+,
|
<p>Also, Perl 5 is bundled with the following OS distributions: AIX 4.3.3+,
|
||||||
FreeBSD 3.0+, IRIX 6.4+, every Linux distribution, NetBSD, OpenBSD, and
|
FreeBSD 3.0+, IRIX 6.4+, every Linux distribution, NetBSD, OpenBSD, and
|
||||||
DEC Tru64 5.0+, again according to the Perl people.</p>
|
DEC Tru64 5.0+, again according to the Perl people.</p>
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
{
|
{
|
||||||
"file_path" : "finance.sheet",
|
"file_path" : "finance.sheet",
|
||||||
"inventory_order" : 4000000000,
|
"inventory_order" : 4000000000,
|
||||||
"OK_to_edit" : true,
|
"OK_to_edit" : false,
|
||||||
"display_as" : "spreadsheet",
|
"display_as" : "spreadsheet",
|
||||||
"display_via_github" : false,
|
"display_via_github" : false,
|
||||||
"entry_text" : "example spreadsheet file"
|
"entry_text" : "example spreadsheet file"
|
||||||
|
|||||||
@@ -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)".
|
||||||
|
|
||||||
@@ -143,14 +143,14 @@ Finish the formula with `!` to create the histogram.
|
|||||||
#### 2.2. Starting and Loading Spreadsheets
|
#### 2.2. Starting and Loading Spreadsheets
|
||||||
|
|
||||||
To start the spreadsheet program with an existing
|
To start the spreadsheet program with an existing
|
||||||
spreadsheet, for instance [finance.sheet](%%REPO_URL%%/2000/jarijyrki/finance.sheet), use the following
|
spreadsheet, for instance [finance.sheet](finance.sheet), use the following
|
||||||
command line:
|
command line:
|
||||||
|
|
||||||
``` <!---sh-->
|
``` <!---sh-->
|
||||||
./jarijyrki < finance.sheet
|
./jarijyrki < finance.sheet
|
||||||
```
|
```
|
||||||
|
|
||||||
The file [finance.sheet](%%REPO_URL%%/2000/jarijyrki/finance.sheet) has been provided as an example. This
|
The file [finance.sheet](finance.sheet) has been provided as an example. This
|
||||||
file contains a set of financial numbers and two graphical entities - a pie
|
file contains a set of financial numbers and two graphical entities - a pie
|
||||||
chart and a histogram - based on them. We recommend starting the use of the
|
chart and a histogram - based on them. We recommend starting the use of the
|
||||||
program from this file, as a way to study and learn the formula language
|
program from this file, as a way to study and learn the formula language
|
||||||
@@ -186,7 +186,7 @@ Below the Formula Area is the Column Letters Area: `A`, `B`, and so on.
|
|||||||
Correspondingly, on the left side of the window is the Row Numbers Area: `1`, `2`,
|
Correspondingly, on the left side of the window is the Row Numbers Area: `1`, `2`,
|
||||||
and so on. The rest of the window is dedicated to the actual spreadsheet cells.
|
and so on. The rest of the window is dedicated to the actual spreadsheet cells.
|
||||||
|
|
||||||
The example spreadsheet, [finance.sheet](%%REPO_URL%%/2000/jarijyrki/finance.sheet), provided with this
|
The example spreadsheet, [finance.sheet](finance.sheet), provided with this
|
||||||
program contains two sets of numbers in the visible area of the spreadsheet. The
|
program contains two sets of numbers in the visible area of the spreadsheet. The
|
||||||
top set of numbers forms the product-by-product turnover breakdown of an
|
top set of numbers forms the product-by-product turnover breakdown of an
|
||||||
imaginary company. Below it is the yearly development of the company profits. On
|
imaginary company. Below it is the yearly development of the company profits. On
|
||||||
|
|||||||
@@ -414,7 +414,7 @@ Location: <a href="../../location.html#FI">FI</a> - <em>Republic of Finland </em
|
|||||||
<!-- BEFORE: 1st line of markdown file: 2000/jarijyrki/README.md -->
|
<!-- BEFORE: 1st line of markdown file: 2000/jarijyrki/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>
|
||||||
@@ -483,10 +483,10 @@ character at the end of the formula; press backspace to delete the last one.</p>
|
|||||||
<p>Finish the formula with <code>!</code> to create the histogram.</p>
|
<p>Finish the formula with <code>!</code> to create the histogram.</p>
|
||||||
<h4 id="starting-and-loading-spreadsheets">2.2. Starting and Loading Spreadsheets</h4>
|
<h4 id="starting-and-loading-spreadsheets">2.2. Starting and Loading Spreadsheets</h4>
|
||||||
<p>To start the spreadsheet program with an existing
|
<p>To start the spreadsheet program with an existing
|
||||||
spreadsheet, for instance <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/jarijyrki/finance.sheet">finance.sheet</a>, use the following
|
spreadsheet, for instance <a href="finance.sheet">finance.sheet</a>, use the following
|
||||||
command line:</p>
|
command line:</p>
|
||||||
<pre><code> ./jarijyrki < finance.sheet</code></pre>
|
<pre><code> ./jarijyrki < finance.sheet</code></pre>
|
||||||
<p>The file <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/jarijyrki/finance.sheet">finance.sheet</a> has been provided as an example. This
|
<p>The file <a href="finance.sheet">finance.sheet</a> has been provided as an example. This
|
||||||
file contains a set of financial numbers and two graphical entities - a pie
|
file contains a set of financial numbers and two graphical entities - a pie
|
||||||
chart and a histogram - based on them. We recommend starting the use of the
|
chart and a histogram - based on them. We recommend starting the use of the
|
||||||
program from this file, as a way to study and learn the formula language
|
program from this file, as a way to study and learn the formula language
|
||||||
@@ -507,7 +507,7 @@ currently selected cell. The program starts with <code>A1</code> as being the cu
|
|||||||
Below the Formula Area is the Column Letters Area: <code>A</code>, <code>B</code>, and so on.
|
Below the Formula Area is the Column Letters Area: <code>A</code>, <code>B</code>, and so on.
|
||||||
Correspondingly, on the left side of the window is the Row Numbers Area: <code>1</code>, <code>2</code>,
|
Correspondingly, on the left side of the window is the Row Numbers Area: <code>1</code>, <code>2</code>,
|
||||||
and so on. The rest of the window is dedicated to the actual spreadsheet cells.</p>
|
and so on. The rest of the window is dedicated to the actual spreadsheet cells.</p>
|
||||||
<p>The example spreadsheet, <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/jarijyrki/finance.sheet">finance.sheet</a>, provided with this
|
<p>The example spreadsheet, <a href="finance.sheet">finance.sheet</a>, provided with this
|
||||||
program contains two sets of numbers in the visible area of the spreadsheet. The
|
program contains two sets of numbers in the visible area of the spreadsheet. The
|
||||||
top set of numbers forms the product-by-product turnover breakdown of an
|
top set of numbers forms the product-by-product turnover breakdown of an
|
||||||
imaginary company. Below it is the yearly development of the company profits. On
|
imaginary company. Below it is the yearly development of the company profits. On
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
```
|
```
|
||||||
|
|
||||||
An alt version exists for those in the southern hemisphere (or those who want to
|
An alt version exists for those in the southern hemisphere (or those who want to
|
||||||
see what it would be in the southern hemisphere). See [alternate
|
see what it would be in the southern hemisphere). See [Alternate
|
||||||
version](#alternate-code) below.
|
version](#alternate-code) below.
|
||||||
|
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ times in a day).
|
|||||||
Also try modifying the code so that it will show another Moon phase based on
|
Also try modifying the code so that it will show another Moon phase based on
|
||||||
input or else just by the code itself. Bonus points if you can make it show all.
|
input or else just by the code itself. Bonus points if you can make it show all.
|
||||||
|
|
||||||
NOTE: if it's a Full Moon the script won't look as nice.
|
**NOTE**: if it's a Full Moon the script won't look as nice.
|
||||||
|
|
||||||
|
|
||||||
## Alternate code:
|
## Alternate code:
|
||||||
@@ -40,7 +40,7 @@ The author noted that those in the southern hemisphere might want to change
|
|||||||
|
|
||||||
### Alternate build:
|
### Alternate build:
|
||||||
|
|
||||||
To run the alternate code that supports the southern hemisphere:
|
To build the alternate code that works for the southern hemisphere:
|
||||||
|
|
||||||
``` <!---sh-->
|
``` <!---sh-->
|
||||||
make alt
|
make alt
|
||||||
|
|||||||
@@ -410,7 +410,7 @@ Location: <a href="../../location.html#JP">JP</a> - <em>Japan</em></li>
|
|||||||
<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>An alt version exists for those in the southern hemisphere (or those who want to
|
<p>An alt version exists for those in the southern hemisphere (or those who want to
|
||||||
see what it would be in the southern hemisphere). See <a href="#alternate-code">alternate
|
see what it would be in the southern hemisphere). See <a href="#alternate-code">Alternate
|
||||||
version</a> below.</p>
|
version</a> below.</p>
|
||||||
<h2 id="to-use">To use:</h2>
|
<h2 id="to-use">To use:</h2>
|
||||||
<pre><code> ./natori</code></pre>
|
<pre><code> ./natori</code></pre>
|
||||||
@@ -421,12 +421,12 @@ Moon phase changes), and each time run it several times in a row (or several
|
|||||||
times in a day).</p>
|
times in a day).</p>
|
||||||
<p>Also try modifying the code so that it will show another Moon phase based on
|
<p>Also try modifying the code so that it will show another Moon phase based on
|
||||||
input or else just by the code itself. Bonus points if you can make it show all.</p>
|
input or else just by the code itself. Bonus points if you can make it show all.</p>
|
||||||
<p>NOTE: if it’s a Full Moon the script won’t look as nice.</p>
|
<p><strong>NOTE</strong>: if it’s a Full Moon the script won’t look as nice.</p>
|
||||||
<h2 id="alternate-code">Alternate code:</h2>
|
<h2 id="alternate-code">Alternate code:</h2>
|
||||||
<p>The author noted that those in the southern hemisphere might want to change
|
<p>The author noted that those in the southern hemisphere might want to change
|
||||||
<code>acos(l/2)</code> into <code>acos(-l/2)</code> which we have done in the alternate version.</p>
|
<code>acos(l/2)</code> into <code>acos(-l/2)</code> which we have done in the alternate version.</p>
|
||||||
<h3 id="alternate-build">Alternate build:</h3>
|
<h3 id="alternate-build">Alternate build:</h3>
|
||||||
<p>To run the alternate code that supports the southern hemisphere:</p>
|
<p>To build the alternate code that works for the southern hemisphere:</p>
|
||||||
<pre><code> make alt</code></pre>
|
<pre><code> make alt</code></pre>
|
||||||
<h3 id="alternate-use">Alternate use:</h3>
|
<h3 id="alternate-use">Alternate use:</h3>
|
||||||
<pre><code> ./natori.alt</code></pre>
|
<pre><code> ./natori.alt</code></pre>
|
||||||
|
|||||||
+40
-45
@@ -4,7 +4,7 @@
|
|||||||
make all
|
make all
|
||||||
```
|
```
|
||||||
|
|
||||||
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)".
|
||||||
|
|
||||||
@@ -91,20 +91,22 @@ for an example.
|
|||||||
|
|
||||||
This program plots the positions of the four [Galilean
|
This program plots the positions of the four [Galilean
|
||||||
moons](https://en.wikipedia.org/wiki/Galilean_moons) of
|
moons](https://en.wikipedia.org/wiki/Galilean_moons) of
|
||||||
[Jupiter](https://en.wikipedia.org/wiki/Jupiter), as seen from
|
[Jupiter](https://science.nasa.gov/jupiter/), as seen from
|
||||||
[Earth](https://en.wikipedia.org/wiki/Earth). It doesn't correct for your
|
[Earth](https://science.nasa.gov/earth/). It doesn't correct for your
|
||||||
location on Earth, but I assure you that the
|
location on Earth, but I assure you that the
|
||||||
[parallax](https://en.wikipedia.org/wiki/Parallax#Astronomy) is minimal!
|
[parallax](https://en.wikipedia.org/wiki/Parallax#Astronomy) is minimal!
|
||||||
|
|
||||||
The moons are labelled with Roman numerals from `I` to `IV`, `I` being the
|
The moons are labelled with Roman numerals from `I` to `IV`, `I` being the
|
||||||
closest to the planet and `IV` being the furthest. They are:
|
closest to the planet and `IV` being the furthest. They are:
|
||||||
|
|
||||||
```
|
- `I`
|
||||||
I Io
|
* [Io](https://science.nasa.gov/jupiter/moons/io)
|
||||||
II Europa
|
- `II`
|
||||||
III Ganymede
|
* [Europa](https://science.nasa.gov/jupiter/moons/europa/)
|
||||||
IV Callisto
|
- `III`
|
||||||
```
|
* [Ganymede](https://science.nasa.gov/jupiter/moons/ganymede/)
|
||||||
|
- `IV`
|
||||||
|
* [Callisto](https://science.nasa.gov/jupiter/moons/callisto)
|
||||||
|
|
||||||
Amazingly, all it takes is a pair of binoculars to see the Galilean moons,
|
Amazingly, all it takes is a pair of binoculars to see the Galilean moons,
|
||||||
so the results can be experimentally checked. (Note that at present, the
|
so the results can be experimentally checked. (Note that at present, the
|
||||||
@@ -135,40 +137,31 @@ Galileo discovered the moons in January 1610.
|
|||||||
<https://web.archive.org/web/20001204212000/http://www-isds.jpl.nasa.gov/cwo/cwo_54ga/html/cd/galileo.htm>
|
<https://web.archive.org/web/20001204212000/http://www-isds.jpl.nasa.gov/cwo/cwo_54ga/html/cd/galileo.htm>
|
||||||
states the following:
|
states the following:
|
||||||
|
|
||||||
```
|
> By early 1610, Galileo had further improved his telescope by double its power,
|
||||||
By early 1610, Galileo had further improved his telescope by
|
so it now enlarged objects a thousand times. He began looking at the stars and
|
||||||
double its power, so it now enlarged objects a thousand
|
couldn't believe how many more he could now see! The number seemed infinite. He
|
||||||
times. He began looking at the stars and couldn't believe how
|
was beginning to realize the fixed stars weren't a flat distant wall on a globe,
|
||||||
many more he could now see! The number seemed infinite. He was
|
but a three-dimensional expanse bigger than anyone had ever thought!
|
||||||
beginning to realize the fixed stars weren't a flat distant
|
>
|
||||||
wall on a globe, but a three-dimensional expanse bigger than
|
> Then, on January 7, about an hour after sunset, Jupiter rose in the east,
|
||||||
anyone had ever thought!
|
and Galileo happened to turn his powerful scope on its bright disk. It wasn't
|
||||||
|
the first time he had looked at Jupiter, but before it was with one of his
|
||||||
Then, on January 7, about an hour after sunset, Jupiter rose
|
lesser-powered telescopes. This time, though, he noticed three small but bright
|
||||||
in the east, and Galileo happened to turn his powerful scope
|
stars near the planet, two to one side and one to the other. He wondered at how
|
||||||
on its bright disk. It wasn't the first time he had looked at
|
bright the small stars were and how they were arranged in what seemed like a
|
||||||
Jupiter, but before it was with one of his lesser-powered
|
straight line. The next night he decided to look at Jupiter again, and to his
|
||||||
telescopes. This time, though, he noticed three small but
|
surprise, the stars had moved. But not in such a way as he would expect. If
|
||||||
bright stars near the planet, two to one side and one to the
|
Jupiter was moving as it normally should, the stars would be east of Jupiter.
|
||||||
other. He wondered at how bright the small stars were and how
|
But all three were to the west! The next night was cloudy, but on January 10,
|
||||||
they were arranged in what seemed like a straight line. The
|
Galileo was able to observe the planet again. One of the stars was gone, and the
|
||||||
next night he decided to look at Jupiter again, and to his
|
other two were now on the east side. As the stars moved around Jupiter on each
|
||||||
surprise, the stars had moved. But not in such a way as he
|
succeeding night, and were finally joined by a fourth star, it dawned on Galileo
|
||||||
would expect. If Jupiter was moving as it normally should, the
|
that what he had found were moons orbiting Jupiter! Almost at once he realized
|
||||||
stars would be east of Jupiter. But all three were to the
|
that this was proof that not all objects orbited the Earth. Here were four
|
||||||
west! The next night was cloudy, but on January 10, Galileo
|
bodies that were orbiting Jupiter. One argument against the sun-centered theory
|
||||||
was able to observe the planet again. One of the stars was
|
was, if the Earth orbited the sun, wouldn't the moon get left behind? Here he
|
||||||
gone, and the other two were now on the east side. As the
|
could see for himself that somehow, a planet could orbit the sun, and not leave
|
||||||
stars moved around Jupiter on each succeeding night, and were
|
a moon behind!
|
||||||
finally joined by a fourth star, it dawned on Galileo that
|
|
||||||
what he had found were moons orbiting Jupiter! Almost at once
|
|
||||||
he realized that this was proof that not all objects orbited
|
|
||||||
the Earth. Here were four bodies that were orbiting
|
|
||||||
Jupiter. One argument against the sun-centered theory was, if
|
|
||||||
the Earth orbited the sun, wouldn't the moon get left behind?
|
|
||||||
Here he could see for himself that somehow, a planet could
|
|
||||||
orbit the sun, and not leave a moon behind!
|
|
||||||
```
|
|
||||||
|
|
||||||
Thus we can plot Galileo's discoveries using the following three plots:
|
Thus we can plot Galileo's discoveries using the following three plots:
|
||||||
|
|
||||||
@@ -210,7 +203,9 @@ This program assumes:
|
|||||||
|
|
||||||
1. The ASCII character set is used.
|
1. The ASCII character set is used.
|
||||||
|
|
||||||
2. That an enormous comet hasn't changed the course of Jupiter (or Earth!).
|
2. That an enormous comet hasn't changed the course of
|
||||||
|
[Jupiter](https://science.nasa.gov/jupiter/) (or
|
||||||
|
[Earth](https://science.nasa.gov/earth/)!).
|
||||||
|
|
||||||
3. That the date has not been specified as the gap between the
|
3. That the date has not been specified as the gap between the
|
||||||
[Julian](https://en.wikipedia.org/wiki/Julian_calendar) and
|
[Julian](https://en.wikipedia.org/wiki/Julian_calendar) and
|
||||||
@@ -234,7 +229,7 @@ run from the surface of [Mars](https://science.nasa.gov/mars/).
|
|||||||
|
|
||||||
In addition to the normal obfuscations, I feel that the code contains some less
|
In addition to the normal obfuscations, I feel that the code contains some less
|
||||||
common tricks. Taken through the standard rounds listed in the
|
common tricks. Taken through the standard rounds listed in the
|
||||||
[guidelines](../../2000/guidelines.txt), the code attempts to pass these as follows:
|
[guidelines](../guidelines.txt), the code attempts to pass these as follows:
|
||||||
|
|
||||||
1. Look at the original source
|
1. Look at the original source
|
||||||
|
|
||||||
|
|||||||
+51
-41
@@ -409,7 +409,7 @@ Location: <a href="../../location.html#GB">GB</a> - <em>United Kingdom of Great
|
|||||||
<!-- BEFORE: 1st line of markdown file: 2000/rince/README.md -->
|
<!-- BEFORE: 1st line of markdown file: 2000/rince/README.md -->
|
||||||
<h2 id="to-build">To build:</h2>
|
<h2 id="to-build">To build:</h2>
|
||||||
<pre><code> make all</code></pre>
|
<pre><code> make all</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>
|
||||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||||
@@ -457,16 +457,30 @@ for an example.</p>
|
|||||||
<h3 id="what-it-does">What it does</h3>
|
<h3 id="what-it-does">What it does</h3>
|
||||||
<p>This program plots the positions of the four <a href="https://en.wikipedia.org/wiki/Galilean_moons">Galilean
|
<p>This program plots the positions of the four <a href="https://en.wikipedia.org/wiki/Galilean_moons">Galilean
|
||||||
moons</a> of
|
moons</a> of
|
||||||
<a href="https://en.wikipedia.org/wiki/Jupiter">Jupiter</a>, as seen from
|
<a href="https://science.nasa.gov/jupiter/">Jupiter</a>, as seen from
|
||||||
<a href="https://en.wikipedia.org/wiki/Earth">Earth</a>. It doesn’t correct for your
|
<a href="https://science.nasa.gov/earth/">Earth</a>. It doesn’t correct for your
|
||||||
location on Earth, but I assure you that the
|
location on Earth, but I assure you that the
|
||||||
<a href="https://en.wikipedia.org/wiki/Parallax#Astronomy">parallax</a> is minimal!</p>
|
<a href="https://en.wikipedia.org/wiki/Parallax#Astronomy">parallax</a> is minimal!</p>
|
||||||
<p>The moons are labelled with Roman numerals from <code>I</code> to <code>IV</code>, <code>I</code> being the
|
<p>The moons are labelled with Roman numerals from <code>I</code> to <code>IV</code>, <code>I</code> being the
|
||||||
closest to the planet and <code>IV</code> being the furthest. They are:</p>
|
closest to the planet and <code>IV</code> being the furthest. They are:</p>
|
||||||
<pre><code> I Io
|
<ul>
|
||||||
II Europa
|
<li><code>I</code>
|
||||||
III Ganymede
|
<ul>
|
||||||
IV Callisto</code></pre>
|
<li><a href="https://science.nasa.gov/jupiter/moons/io">Io</a></li>
|
||||||
|
</ul></li>
|
||||||
|
<li><code>II</code>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://science.nasa.gov/jupiter/moons/europa/">Europa</a></li>
|
||||||
|
</ul></li>
|
||||||
|
<li><code>III</code>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://science.nasa.gov/jupiter/moons/ganymede/">Ganymede</a></li>
|
||||||
|
</ul></li>
|
||||||
|
<li><code>IV</code>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://science.nasa.gov/jupiter/moons/callisto">Callisto</a></li>
|
||||||
|
</ul></li>
|
||||||
|
</ul>
|
||||||
<p>Amazingly, all it takes is a pair of binoculars to see the Galilean moons,
|
<p>Amazingly, all it takes is a pair of binoculars to see the Galilean moons,
|
||||||
so the results can be experimentally checked. (Note that at present, the
|
so the results can be experimentally checked. (Note that at present, the
|
||||||
best views of Jupiter are over the autumn/winter.)</p>
|
best views of Jupiter are over the autumn/winter.)</p>
|
||||||
@@ -487,38 +501,32 @@ confusion, please consult the following chart (*):</p>
|
|||||||
<p>Galileo discovered the moons in January 1610.
|
<p>Galileo discovered the moons in January 1610.
|
||||||
<a href="https://web.archive.org/web/20001204212000/http://www-isds.jpl.nasa.gov/cwo/cwo_54ga/html/cd/galileo.htm" class="uri">https://web.archive.org/web/20001204212000/http://www-isds.jpl.nasa.gov/cwo/cwo_54ga/html/cd/galileo.htm</a>
|
<a href="https://web.archive.org/web/20001204212000/http://www-isds.jpl.nasa.gov/cwo/cwo_54ga/html/cd/galileo.htm" class="uri">https://web.archive.org/web/20001204212000/http://www-isds.jpl.nasa.gov/cwo/cwo_54ga/html/cd/galileo.htm</a>
|
||||||
states the following:</p>
|
states the following:</p>
|
||||||
<pre><code> By early 1610, Galileo had further improved his telescope by
|
<blockquote>
|
||||||
double its power, so it now enlarged objects a thousand
|
<p>By early 1610, Galileo had further improved his telescope by double its power,
|
||||||
times. He began looking at the stars and couldn't believe how
|
so it now enlarged objects a thousand times. He began looking at the stars and
|
||||||
many more he could now see! The number seemed infinite. He was
|
couldn’t believe how many more he could now see! The number seemed infinite. He
|
||||||
beginning to realize the fixed stars weren't a flat distant
|
was beginning to realize the fixed stars weren’t a flat distant wall on a globe,
|
||||||
wall on a globe, but a three-dimensional expanse bigger than
|
but a three-dimensional expanse bigger than anyone had ever thought!</p>
|
||||||
anyone had ever thought!
|
<p>Then, on January 7, about an hour after sunset, Jupiter rose in the east,
|
||||||
|
and Galileo happened to turn his powerful scope on its bright disk. It wasn’t
|
||||||
Then, on January 7, about an hour after sunset, Jupiter rose
|
the first time he had looked at Jupiter, but before it was with one of his
|
||||||
in the east, and Galileo happened to turn his powerful scope
|
lesser-powered telescopes. This time, though, he noticed three small but bright
|
||||||
on its bright disk. It wasn't the first time he had looked at
|
stars near the planet, two to one side and one to the other. He wondered at how
|
||||||
Jupiter, but before it was with one of his lesser-powered
|
bright the small stars were and how they were arranged in what seemed like a
|
||||||
telescopes. This time, though, he noticed three small but
|
straight line. The next night he decided to look at Jupiter again, and to his
|
||||||
bright stars near the planet, two to one side and one to the
|
surprise, the stars had moved. But not in such a way as he would expect. If
|
||||||
other. He wondered at how bright the small stars were and how
|
Jupiter was moving as it normally should, the stars would be east of Jupiter.
|
||||||
they were arranged in what seemed like a straight line. The
|
But all three were to the west! The next night was cloudy, but on January 10,
|
||||||
next night he decided to look at Jupiter again, and to his
|
Galileo was able to observe the planet again. One of the stars was gone, and the
|
||||||
surprise, the stars had moved. But not in such a way as he
|
other two were now on the east side. As the stars moved around Jupiter on each
|
||||||
would expect. If Jupiter was moving as it normally should, the
|
succeeding night, and were finally joined by a fourth star, it dawned on Galileo
|
||||||
stars would be east of Jupiter. But all three were to the
|
that what he had found were moons orbiting Jupiter! Almost at once he realized
|
||||||
west! The next night was cloudy, but on January 10, Galileo
|
that this was proof that not all objects orbited the Earth. Here were four
|
||||||
was able to observe the planet again. One of the stars was
|
bodies that were orbiting Jupiter. One argument against the sun-centered theory
|
||||||
gone, and the other two were now on the east side. As the
|
was, if the Earth orbited the sun, wouldn’t the moon get left behind? Here he
|
||||||
stars moved around Jupiter on each succeeding night, and were
|
could see for himself that somehow, a planet could orbit the sun, and not leave
|
||||||
finally joined by a fourth star, it dawned on Galileo that
|
a moon behind!</p>
|
||||||
what he had found were moons orbiting Jupiter! Almost at once
|
</blockquote>
|
||||||
he realized that this was proof that not all objects orbited
|
|
||||||
the Earth. Here were four bodies that were orbiting
|
|
||||||
Jupiter. One argument against the sun-centered theory was, if
|
|
||||||
the Earth orbited the sun, wouldn't the moon get left behind?
|
|
||||||
Here he could see for himself that somehow, a planet could
|
|
||||||
orbit the sun, and not leave a moon behind!</code></pre>
|
|
||||||
<p>Thus we can plot Galileo’s discoveries using the following three plots:</p>
|
<p>Thus we can plot Galileo’s discoveries using the following three plots:</p>
|
||||||
<pre><code> ./rince 0 $(./dmy2jd 7.8 1 1610)
|
<pre><code> ./rince 0 $(./dmy2jd 7.8 1 1610)
|
||||||
./rince 0 $(./dmy2jd 8.8 1 1610)
|
./rince 0 $(./dmy2jd 8.8 1 1610)
|
||||||
@@ -543,7 +551,9 @@ description of the origins of Julian Days can be found at
|
|||||||
<p>This program assumes:</p>
|
<p>This program assumes:</p>
|
||||||
<ol type="1">
|
<ol type="1">
|
||||||
<li><p>The ASCII character set is used.</p></li>
|
<li><p>The ASCII character set is used.</p></li>
|
||||||
<li><p>That an enormous comet hasn’t changed the course of Jupiter (or Earth!).</p></li>
|
<li><p>That an enormous comet hasn’t changed the course of
|
||||||
|
<a href="https://science.nasa.gov/jupiter/">Jupiter</a> (or
|
||||||
|
<a href="https://science.nasa.gov/earth/">Earth</a>!).</p></li>
|
||||||
<li><p>That the date has not been specified as the gap between the
|
<li><p>That the date has not been specified as the gap between the
|
||||||
<a href="https://en.wikipedia.org/wiki/Julian_calendar">Julian</a> and
|
<a href="https://en.wikipedia.org/wiki/Julian_calendar">Julian</a> and
|
||||||
<a href="https://en.wikipedia.org/wiki/Gregorian_calendar">Gregorian</a> calendar.</p></li>
|
<a href="https://en.wikipedia.org/wiki/Gregorian_calendar">Gregorian</a> calendar.</p></li>
|
||||||
@@ -560,7 +570,7 @@ run from the surface of <a href="https://science.nasa.gov/mars/">Mars</a>.</p></
|
|||||||
<h3 id="obfuscations">Obfuscations</h3>
|
<h3 id="obfuscations">Obfuscations</h3>
|
||||||
<p>In addition to the normal obfuscations, I feel that the code contains some less
|
<p>In addition to the normal obfuscations, I feel that the code contains some less
|
||||||
common tricks. Taken through the standard rounds listed in the
|
common tricks. Taken through the standard rounds listed in the
|
||||||
<a href="../../2000/guidelines.txt">guidelines</a>, the code attempts to pass these as follows:</p>
|
<a href="../guidelines.txt">guidelines</a>, the code attempts to pass these as follows:</p>
|
||||||
<ol type="1">
|
<ol type="1">
|
||||||
<li><p>Look at the original source</p>
|
<li><p>Look at the original source</p>
|
||||||
<p>With luck, pure casual inspection should not reveal much except
|
<p>With luck, pure casual inspection should not reveal much except
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ Highly Compressed Program for Playing Hygienic Checkers
|
|||||||
### FIELD OF INVENTION
|
### FIELD OF INVENTION
|
||||||
|
|
||||||
The present invention generally relates to
|
The present invention generally relates to
|
||||||
[checkers](https://en.wikipedia.org/wiki/Checkers).
|
[Checkers](https://en.wikipedia.org/wiki/Checkers).
|
||||||
|
|
||||||
|
|
||||||
### BACKGROUND OF THE INVENTION
|
### BACKGROUND OF THE INVENTION
|
||||||
|
|||||||
@@ -424,7 +424,7 @@ author a patent he applied for. :-)</p>
|
|||||||
<p>Highly Compressed Program for Playing Hygienic Checkers</p>
|
<p>Highly Compressed Program for Playing Hygienic Checkers</p>
|
||||||
<h3 id="field-of-invention">FIELD OF INVENTION</h3>
|
<h3 id="field-of-invention">FIELD OF INVENTION</h3>
|
||||||
<p>The present invention generally relates to
|
<p>The present invention generally relates to
|
||||||
<a href="https://en.wikipedia.org/wiki/Checkers">checkers</a>.</p>
|
<a href="https://en.wikipedia.org/wiki/Checkers">Checkers</a>.</p>
|
||||||
<h3 id="background-of-the-invention">BACKGROUND OF THE INVENTION</h3>
|
<h3 id="background-of-the-invention">BACKGROUND OF THE INVENTION</h3>
|
||||||
<p>Within the field of <a href="https://en.wikipedia.org/wiki/Checkers">Checkers</a>, the
|
<p>Within the field of <a href="https://en.wikipedia.org/wiki/Checkers">Checkers</a>, the
|
||||||
problem of finding a hygienic opponent is difficult, as good opponents are
|
problem of finding a hygienic opponent is difficult, as good opponents are
|
||||||
|
|||||||
@@ -53,9 +53,7 @@ keeping the program portable between different encodings
|
|||||||
|
|
||||||
This entry displays the current time to the console, for example:
|
This entry displays the current time to the console, for example:
|
||||||
|
|
||||||
```
|
> it's just after ten 'til 6 in the evening
|
||||||
it's just after ten 'til 6 in the evening
|
|
||||||
```
|
|
||||||
|
|
||||||
FWIW, none of the compilers with which this entry was tested issued
|
FWIW, none of the compilers with which this entry was tested issued
|
||||||
any warnings or errors in compiling the source for this entry. No
|
any warnings or errors in compiling the source for this entry. No
|
||||||
@@ -79,10 +77,10 @@ Obfuscation in this entry consists of:
|
|||||||
[EBCDIC](https://en.wikipedia.org/wiki/EBCDIC) character values - this is not
|
[EBCDIC](https://en.wikipedia.org/wiki/EBCDIC) character values - this is not
|
||||||
an attempt at encryption, but rather at cross platform compatibility.
|
an attempt at encryption, but rather at cross platform compatibility.
|
||||||
* [ASCII](https://en.wikipedia.org/wiki/ASCII) character values are calculated
|
* [ASCII](https://en.wikipedia.org/wiki/ASCII) character values are calculated
|
||||||
from the EBCDIC in a particularly ugly abuse of the `?:` operator.
|
from the [EBCDIC](https://en.wikipedia.org/wiki/EBCDIC) in a particularly ugly
|
||||||
* Detection of whether to print the ASCII or EBCDIC values is done by taking the
|
abuse of the `?:` operator. Detection of whether to print the ASCII or EBCDIC
|
||||||
remainder of dividing the character `'J'` by `2` - the ASCII value of the
|
values is done by taking the remainder of dividing the character `'J'` by `2` -
|
||||||
character is even, the EBCDIC value is odd.
|
the ASCII value of the character is even, the EBCDIC value is odd.
|
||||||
* The messages to be `printf(3)`ed are determined via multiple table lookups and
|
* The messages to be `printf(3)`ed are determined via multiple table lookups and
|
||||||
bit-masked values.
|
bit-masked values.
|
||||||
* For minutes, the bit position turned on is multiplied by two to determine the
|
* For minutes, the bit position turned on is multiplied by two to determine the
|
||||||
|
|||||||
@@ -432,7 +432,9 @@ keeping the program portable between different encodings
|
|||||||
(Chinese, Japanese, Russian - anyone?) may be an entertaining task.</p>
|
(Chinese, Japanese, Russian - anyone?) may be an entertaining task.</p>
|
||||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||||
<p>This entry displays the current time to the console, for example:</p>
|
<p>This entry displays the current time to the console, for example:</p>
|
||||||
<pre><code> it's just after ten 'til 6 in the evening</code></pre>
|
<blockquote>
|
||||||
|
<p>it’s just after ten ’til 6 in the evening</p>
|
||||||
|
</blockquote>
|
||||||
<p>FWIW, none of the compilers with which this entry was tested issued
|
<p>FWIW, none of the compilers with which this entry was tested issued
|
||||||
any warnings or errors in compiling the source for this entry. No
|
any warnings or errors in compiling the source for this entry. No
|
||||||
doubt lint will complain about the goto statements.</p>
|
doubt lint will complain about the goto statements.</p>
|
||||||
@@ -451,10 +453,10 @@ deficiency.</p>
|
|||||||
<a href="https://en.wikipedia.org/wiki/EBCDIC">EBCDIC</a> character values - this is not
|
<a href="https://en.wikipedia.org/wiki/EBCDIC">EBCDIC</a> character values - this is not
|
||||||
an attempt at encryption, but rather at cross platform compatibility.</li>
|
an attempt at encryption, but rather at cross platform compatibility.</li>
|
||||||
<li><a href="https://en.wikipedia.org/wiki/ASCII">ASCII</a> character values are calculated
|
<li><a href="https://en.wikipedia.org/wiki/ASCII">ASCII</a> character values are calculated
|
||||||
from the EBCDIC in a particularly ugly abuse of the <code>?:</code> operator.</li>
|
from the <a href="https://en.wikipedia.org/wiki/EBCDIC">EBCDIC</a> in a particularly ugly
|
||||||
<li>Detection of whether to print the ASCII or EBCDIC values is done by taking the
|
abuse of the <code>?:</code> operator. Detection of whether to print the ASCII or EBCDIC
|
||||||
remainder of dividing the character <code>'J'</code> by <code>2</code> - the ASCII value of the
|
values is done by taking the remainder of dividing the character <code>'J'</code> by <code>2</code> -
|
||||||
character is even, the EBCDIC value is odd.</li>
|
the ASCII value of the character is even, the EBCDIC value is odd.</li>
|
||||||
<li>The messages to be <code>printf(3)</code>ed are determined via multiple table lookups and
|
<li>The messages to be <code>printf(3)</code>ed are determined via multiple table lookups and
|
||||||
bit-masked values.</li>
|
bit-masked values.</li>
|
||||||
<li>For minutes, the bit position turned on is multiplied by two to determine the
|
<li>For minutes, the bit position turned on is multiplied by two to determine the
|
||||||
|
|||||||
@@ -4,16 +4,16 @@
|
|||||||
make alt
|
make alt
|
||||||
```
|
```
|
||||||
|
|
||||||
NOTE: if you don't have curses or SDL1 installed both modes will fail to compile. In
|
**NOTE**: if you don't have curses or SDL1 installed both modes will fail to compile. In
|
||||||
that case see the
|
that case see the
|
||||||
FAQ on "[SDL1 and SDL2](../../faq.html#SDL)"
|
FAQ on "[SDL1 and SDL2](../../faq.html#SDL)"
|
||||||
and the
|
and the
|
||||||
FAQ on "[ncurses](../../faq.html#curses)"
|
FAQ on "[(n)curses](../../faq.html#curses)"
|
||||||
for more information.
|
for more information.
|
||||||
|
|
||||||
We recommend that you use the alternate code so you can see what this entry
|
We recommend that you use the alternate code so you can see what this entry
|
||||||
looked like back in 2000 (with a configurable speed). See the
|
looked like back in 2000 (with a configurable speed). See the
|
||||||
[original code](#original-code) section for the original entry.
|
[Original code](#original-code) section for the original entry.
|
||||||
|
|
||||||
|
|
||||||
## To use:
|
## To use:
|
||||||
@@ -64,14 +64,14 @@ in the same command.
|
|||||||
|
|
||||||
## Original code:
|
## Original code:
|
||||||
|
|
||||||
WARNING: if you are sensitive to rapid movement or if you want to see better
|
**WARNING**: if you are sensitive to rapid movement or if you want to see better
|
||||||
what is going on then please use the alternate code as described above. If you
|
what is going on then please use the [Alternate code](#to-build) as described above. If you
|
||||||
wish to see the original entry see below.
|
wish to see the original entry see below.
|
||||||
|
|
||||||
NOTE: in curses mode you might want to type `reset` after execution of this
|
**NOTE**: in curses mode you might want to type `reset` after execution of this
|
||||||
program if your terminal is messed up after exiting the program (send intr,
|
program if your terminal is messed up after exiting the program (send intr,
|
||||||
typically ctrl-c) as the program does not call `endwin()`. Using `reset` will
|
typically ctrl-c) as the program does not call `endwin()`. Using `reset` will
|
||||||
clear the screen. The alternate code, as noted above, allows one to quit early so this
|
clear the screen. The [Alternate code](#to-build), as noted above, allows one to quit early so this
|
||||||
is not a problem there.
|
is not a problem there.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -414,15 +414,15 @@ Location: <a href="../../location.html#GB">GB</a> - <em>United Kingdom of Great
|
|||||||
<!-- BEFORE: 1st line of markdown file: 2000/thadgavin/README.md -->
|
<!-- BEFORE: 1st line of markdown file: 2000/thadgavin/README.md -->
|
||||||
<h2 id="to-build">To build:</h2>
|
<h2 id="to-build">To build:</h2>
|
||||||
<pre><code> make alt</code></pre>
|
<pre><code> make alt</code></pre>
|
||||||
<p>NOTE: if you don’t have curses or SDL1 installed both modes will fail to compile. In
|
<p><strong>NOTE</strong>: if you don’t have curses or SDL1 installed both modes will fail to compile. In
|
||||||
that case see the
|
that case see the
|
||||||
FAQ on “<a href="../../faq.html#SDL">SDL1 and SDL2</a>”
|
FAQ on “<a href="../../faq.html#SDL">SDL1 and SDL2</a>”
|
||||||
and the
|
and the
|
||||||
FAQ on “<a href="../../faq.html#curses">ncurses</a>”
|
FAQ on “<a href="../../faq.html#curses">(n)curses</a>”
|
||||||
for more information.</p>
|
for more information.</p>
|
||||||
<p>We recommend that you use the alternate code so you can see what this entry
|
<p>We recommend that you use the alternate code so you can see what this entry
|
||||||
looked like back in 2000 (with a configurable speed). See the
|
looked like back in 2000 (with a configurable speed). See the
|
||||||
<a href="#original-code">original code</a> section for the original entry.</p>
|
<a href="#original-code">Original code</a> section for the original entry.</p>
|
||||||
<h2 id="to-use">To use:</h2>
|
<h2 id="to-use">To use:</h2>
|
||||||
<pre><code> ./thadgavin.alt</code></pre>
|
<pre><code> ./thadgavin.alt</code></pre>
|
||||||
<p>You can press ‘q’ at any time to exit.</p>
|
<p>You can press ‘q’ at any time to exit.</p>
|
||||||
@@ -446,13 +446,13 @@ microseconds) for the SDL version.</p>
|
|||||||
it’s better to not tie the two values together. You may of course redefine both
|
it’s better to not tie the two values together. You may of course redefine both
|
||||||
in the same command.</p>
|
in the same command.</p>
|
||||||
<h2 id="original-code">Original code:</h2>
|
<h2 id="original-code">Original code:</h2>
|
||||||
<p>WARNING: if you are sensitive to rapid movement or if you want to see better
|
<p><strong>WARNING</strong>: if you are sensitive to rapid movement or if you want to see better
|
||||||
what is going on then please use the alternate code as described above. If you
|
what is going on then please use the <a href="#to-build">Alternate code</a> as described above. If you
|
||||||
wish to see the original entry see below.</p>
|
wish to see the original entry see below.</p>
|
||||||
<p>NOTE: in curses mode you might want to type <code>reset</code> after execution of this
|
<p><strong>NOTE</strong>: in curses mode you might want to type <code>reset</code> after execution of this
|
||||||
program if your terminal is messed up after exiting the program (send intr,
|
program if your terminal is messed up after exiting the program (send intr,
|
||||||
typically ctrl-c) as the program does not call <code>endwin()</code>. Using <code>reset</code> will
|
typically ctrl-c) as the program does not call <code>endwin()</code>. Using <code>reset</code> will
|
||||||
clear the screen. The alternate code, as noted above, allows one to quit early so this
|
clear the screen. The <a href="#to-build">Alternate code</a>, as noted above, allows one to quit early so this
|
||||||
is not a problem there.</p>
|
is not a problem there.</p>
|
||||||
<h3 id="original-build">Original build:</h3>
|
<h3 id="original-build">Original build:</h3>
|
||||||
<pre><code> make all</code></pre>
|
<pre><code> make all</code></pre>
|
||||||
|
|||||||
+3
-3
@@ -4,8 +4,8 @@
|
|||||||
make
|
make
|
||||||
```
|
```
|
||||||
|
|
||||||
There is an alternate version that compiles [mkentry.c](%%REPO_URL%%/2000/mkentry.c). See
|
There is an alternate version that compiles [mkentry.c](%%REPO_URL%%/2000/tomx/mkentry.c). See
|
||||||
[alternate code](#alternate-code).
|
[Alternate code](#alternate-code).
|
||||||
|
|
||||||
|
|
||||||
## To use:
|
## To use:
|
||||||
@@ -100,7 +100,7 @@ the `main()`, leaving the complexities of the C file elsewhere and making this
|
|||||||
source still acceptable to `make` and `sh`. The following modification to the
|
source still acceptable to `make` and `sh`. The following modification to the
|
||||||
last few lines will compile the IOCCC's famous [mkentry.c](%%REPO_URL%%/2000/tomx/mkentry.c).
|
last few lines will compile the IOCCC's famous [mkentry.c](%%REPO_URL%%/2000/tomx/mkentry.c).
|
||||||
|
|
||||||
```
|
``` <!---makefile-->
|
||||||
.PHONY: /* true clean */
|
.PHONY: /* true clean */
|
||||||
#undef true
|
#undef true
|
||||||
#include "mkentry.c"
|
#include "mkentry.c"
|
||||||
|
|||||||
@@ -409,8 +409,8 @@ Location: <a href="../../location.html#NL">NL</a> - <em>Kingdom of the Netherlan
|
|||||||
<!-- BEFORE: 1st line of markdown file: 2000/tomx/README.md -->
|
<!-- BEFORE: 1st line of markdown file: 2000/tomx/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>There is an alternate version that compiles <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/mkentry.c">mkentry.c</a>. See
|
<p>There is an alternate version that compiles <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2000/tomx/mkentry.c">mkentry.c</a>. See
|
||||||
<a href="#alternate-code">alternate code</a>.</p>
|
<a href="#alternate-code">Alternate code</a>.</p>
|
||||||
<h2 id="to-use">To use:</h2>
|
<h2 id="to-use">To use:</h2>
|
||||||
<pre><code> ./tomx</code></pre>
|
<pre><code> ./tomx</code></pre>
|
||||||
<h2 id="try">Try:</h2>
|
<h2 id="try">Try:</h2>
|
||||||
|
|||||||
Reference in new issue
Block a user