Fixes in html files and manifest from 2000
This commit is contained in:
1 parent
571c24ee73
commit
22931fa3eb
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`,
|
||||
`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.
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ Fourier Transform to compute this number in a reasonable amount
|
||||
of time (the usual method would take ages !).
|
||||
|
||||
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>
|
||||
<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>
|
||||
<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>
|
||||
<h2 id="authors-comments">Author’s comments:</h2>
|
||||
<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
|
||||
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
|
||||
system with a gcc compiler.</p>
|
||||
system with a <code>gcc</code> compiler.</p>
|
||||
<!--
|
||||
|
||||
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
{
|
||||
"file_path" : "lavabus.pgm",
|
||||
"inventory_order" : 100,
|
||||
"OK_to_edit" : true,
|
||||
"OK_to_edit" : false,
|
||||
"display_as" : "image",
|
||||
"display_via_github" : false,
|
||||
"entry_text" : "Kilauea volcano bus trapped in lava"
|
||||
@@ -44,7 +44,7 @@
|
||||
{
|
||||
"file_path" : "michael.pgm",
|
||||
"inventory_order" : 100,
|
||||
"OK_to_edit" : true,
|
||||
"OK_to_edit" : false,
|
||||
"display_as" : "image",
|
||||
"display_via_github" : false,
|
||||
"entry_text" : "image of author’s godchild and nephew"
|
||||
@@ -60,7 +60,7 @@
|
||||
{
|
||||
"file_path" : "lenna.glic",
|
||||
"inventory_order" : 150,
|
||||
"OK_to_edit" : true,
|
||||
"OK_to_edit" : false,
|
||||
"display_as" : "binary",
|
||||
"display_via_github" : false,
|
||||
"entry_text" : "P10 scan of 1972 Playboy centerfold"
|
||||
|
||||
+17
-17
@@ -14,7 +14,7 @@
|
||||
|
||||
## Try:
|
||||
|
||||
In a video window (white text on black background):
|
||||
In a terminal window (white text on black background):
|
||||
|
||||
``` <!---sh-->
|
||||
./try.sh
|
||||
@@ -33,7 +33,7 @@ The author recommended on linux/x86, glibc 2.0, libc4/5:
|
||||
|
||||
``` <!---make-->
|
||||
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.
|
||||
@@ -74,9 +74,9 @@ This program is called `GLICBAWLS`
|
||||
Squares".
|
||||
|
||||
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
|
||||
output a compressed version to stdout. Feed it a compressed file
|
||||
on stdin, and it will decompress it to stdout --- as either raw or
|
||||
(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
|
||||
on `stdin`, and it will decompress it to `stdout` --- as either raw or
|
||||
ASCII .PGM, depending on what format it was compressed from. For
|
||||
example:
|
||||
|
||||
@@ -215,7 +215,7 @@ In short --- running it through the preprocessor and the
|
||||
pretty-printer will give you something that looks slightly less
|
||||
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
|
||||
what is actually going on....[^0]
|
||||
what is actually going on....[^1]
|
||||
|
||||
|
||||
### 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
|
||||
pixels. However, the contribution of each pixel is weighted according to its
|
||||
[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
|
||||
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
|
||||
accordingly, the arithmetic coder/decoder updated, and the
|
||||
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]: Actually, the weight is `pow(0.8,D)/s`, where `s` is the sigma
|
||||
[^1]: Yes, this could be seen as a challenge....
|
||||
[^2]: Actually, the weight is `pow(0.8,D)/s`, where `s` is the sigma
|
||||
used for encoding/decoding the particular previous pixel. Dividing
|
||||
by `s` is a rather arbitrary action justified only by the
|
||||
improvement in results. Mathematically, I can only justify
|
||||
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
|
||||
results allows `O(1)` calculation, rather than the
|
||||
`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
|
||||
associated with them. So `glicbawls` adds a bias towards an
|
||||
averaging predictor to the equation system the least squares
|
||||
predictor is calculated from. The weight that is given to
|
||||
this bias is constantly adjusted throughout coding/decoding,
|
||||
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
|
||||
(the split points are chosen in such a way as to minimise the
|
||||
expected number of bits needed for coding). Also, the
|
||||
@@ -324,7 +324,7 @@ en/decoded[^4].
|
||||
### Photo Credit:
|
||||
|
||||
[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).
|
||||
|
||||
- [michael.pgm](michael.pgm)
|
||||
@@ -333,11 +333,11 @@ en/decoded[^4].
|
||||
|
||||
- [lavabus.pgm](lavabus.pgm)
|
||||
|
||||
A bus that was trapped by lava from [Kilauea
|
||||
volcano](https://en.wikipedia.org/wiki/Kīlauea) in Hawaii, US. Nobody was
|
||||
A bus that was trapped by lava from [Kīlauea
|
||||
volcano](https://en.wikipedia.org/wiki/Kīlauea) in Hawaii, US. Nobody was
|
||||
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
|
||||
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>
|
||||
<pre><code> ./bmeyer</code></pre>
|
||||
<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>
|
||||
<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>
|
||||
@@ -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>
|
||||
<p>The author recommended on linux/x86, glibc 2.0, libc4/5:</p>
|
||||
<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>And on linux/x86, glibc 2.1:</p>
|
||||
<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
|
||||
Squares”.</p>
|
||||
<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
|
||||
output a compressed version to stdout. Feed it a compressed file
|
||||
on stdin, and it will decompress it to stdout — as either raw or
|
||||
(either raw [i.e. P5] or ASCII [i.e. P2]) on <code>stdin</code>, and it will
|
||||
output a compressed version to <code>stdout</code>. Feed it a compressed file
|
||||
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
|
||||
example:</p>
|
||||
<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>
|
||||
<h3 id="photo-credit">Photo Credit:</h3>
|
||||
<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>
|
||||
<ul>
|
||||
<li><p><a href="michael.pgm">michael.pgm</a></p>
|
||||
<p>The author’s Godchild and nephew.</p></li>
|
||||
<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
|
||||
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
|
||||
for image compression research since then. Playboy originally threatened to
|
||||
prosecute unauthorized use, but eventually granted that, having been in use
|
||||
|
||||
@@ -28,16 +28,16 @@ You might also like to try:
|
||||
|
||||
## 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
|
||||
"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).
|
||||
|
||||
Can you find out how it stores the insult strings? Can you then take
|
||||
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
|
||||
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>
|
||||
<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
|
||||
“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>
|
||||
<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>
|
||||
<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
|
||||
and received at 9:03pm on March 21st, 2000 by Moxen N. Briddlebane.
|
||||
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
|
||||
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,
|
||||
[David Lowe](../../authors.html#J_David_Lowe) continues to inflict the highest quality "poot" on the
|
||||
Judges.
|
||||
[David Lowe](../../authors.html#J_David_Lowe) continues to inflict the highest
|
||||
quality "`poot`" on the Judges.
|
||||
|
||||
The program also contains an undocumented command for Chad and Chongo (Landon).
|
||||
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:
|
||||
|
||||
```
|
||||
p prints the top stack value without altering the stack.
|
||||
P prints the top stack value, removing it from the stack, and
|
||||
doesn't print a trailing newline.
|
||||
f prints the contents of the stack, one number per line,
|
||||
without modifying it.
|
||||
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.
|
||||
```
|
||||
- `p`
|
||||
* prints the top stack value without altering the stack.
|
||||
- `P`
|
||||
* prints the top stack value, removing it from the stack, and
|
||||
doesn't print a trailing newline.
|
||||
- `f`
|
||||
* prints the contents of the stack, one number per line,
|
||||
without modifying it.
|
||||
- `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:
|
||||
|
||||
```
|
||||
+ 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 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.
|
||||
```
|
||||
- `+`
|
||||
* 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 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
|
||||
modulus operator actually returns `(p1 - (p2 * (p1 / p2)))`, but with
|
||||
@@ -110,16 +120,16 @@ or EOF is encountered.
|
||||
|
||||
### Diagnostics:
|
||||
|
||||
```
|
||||
"stack empty" Not enough on the stack for the requested command
|
||||
"divide by zero" Attempt to divide by zero
|
||||
"unimplemented" Invalid input
|
||||
|
||||
Floating point exception (core dumped) (or something to that effect)
|
||||
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
|
||||
```
|
||||
- "stack empty"
|
||||
* Not enough on the stack for the requested command
|
||||
- "divide by zero"
|
||||
* Attempt to divide by zero
|
||||
- "unimplemented"
|
||||
* Invalid input
|
||||
- "Floating point exception (core dumped)" (or something to that effect)
|
||||
* 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.
|
||||
|
||||
|
||||
### Examples:
|
||||
@@ -244,7 +254,7 @@ possible to write (even more) obfuscated reverse Polish commands
|
||||
(I figure this explanation moves the synonyms from 'bug' to
|
||||
'feature'!)
|
||||
|
||||
. The first IOCCC entry with an "easter egg"?...
|
||||
- The first IOCCC entry with an "easter egg"?...
|
||||
|
||||
|
||||
### Aside: on unobfuscated Perl
|
||||
@@ -266,15 +276,15 @@ If you don't change the rules, it'll be embedded Ada next year!
|
||||
|
||||
### 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.
|
||||
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,
|
||||
BeOS, Concurrent, Debian, DEC OSF/1, Digital UNIX, EPOC, FreeBSD,
|
||||
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
|
||||
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,
|
||||
<a href="../../authors.html#J_David_Lowe">David Lowe</a> continues to inflict the highest quality “poot” on the
|
||||
Judges.</p>
|
||||
<a href="../../authors.html#J_David_Lowe">David Lowe</a> continues to inflict the highest
|
||||
quality “<code>poot</code>” on the Judges.</p>
|
||||
<p>The program also contains an undocumented command for Chad and Chongo (Landon).
|
||||
The judges’ remarks contain a clue to the hidden command :-).</p>
|
||||
<ul>
|
||||
@@ -445,25 +445,65 @@ calculator</a>, loosely
|
||||
based on the <code>dc(1)</code> unix calculator.</p>
|
||||
<h1 id="syntax">Syntax</h1>
|
||||
<p>This program understands the following <code>dc(1)</code> commands:</p>
|
||||
<pre><code> p prints the top stack value without altering the stack.
|
||||
P prints the top stack value, removing it from the stack, and
|
||||
doesn't print a trailing newline.
|
||||
f prints the contents of the stack, one number per line,
|
||||
without modifying it.
|
||||
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.</code></pre>
|
||||
<ul>
|
||||
<li><code>p</code>
|
||||
<ul>
|
||||
<li>prints the top stack value without altering the stack.</li>
|
||||
</ul></li>
|
||||
<li><code>P</code>
|
||||
<ul>
|
||||
<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>
|
||||
<pre><code> + 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 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.</code></pre>
|
||||
<ul>
|
||||
<li><code>+</code>
|
||||
<ul>
|
||||
<li>Pops 2 values and pushes their sum.</li>
|
||||
</ul></li>
|
||||
<li><code>-</code>
|
||||
<ul>
|
||||
<li>Pops 2 values and pushes the result of subtracting the first
|
||||
from the second.</li>
|
||||
</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
|
||||
modulus operator actually returns <code>(p1 - (p2 * (p1 / p2)))</code>, but with
|
||||
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
|
||||
or EOF is encountered.</p>
|
||||
<h3 id="diagnostics">Diagnostics:</h3>
|
||||
<pre><code> "stack empty" Not enough on the stack for the requested command
|
||||
"divide by zero" Attempt to divide by zero
|
||||
"unimplemented" Invalid input
|
||||
|
||||
Floating point exception (core dumped) (or something to that effect)
|
||||
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</code></pre>
|
||||
<ul>
|
||||
<li>“stack empty”
|
||||
<ul>
|
||||
<li>Not enough on the stack for the requested command</li>
|
||||
</ul></li>
|
||||
<li>“divide by zero”
|
||||
<ul>
|
||||
<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>
|
||||
<pre><code> $ echo '12 13 14 15 16 + + + + f' | ./dlowe
|
||||
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
|
||||
(I figure this explanation moves the synonyms from ‘bug’ to
|
||||
‘feature’!)</p></li>
|
||||
<li><p>The first IOCCC entry with an “easter egg”?…</p></li>
|
||||
</ul>
|
||||
<p>. The first IOCCC entry with an “easter egg”?…</p>
|
||||
<h3 id="aside-on-unobfuscated-perl">Aside: on unobfuscated Perl</h3>
|
||||
<p>My original intent was to write obfuscated C and crystal-clear Perl,
|
||||
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>
|
||||
<p>If you don’t change the rules, it’ll be embedded Ada next year!</p>
|
||||
<h3 id="auto-defend">Auto defend</h3>
|
||||
<p>A. Isn’t this the obfuscated C contest? What’s this Perl <code>$#_&&$_</code>?</p>
|
||||
<p>D. Hey, this program <em>is</em> 100% C, and does not exec an external Perl
|
||||
<ol start="0" type="1">
|
||||
<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.
|
||||
The “Perl code” is just a C string constant.</p>
|
||||
<p>A. Perl isn’t portable enough, or ubiquitous enough.</p>
|
||||
<p>D. I’d argue that it is more portable than X. According to the Perl
|
||||
The “Perl code” is just a C string constant.</p></li>
|
||||
<li><p>Perl isn’t portable enough, or ubiquitous enough.</p></li>
|
||||
<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,
|
||||
BeOS, Concurrent, Debian, DEC OSF/1, Digital UNIX, EPOC, FreeBSD,
|
||||
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,
|
||||
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.
|
||||
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+,
|
||||
FreeBSD 3.0+, IRIX 6.4+, every Linux distribution, NetBSD, OpenBSD, and
|
||||
DEC Tru64 5.0+, again according to the Perl people.</p>
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
{
|
||||
"file_path" : "finance.sheet",
|
||||
"inventory_order" : 4000000000,
|
||||
"OK_to_edit" : true,
|
||||
"OK_to_edit" : false,
|
||||
"display_as" : "spreadsheet",
|
||||
"display_via_github" : false,
|
||||
"entry_text" : "example spreadsheet file"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
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
|
||||
FAQ on "[X11](../../faq.html#X11)".
|
||||
|
||||
@@ -143,14 +143,14 @@ Finish the formula with `!` to create the histogram.
|
||||
#### 2.2. Starting and Loading Spreadsheets
|
||||
|
||||
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:
|
||||
|
||||
``` <!---sh-->
|
||||
./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
|
||||
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
|
||||
@@ -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`,
|
||||
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
|
||||
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
|
||||
|
||||
@@ -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 -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<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
|
||||
FAQ on “<a href="../../faq.html#X11">X11</a>”.</p>
|
||||
<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>
|
||||
<h4 id="starting-and-loading-spreadsheets">2.2. Starting and Loading Spreadsheets</h4>
|
||||
<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>
|
||||
<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
|
||||
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
|
||||
@@ -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.
|
||||
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>
|
||||
<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
|
||||
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
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ times in a day).
|
||||
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.
|
||||
|
||||
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:
|
||||
@@ -40,7 +40,7 @@ The author noted that those in the southern hemisphere might want to change
|
||||
|
||||
### Alternate build:
|
||||
|
||||
To run the alternate code that supports the southern hemisphere:
|
||||
To build the alternate code that works for the southern hemisphere:
|
||||
|
||||
``` <!---sh-->
|
||||
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>
|
||||
<pre><code> make</code></pre>
|
||||
<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>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<h3 id="alternate-use">Alternate use:</h3>
|
||||
<pre><code> ./natori.alt</code></pre>
|
||||
|
||||
+40
-45
@@ -4,7 +4,7 @@
|
||||
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
|
||||
FAQ on "[X11](../../faq.html#X11)".
|
||||
|
||||
@@ -91,20 +91,22 @@ for an example.
|
||||
|
||||
This program plots the positions of the four [Galilean
|
||||
moons](https://en.wikipedia.org/wiki/Galilean_moons) of
|
||||
[Jupiter](https://en.wikipedia.org/wiki/Jupiter), as seen from
|
||||
[Earth](https://en.wikipedia.org/wiki/Earth). It doesn't correct for your
|
||||
[Jupiter](https://science.nasa.gov/jupiter/), as seen from
|
||||
[Earth](https://science.nasa.gov/earth/). It doesn't correct for your
|
||||
location on Earth, but I assure you that the
|
||||
[parallax](https://en.wikipedia.org/wiki/Parallax#Astronomy) is minimal!
|
||||
|
||||
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:
|
||||
|
||||
```
|
||||
I Io
|
||||
II Europa
|
||||
III Ganymede
|
||||
IV Callisto
|
||||
```
|
||||
- `I`
|
||||
* [Io](https://science.nasa.gov/jupiter/moons/io)
|
||||
- `II`
|
||||
* [Europa](https://science.nasa.gov/jupiter/moons/europa/)
|
||||
- `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,
|
||||
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>
|
||||
states the following:
|
||||
|
||||
```
|
||||
By early 1610, Galileo had further improved his telescope by
|
||||
double its power, so it now enlarged objects a thousand
|
||||
times. He began looking at the stars and couldn't believe how
|
||||
many more he could now see! The number seemed infinite. He was
|
||||
beginning to realize the fixed stars weren't a flat distant
|
||||
wall on a globe, but a three-dimensional expanse bigger than
|
||||
anyone had ever thought!
|
||||
|
||||
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 the first time he had looked at
|
||||
Jupiter, but before it was with one of his lesser-powered
|
||||
telescopes. This time, though, he noticed three small but
|
||||
bright stars near the planet, two to one side and one to the
|
||||
other. He wondered at how bright the small stars were and how
|
||||
they were arranged in what seemed like a straight line. The
|
||||
next night he decided to look at Jupiter again, and to his
|
||||
surprise, the stars had moved. But not in such a way as he
|
||||
would expect. If Jupiter was moving as it normally should, the
|
||||
stars would be east of Jupiter. But all three were to the
|
||||
west! The next night was cloudy, but on January 10, Galileo
|
||||
was able to observe the planet again. One of the stars was
|
||||
gone, and the other two were now on the east side. As the
|
||||
stars moved around Jupiter on each succeeding night, and were
|
||||
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!
|
||||
```
|
||||
> By early 1610, Galileo had further improved his telescope by double its power,
|
||||
so it now enlarged objects a thousand times. He began looking at the stars and
|
||||
couldn't believe how many more he could now see! The number seemed infinite. He
|
||||
was beginning to realize the fixed stars weren't a flat distant wall on a globe,
|
||||
but a three-dimensional expanse bigger than anyone had ever thought!
|
||||
>
|
||||
> 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
|
||||
the first time he had looked at Jupiter, but before it was with one of his
|
||||
lesser-powered telescopes. This time, though, he noticed three small but bright
|
||||
stars near the planet, two to one side and one to the other. He wondered at how
|
||||
bright the small stars were and how they were arranged in what seemed like a
|
||||
straight line. The next night he decided to look at Jupiter again, and to his
|
||||
surprise, the stars had moved. But not in such a way as he would expect. If
|
||||
Jupiter was moving as it normally should, the stars would be east of Jupiter.
|
||||
But all three were to the west! The next night was cloudy, but on January 10,
|
||||
Galileo was able to observe the planet again. One of the stars was gone, and the
|
||||
other two were now on the east side. As the stars moved around Jupiter on each
|
||||
succeeding night, and were 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:
|
||||
|
||||
@@ -210,7 +203,9 @@ This program assumes:
|
||||
|
||||
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
|
||||
[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
|
||||
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
|
||||
|
||||
|
||||
+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 -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<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
|
||||
FAQ on “<a href="../../faq.html#X11">X11</a>”.</p>
|
||||
<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>
|
||||
<p>This program plots the positions of the four <a href="https://en.wikipedia.org/wiki/Galilean_moons">Galilean
|
||||
moons</a> of
|
||||
<a href="https://en.wikipedia.org/wiki/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/jupiter/">Jupiter</a>, as seen from
|
||||
<a href="https://science.nasa.gov/earth/">Earth</a>. It doesn’t correct for your
|
||||
location on Earth, but I assure you that the
|
||||
<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
|
||||
closest to the planet and <code>IV</code> being the furthest. They are:</p>
|
||||
<pre><code> I Io
|
||||
II Europa
|
||||
III Ganymede
|
||||
IV Callisto</code></pre>
|
||||
<ul>
|
||||
<li><code>I</code>
|
||||
<ul>
|
||||
<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,
|
||||
so the results can be experimentally checked. (Note that at present, the
|
||||
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.
|
||||
<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>
|
||||
<pre><code> By early 1610, Galileo had further improved his telescope by
|
||||
double its power, so it now enlarged objects a thousand
|
||||
times. He began looking at the stars and couldn't believe how
|
||||
many more he could now see! The number seemed infinite. He was
|
||||
beginning to realize the fixed stars weren't a flat distant
|
||||
wall on a globe, but a three-dimensional expanse bigger than
|
||||
anyone had ever thought!
|
||||
|
||||
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 the first time he had looked at
|
||||
Jupiter, but before it was with one of his lesser-powered
|
||||
telescopes. This time, though, he noticed three small but
|
||||
bright stars near the planet, two to one side and one to the
|
||||
other. He wondered at how bright the small stars were and how
|
||||
they were arranged in what seemed like a straight line. The
|
||||
next night he decided to look at Jupiter again, and to his
|
||||
surprise, the stars had moved. But not in such a way as he
|
||||
would expect. If Jupiter was moving as it normally should, the
|
||||
stars would be east of Jupiter. But all three were to the
|
||||
west! The next night was cloudy, but on January 10, Galileo
|
||||
was able to observe the planet again. One of the stars was
|
||||
gone, and the other two were now on the east side. As the
|
||||
stars moved around Jupiter on each succeeding night, and were
|
||||
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!</code></pre>
|
||||
<blockquote>
|
||||
<p>By early 1610, Galileo had further improved his telescope by double its power,
|
||||
so it now enlarged objects a thousand times. He began looking at the stars and
|
||||
couldn’t believe how many more he could now see! The number seemed infinite. He
|
||||
was beginning to realize the fixed stars weren’t a flat distant wall on a globe,
|
||||
but a three-dimensional expanse bigger than anyone had ever thought!</p>
|
||||
<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
|
||||
the first time he had looked at Jupiter, but before it was with one of his
|
||||
lesser-powered telescopes. This time, though, he noticed three small but bright
|
||||
stars near the planet, two to one side and one to the other. He wondered at how
|
||||
bright the small stars were and how they were arranged in what seemed like a
|
||||
straight line. The next night he decided to look at Jupiter again, and to his
|
||||
surprise, the stars had moved. But not in such a way as he would expect. If
|
||||
Jupiter was moving as it normally should, the stars would be east of Jupiter.
|
||||
But all three were to the west! The next night was cloudy, but on January 10,
|
||||
Galileo was able to observe the planet again. One of the stars was gone, and the
|
||||
other two were now on the east side. As the stars moved around Jupiter on each
|
||||
succeeding night, and were 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!</p>
|
||||
</blockquote>
|
||||
<p>Thus we can plot Galileo’s discoveries using the following three plots:</p>
|
||||
<pre><code> ./rince 0 $(./dmy2jd 7.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>
|
||||
<ol type="1">
|
||||
<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
|
||||
<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>
|
||||
@@ -560,7 +570,7 @@ run from the surface of <a href="https://science.nasa.gov/mars/">Mars</a>.</p></
|
||||
<h3 id="obfuscations">Obfuscations</h3>
|
||||
<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
|
||||
<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">
|
||||
<li><p>Look at the original source</p>
|
||||
<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
|
||||
|
||||
The present invention generally relates to
|
||||
[checkers](https://en.wikipedia.org/wiki/Checkers).
|
||||
[Checkers](https://en.wikipedia.org/wiki/Checkers).
|
||||
|
||||
|
||||
### BACKGROUND OF THE INVENTION
|
||||
|
||||
@@ -424,7 +424,7 @@ author a patent he applied for. :-)</p>
|
||||
<p>Highly Compressed Program for Playing Hygienic Checkers</p>
|
||||
<h3 id="field-of-invention">FIELD OF INVENTION</h3>
|
||||
<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>
|
||||
<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
|
||||
|
||||
@@ -53,9 +53,7 @@ keeping the program portable between different encodings
|
||||
|
||||
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
|
||||
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
|
||||
an attempt at encryption, but rather at cross platform compatibility.
|
||||
* [ASCII](https://en.wikipedia.org/wiki/ASCII) character values are calculated
|
||||
from the EBCDIC in a particularly ugly abuse of the `?:` operator.
|
||||
* Detection of whether to print the ASCII or EBCDIC values is done by taking the
|
||||
remainder of dividing the character `'J'` by `2` - the ASCII value of the
|
||||
character is even, the EBCDIC value is odd.
|
||||
from the [EBCDIC](https://en.wikipedia.org/wiki/EBCDIC) in a particularly ugly
|
||||
abuse of the `?:` operator. Detection of whether to print the ASCII or EBCDIC
|
||||
values is done by taking the remainder of dividing the character `'J'` by `2` -
|
||||
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
|
||||
bit-masked values.
|
||||
* 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>
|
||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||
<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
|
||||
any warnings or errors in compiling the source for this entry. No
|
||||
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
|
||||
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
|
||||
from the EBCDIC in a particularly ugly abuse of the <code>?:</code> operator.</li>
|
||||
<li>Detection of whether to print the ASCII or EBCDIC values is done by taking the
|
||||
remainder of dividing the character <code>'J'</code> by <code>2</code> - the ASCII value of the
|
||||
character is even, the EBCDIC value is odd.</li>
|
||||
from the <a href="https://en.wikipedia.org/wiki/EBCDIC">EBCDIC</a> in a particularly ugly
|
||||
abuse of the <code>?:</code> operator. Detection of whether to print the ASCII or EBCDIC
|
||||
values is done by taking the remainder of dividing the character <code>'J'</code> by <code>2</code> -
|
||||
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
|
||||
bit-masked values.</li>
|
||||
<li>For minutes, the bit position turned on is multiplied by two to determine the
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
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
|
||||
FAQ on "[SDL1 and SDL2](../../faq.html#SDL)"
|
||||
and the
|
||||
FAQ on "[ncurses](../../faq.html#curses)"
|
||||
FAQ on "[(n)curses](../../faq.html#curses)"
|
||||
for more information.
|
||||
|
||||
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
|
||||
[original code](#original-code) section for the original entry.
|
||||
[Original code](#original-code) section for the original entry.
|
||||
|
||||
|
||||
## To use:
|
||||
@@ -64,14 +64,14 @@ in the same command.
|
||||
|
||||
## Original code:
|
||||
|
||||
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
|
||||
**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](#to-build) as described above. If you
|
||||
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,
|
||||
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.
|
||||
|
||||
|
||||
|
||||
@@ -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 -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<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
|
||||
FAQ on “<a href="../../faq.html#SDL">SDL1 and SDL2</a>”
|
||||
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>
|
||||
<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
|
||||
<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>
|
||||
<pre><code> ./thadgavin.alt</code></pre>
|
||||
<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
|
||||
in the same command.</p>
|
||||
<h2 id="original-code">Original code:</h2>
|
||||
<p>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
|
||||
<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 <a href="#to-build">Alternate code</a> as described above. If you
|
||||
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,
|
||||
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>
|
||||
<h3 id="original-build">Original build:</h3>
|
||||
<pre><code> make all</code></pre>
|
||||
|
||||
+3
-3
@@ -4,8 +4,8 @@
|
||||
make
|
||||
```
|
||||
|
||||
There is an alternate version that compiles [mkentry.c](%%REPO_URL%%/2000/mkentry.c). See
|
||||
[alternate code](#alternate-code).
|
||||
There is an alternate version that compiles [mkentry.c](%%REPO_URL%%/2000/tomx/mkentry.c). See
|
||||
[Alternate code](#alternate-code).
|
||||
|
||||
|
||||
## 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
|
||||
last few lines will compile the IOCCC's famous [mkentry.c](%%REPO_URL%%/2000/tomx/mkentry.c).
|
||||
|
||||
```
|
||||
``` <!---makefile-->
|
||||
.PHONY: /* true clean */
|
||||
#undef true
|
||||
#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 -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<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
|
||||
<a href="#alternate-code">alternate code</a>.</p>
|
||||
<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>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<pre><code> ./tomx</code></pre>
|
||||
<h2 id="try">Try:</h2>
|
||||
|
||||
Reference in new issue
Block a user