Merge pull request #2697 from xexyl/html2018

This commit is contained in:
Landon Curt Noll authored and GitHub committed 2024-10-15 15:36:19 -07:00
commit 96c5652954
21 files changed
+493 -604

No files matched your search

+5 -1
View File
@@ -81,7 +81,11 @@ from hearing. But even without training you can easily read along with the
printed characters and have the sound make sense with the look of the printed characters and have the sound make sense with the look of the
characters. characters.
See image [spectrogram.png](spectrogram.png) for an example spectrogram. See image [spectrogram.png](spectrogram.png) for an example spectrogram:
<img src="spectrogram.png"
alt="example spectrogram"
width=748 height=400>
### Limitations ### Limitations
+4 -1
View File
@@ -457,7 +457,10 @@ could listen to a cacophony of chirpy characters.</p>
from hearing. But even without training you can easily read along with the from hearing. But even without training you can easily read along with the
printed characters and have the sound make sense with the look of the printed characters and have the sound make sense with the look of the
characters.</p> characters.</p>
<p>See image <a href="spectrogram.png">spectrogram.png</a> for an example spectrogram.</p> <p>See image <a href="spectrogram.png">spectrogram.png</a> for an example spectrogram:</p>
<p><img src="spectrogram.png"
alt="example spectrogram"
width=748 height=400></p>
<h3 id="limitations">Limitations</h3> <h3 id="limitations">Limitations</h3>
<p>There is no error checking done when opening files, so expect segfaults if you <p>There is no error checking done when opening files, so expect segfaults if you
provide the wrong path to a file.</p> provide the wrong path to a file.</p>
+7 -10
View File
@@ -51,7 +51,7 @@ One line, one array, one loop and one statement but it prints many bytes. It won
Feed this anything on `stdin`. Feed this anything on `stdin`.
The [included script.sh](%%REPO_URL%%/2018/burton1/scripthd.sh) may be used as a driver program for this entry. The included [scripthd.sh](%%REPO_URL%%/2018/burton1/scripthd.sh) may be used as a driver program for this entry.
It adds several nice-to-have features, and allows salt-to-taste customizability. It adds several nice-to-have features, and allows salt-to-taste customizability.
This code has been compiled and tested on: This code has been compiled and tested on:
@@ -227,15 +227,12 @@ It pre-dates `varargs.h`, and assembly was the only way to gain access to the
variable argument types. The first edition _The C Programming Language_, 1978, variable argument types. The first edition _The C Programming Language_, 1978,
page 71, remarks: page 71, remarks:
``` > By the way, there is no entirely satisfactory way to write a portable function
By the way, there is no entirely satisfactory way to write a portable function that accepts a variable number of arguments, because there is no portable way
that accepts a variable number of arguments, because there is no portable way for the called function to determine how many arguments where actually passed to
for the called function to determine how many arguments where actually passed it in a given call. ... `printf`, the most common C function with a variable
to it in a given call. number of arguments, ... is also non-portable and must be modified for different
... environments.
`printf`, the most common C function with a variable number of arguments,
... is also non-portable and must be modified for different environments.
```
It is fascinating to explore the roots of C through the history of the operating It is fascinating to explore the roots of C through the history of the operating
system it was birthed within. C is often criticized as a difficult, inscrutable system it was birthed within. C is often criticized as a difficult, inscrutable
+9 -8
View File
@@ -429,7 +429,7 @@ with <code>-Wno-</code> options.</p>
<p>One line, one array, one loop and one statement but it prints many bytes. It won.</p> <p>One line, one array, one loop and one statement but it prints many bytes. It won.</p>
<h2 id="authors-remarks">Author’s remarks:</h2> <h2 id="authors-remarks">Author’s remarks:</h2>
<p>Feed this anything on <code>stdin</code>.</p> <p>Feed this anything on <code>stdin</code>.</p>
<p>The <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/burton1/scripthd.sh">included script.sh</a> may be used as a driver program for this entry. <p>The included <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/burton1/scripthd.sh">scripthd.sh</a> may be used as a driver program for this entry.
It adds several nice-to-have features, and allows salt-to-taste customizability.</p> It adds several nice-to-have features, and allows salt-to-taste customizability.</p>
<p>This code has been compiled and tested on:</p> <p>This code has been compiled and tested on:</p>
<ul> <ul>
@@ -559,13 +559,14 @@ shortest code that compiles and runs correctly in Ancient UNIX.</p>
It pre-dates <code>varargs.h</code>, and assembly was the only way to gain access to the It pre-dates <code>varargs.h</code>, and assembly was the only way to gain access to the
variable argument types. The first edition <em>The C Programming Language</em>, 1978, variable argument types. The first edition <em>The C Programming Language</em>, 1978,
page 71, remarks:</p> page 71, remarks:</p>
<pre><code> By the way, there is no entirely satisfactory way to write a portable function <blockquote>
that accepts a variable number of arguments, because there is no portable way <p>By the way, there is no entirely satisfactory way to write a portable function
for the called function to determine how many arguments where actually passed that accepts a variable number of arguments, because there is no portable way
to it in a given call. for the called function to determine how many arguments where actually passed to
... it in a given call. … <code>printf</code>, the most common C function with a variable
`printf`, the most common C function with a variable number of arguments, number of arguments, … is also non-portable and must be modified for different
... is also non-portable and must be modified for different environments.</code></pre> environments.</p>
</blockquote>
<p>It is fascinating to explore the roots of C through the history of the operating <p>It is fascinating to explore the roots of C through the history of the operating
system it was birthed within. C is often criticized as a difficult, inscrutable system it was birthed within. C is often criticized as a difficult, inscrutable
language, but as this contest demonstrates, this is in parody. <em>Shell-gol</em> is language, but as this contest demonstrates, this is in parody. <em>Shell-gol</em> is
+1 -1
View File
@@ -5,7 +5,7 @@
``` ```
There is an alternate version that lacks a useful bug fix. See [Alternate There is an alternate version that lacks a useful bug fix. See [Alternate
code](#alternate-code) and the author's remarks, [remarks section](#remarks), code](#alternate-code) and the author's remarks' [remarks section](#remarks),
below for more details. below for more details.
+1 -1
View File
@@ -411,7 +411,7 @@ Location: <a href="../../location.html#PL">PL</a> - <em>Republic of Poland</em>
<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 lacks a useful bug fix. See <a href="#alternate-code">Alternate <p>There is an alternate version that lacks a useful bug fix. See <a href="#alternate-code">Alternate
code</a> and the author’s remarks, <a href="#remarks">remarks section</a>, code</a> and the author’s remarks’ <a href="#remarks">remarks section</a>,
below for more details.</p> below for more details.</p>
<h2 id="to-use">To use:</h2> <h2 id="to-use">To use:</h2>
<pre><code> ./prog &lt; text</code></pre> <pre><code> ./prog &lt; text</code></pre>
+3 -3
View File
@@ -33,7 +33,7 @@ This is an EX-tremely obfuscated program!
A high-context work that combines parrots that new hackers like and parrots that A high-context work that combines parrots that new hackers like and parrots that
old hackers like. One is an internet meme called [Party old hackers like. One is an internet meme called [Party
Parrot](https://cultofthepartyparrot.com) (WARNING: has flashing lights). The other is a Parrot](https://cultofthepartyparrot.com) (**WARNING**: has flashing lights). The other is a
sketch [comté](https://en.wikipedia.org/wiki/Comté_cheese) called ["Dead sketch [comté](https://en.wikipedia.org/wiki/Comté_cheese) called ["Dead
Parrot"](https://en.wikipedia.org/wiki/Dead_Parrot_sketch) from the British Parrot"](https://en.wikipedia.org/wiki/Dead_Parrot_sketch) from the British
sitcom ["Monty Python's Flying Circus"](https://en.wikipedia.org/wiki/Monty_Python%27s_Flying_Circus) sitcom ["Monty Python's Flying Circus"](https://en.wikipedia.org/wiki/Monty_Python%27s_Flying_Circus)
@@ -44,8 +44,8 @@ The "_Python_" in the award name refers to Monty Python, **not** the
The shape of [prog.c](%%REPO_URL%%/2018/endoh2/prog.c) is "Undead Parrot" based on "dead parrot". The The shape of [prog.c](%%REPO_URL%%/2018/endoh2/prog.c) is "Undead Parrot" based on "dead parrot". The
message that appears in the bottom line of the output source code is the subject message that appears in the bottom line of the output source code is the subject
of the dialogue that appears in "Dead Parrot" and explains in various of the dialogue that appears in "Dead Parrot" and explains in various
expressions that the parrot died. Also, the second **__<-_Source_of_Parrots__** expressions that the parrot died. Also, the second `__<-_Source_of_Parrots__`
line from the bottom of <http://cultofthepartyparrot.com/> (WARNING: has line from the bottom of <http://cultofthepartyparrot.com/> (**WARNING**: has
flashing lights) has a hidden URL (hidden by the parrot's body). flashing lights) has a hidden URL (hidden by the parrot's body).
Although it is a boring Quine story, it is quite difficult to have 10 parrot Although it is a boring Quine story, it is quite difficult to have 10 parrot
+3 -3
View File
@@ -423,7 +423,7 @@ This is an EX-tremely obfuscated program!</p>
<h2 id="authors-remarks">Author’s remarks:</h2> <h2 id="authors-remarks">Author’s remarks:</h2>
<p>A high-context work that combines parrots that new hackers like and parrots that <p>A high-context work that combines parrots that new hackers like and parrots that
old hackers like. One is an internet meme called <a href="https://cultofthepartyparrot.com">Party old hackers like. One is an internet meme called <a href="https://cultofthepartyparrot.com">Party
Parrot</a> (WARNING: has flashing lights). The other is a Parrot</a> (<strong>WARNING</strong>: has flashing lights). The other is a
sketch <a href="https://en.wikipedia.org/wiki/Comté_cheese">comté</a> called <a href="https://en.wikipedia.org/wiki/Dead_Parrot_sketch">“Dead sketch <a href="https://en.wikipedia.org/wiki/Comté_cheese">comté</a> called <a href="https://en.wikipedia.org/wiki/Dead_Parrot_sketch">“Dead
Parrot”</a> from the British Parrot”</a> from the British
sitcom <a href="https://en.wikipedia.org/wiki/Monty_Python%27s_Flying_Circus">“Monty Python’s Flying Circus”</a> sitcom <a href="https://en.wikipedia.org/wiki/Monty_Python%27s_Flying_Circus">“Monty Python’s Flying Circus”</a>
@@ -433,8 +433,8 @@ The “<em>Python</em>” in the award name refers to Monty Python, <strong>not<
<p>The shape of <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/endoh2/prog.c">prog.c</a> is “Undead Parrot” based on “dead parrot”. The <p>The shape of <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/endoh2/prog.c">prog.c</a> is “Undead Parrot” based on “dead parrot”. The
message that appears in the bottom line of the output source code is the subject message that appears in the bottom line of the output source code is the subject
of the dialogue that appears in “Dead Parrot” and explains in various of the dialogue that appears in “Dead Parrot” and explains in various
expressions that the parrot died. Also, the second **__&lt;-_Source_of_Parrots__** expressions that the parrot died. Also, the second <code>__&lt;-_Source_of_Parrots__</code>
line from the bottom of <a href="http://cultofthepartyparrot.com/" class="uri">http://cultofthepartyparrot.com/</a> (WARNING: has line from the bottom of <a href="http://cultofthepartyparrot.com/" class="uri">http://cultofthepartyparrot.com/</a> (<strong>WARNING</strong>: has
flashing lights) has a hidden URL (hidden by the parrot’s body).</p> flashing lights) has a hidden URL (hidden by the parrot’s body).</p>
<p>Although it is a boring Quine story, it is quite difficult to have 10 parrot <p>Although it is a boring Quine story, it is quite difficult to have 10 parrot
pictures and 10 lines of data. Only the outline data of the parrot picture is pictures and 10 lines of data. Only the outline data of the parrot picture is
+7 -37
View File
@@ -393,15 +393,15 @@
<ul> <ul>
<li><a href="prog.c">prog.c</a> <li><a href="prog.c">prog.c</a>
<ul> <ul>
<li>This is the source file to the <code>weasel</code> program [1].</li> <li>This is the source file to the <code>weasel</code> program.</li>
</ul></li> </ul></li>
<li><a href="prog.alt.c">prog.alt.c</a> <li><a href="prog.alt.c">prog.alt.c</a>
<ul> <ul>
<li>This is the source code file to the <code>weasel.alt</code> program [1].</li> <li>This is the source code file to the <code>weasel.alt</code> program.</li>
</ul></li> </ul></li>
<li><a href="test.sh">test.sh</a> <li><a href="test.sh">test.sh</a>
<ul> <ul>
<li>Script provided to test the weasel program [1].</li> <li>Script provided to test the weasel program.</li>
</ul></li> </ul></li>
<li><a href="test-strings.txt">test-strings.txt</a> <li><a href="test-strings.txt">test-strings.txt</a>
<ul> <ul>
@@ -412,24 +412,17 @@ target strings.</li>
<ul> <ul>
<li>The Makefile that simplifies compilation as well as providing some deep <li>The Makefile that simplifies compilation as well as providing some deep
magic and other things designed by the IOCCC judges. There’s also a <code>make test</code> target that runs the <code>test.sh</code> script. The index.html file shows how magic and other things designed by the IOCCC judges. There’s also a <code>make test</code> target that runs the <code>test.sh</code> script. The index.html file shows how
to pass options to the script itself [1].</li> to pass options to the script itself.</li>
</ul></li> </ul></li>
<li><a href="weasel.1">weasel.1</a> <li><a href="weasel.1">weasel.1</a>
<ul> <ul>
<li>The man page for weasel.</li> <li>The man page for weasel.</li>
</ul></li> </ul></li>
<li><a href="README.md">README.md</a> <li><a href="rpm.html">rpm.html</a>
<ul> <ul>
<li>The source of the index.html file [3].</li> <li>This file briefly answers ‘why’ I submitted an rpm spec file.</li>
</ul></li> </ul></li>
<li><a href="rpm.md">rpm.md</a> <li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/ferguson/weasel.spec">weasel.spec</a>
<ul>
<li>This file briefly answers ‘why’ I submitted an rpm spec file ‘weasel.spec’
as well as the possibility of building the RPM for others (despite the fact
I am confident that I’m the only one who would make use of it). This file
isn’t included in the RPM itself; it remains only on the IOCCC website.</li>
</ul></li>
<li><a href="weasel.spec">weasel.spec</a>
<ul> <ul>
<li>The RPM spec file for building the RPM. This is specific to the entry on <li>The RPM spec file for building the RPM. This is specific to the entry on
the IOCCC website but would also be available in the source rpm file if it the IOCCC website but would also be available in the source rpm file if it
@@ -439,30 +432,7 @@ was built.</li>
<ul> <ul>
<li>This web page.</li> <li>This web page.</li>
</ul></li> </ul></li>
<li><a href="FILES.md">FILES.md</a>
<ul>
<li>The markdown source file for <a href="FILES.html">FILES.html</a></li>
</ul></li>
</ul> </ul>
<h2 id="footnote">Footnote</h2>
<p>The follow footnotes are for if the weasel program is installed into the
system via the RPM file (that can be built by say <code>rpmbuild -bb weasel.spec</code> on
an RPM linux system).</p>
<p>As I noted before it was primarily personal reasons that I submitted the spec
file. Years later I thought of removing it but since I quite enjoyed the judges’
remarks I have kept it in place. Please note that the paths below are dependent
on the prefix used in installation; where I suggest <code>/usr</code> it is equally
possible it could be under ‘/usr/local’, for example.</p>
<p>[1] Note that <a href="prog.c">prog.c</a> and
<a href="prog.alt.c">prog.alt.c</a> would be
linked to <code>weasel.c</code> and <code>weasel.alt.c</code>
(respectively) in the <code>/usr/src/weasel</code>
subdirectory.</p>
<p>[2] The file would most likely be compressed as
<code>weasel.1.gz</code> under the <code>/usr/share/man/man1</code>
subdirectory.</p>
<p>[3] These files would be in the <code>/usr/share/doc/weasel</code>
subdirectory.</p>
<hr style="width:10%;text-align:left;margin-left:0"> <hr style="width:10%;text-align:left;margin-left:0">
<p>Jump to: <a href="#">top</a></p> <p>Jump to: <a href="#">top</a></p>
<!-- <!--
+7 -42
View File
@@ -1,64 +1,29 @@
# List of files in this entry with a brief description # List of files in this entry with a brief description
- [prog.c](prog.c) - [prog.c](prog.c)
* This is the source file to the `weasel` program [1]. * This is the source file to the `weasel` program.
- [prog.alt.c](prog.alt.c) - [prog.alt.c](prog.alt.c)
* This is the source code file to the `weasel.alt` program [1]. * This is the source code file to the `weasel.alt` program.
- [test.sh](test.sh) - [test.sh](test.sh)
* Script provided to test the weasel program [1]. * Script provided to test the weasel program.
- [test-strings.txt](test-strings.txt) - [test-strings.txt](test-strings.txt)
* The `test.sh` script reads from this file and runs the program with these * The `test.sh` script reads from this file and runs the program with these
target strings. target strings.
- [Makefile](Makefile) - [Makefile](Makefile)
* The Makefile that simplifies compilation as well as providing some deep * The Makefile that simplifies compilation as well as providing some deep
magic and other things designed by the IOCCC judges. There's also a `make magic and other things designed by the IOCCC judges. There's also a `make
test` target that runs the `test.sh` script. The index.html file shows how test` target that runs the `test.sh` script. The index.html file shows how
to pass options to the script itself [1]. to pass options to the script itself.
- [weasel.1](weasel.1) - [weasel.1](weasel.1)
* The man page for weasel. * The man page for weasel.
- [README.md](README.md) - [rpm.html](rpm.html)
* The source of the index.html file [3]. * This file briefly answers 'why' I submitted an rpm spec file.
- [rpm.md](rpm.md) - [weasel.spec](%%REPO_URL%%/2018/ferguson/weasel.spec)
* This file briefly answers 'why' I submitted an rpm spec file 'weasel.spec'
as well as the possibility of building the RPM for others (despite the fact
I am confident that I'm the only one who would make use of it). This file
isn't included in the RPM itself; it remains only on the IOCCC website.
- [weasel.spec](weasel.spec)
* The RPM spec file for building the RPM. This is specific to the entry on * The RPM spec file for building the RPM. This is specific to the entry on
the IOCCC website but would also be available in the source rpm file if it the IOCCC website but would also be available in the source rpm file if it
was built. was built.
- [FILES.html](FILES.html) - [FILES.html](FILES.html)
* This web page. * This web page.
- [FILES.md](FILES.md)
* The markdown source file for [FILES.html](FILES.html)
## Footnote
The follow footnotes are for if the weasel program is installed into the
system via the RPM file (that can be built by say `rpmbuild -bb weasel.spec` on
an RPM linux system).
As I noted before it was primarily personal reasons that I submitted the spec
file. Years later I thought of removing it but since I quite enjoyed the judges'
remarks I have kept it in place. Please note that the paths below are dependent
on the prefix used in installation; where I suggest `/usr` it is equally
possible it could be under '/usr/local', for example.
[1] Note that [prog.c](prog.c) and
[prog.alt.c](prog.alt.c) would be
linked to `weasel.c` and `weasel.alt.c`
(respectively) in the `/usr/src/weasel`
subdirectory.
[2] The file would most likely be compressed as
`weasel.1.gz` under the `/usr/share/man/man1`
subdirectory.
[3] These files would be in the `/usr/share/doc/weasel`
subdirectory.
<hr style="width:10%;text-align:left;margin-left:0"> <hr style="width:10%;text-align:left;margin-left:0">
+2 -2
View File
@@ -129,7 +129,7 @@ PROG= prog
# #
OBJ= ${PROG}.o OBJ= ${PROG}.o
CSRC= ${PROG}.o CSRC= ${PROG}.o
DATA= FILES hint.css rpm.md test-strings.txt weasel.1 weasel.spec DATA= hint.css rpm.md test-strings.txt weasel.1 weasel.spec
TARGET= ${PROG} weasel TARGET= ${PROG} weasel
# #
ALT_OBJ= ${PROG}.alt ALT_OBJ= ${PROG}.alt
@@ -149,7 +149,7 @@ ${PROG}: ${PROG}.c
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS} ${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
weasel: ${PROG} weasel: ${PROG}
${CP} -f $< $@ ${LN} -sf $< $@
test: ${PROG} test.sh test: ${PROG} test.sh
@./test.sh @./test.sh
+178 -186
View File
@@ -208,16 +208,14 @@ It is an implementation of Richard Dawkins' [Weasel program][] (Wikipedia).
According to Wikipedia in chapter three of his book [The Blind Watchmaker][] According to Wikipedia in chapter three of his book [The Blind Watchmaker][]
Dawkins wrote: Dawkins wrote:
``` > I don't know who it was first pointed out that, given enough time, a monkey
I don't know who it was first pointed out that, given enough time, a monkey bashing away at random on a typewriter could produce all the works of
bashing away at random on a typewriter could produce all the works of Shakespeare. The operative phrase is, of course, *given enough time.* Let us
Shakespeare. The operative phrase is, of course, *given enough time.* Let us limit the task facing our monkey somewhat. Suppose that he has to produce, not
limit the task facing our monkey somewhat. Suppose that he has to produce, not the complete works of Shakespeare but just the short sentence 'Methinks it is
the complete works of Shakespeare but just the short sentence 'Methinks it is like a weasel', and we shall make it relatively easy by giving him a typewriter
like a weasel', and we shall make it relatively easy by giving him a typewriter with a restricted keyboard, one with just the 26 (capital) letters, and a space
with a restricted keyboard, one with just the 26 (capital) letters, and a space bar. How long will he take to write this one little sentence?
bar. How long will he take to write this one little sentence?
```
He refers to the [Infinite Monkey Theorem][] (Wikipedia). As he points out the He refers to the [Infinite Monkey Theorem][] (Wikipedia). As he points out the
operative phrase is *given enough time*; but even if it's extremely unlikely operative phrase is *given enough time*; but even if it's extremely unlikely
@@ -250,18 +248,16 @@ Here you can find a general explanation of a *[genetic algorithm][]* as well as
brief history. Although the link provides more information (including images to brief history. Although the link provides more information (including images to
try and show the way they work) for those interested I will cite the summary: try and show the way they work) for those interested I will cite the summary:
``` > Genetic Algorithms (GAs) are adaptive heuristic search algorithm based on the
Genetic Algorithms (GAs) are adaptive heuristic search algorithm based on the evolutionary ideas of natural selection and genetics. As such they represent an
evolutionary ideas of natural selection and genetics. As such they represent an intelligent exploitation of a random search used to solve optimization problems.
intelligent exploitation of a random search used to solve optimization problems. Although randomised, GAs are by no means random, instead they exploit historical
Although randomised, GAs are by no means random, instead they exploit historical information to direct the search into the region of better performance within
information to direct the search into the region of better performance within the search space. The basic techniques of the GAs are designed to simulate
the search space. The basic techniques of the GAs are designed to simulate processes in natural systems necessary for evolution, specially those follow the
processes in natural systems necessary for evolution, specially those follow the principles first laid down by Charles Darwin of "survival of the fittest.".
principles first laid down by Charles Darwin of "survival of the fittest.". Since in nature, competition among individuals for scanty resources results in
Since in nature, competition among individuals for scanty resources results in the fittest individuals dominating over the weaker ones.
the fittest individuals dominating over the weaker ones.
```
**OBFUSCATION NOTE: Some of the below might help you follow the code more **OBFUSCATION NOTE: Some of the below might help you follow the code more
easily.** easily.**
@@ -292,9 +288,8 @@ Note that the generation is checked *before the scoring takes place* by a prefix
increment equality check; when the generation is `SIZE_MAX - 1` the fitness increment equality check; when the generation is `SIZE_MAX - 1` the fitness
test loop will not be entered; instead the outer loop will end after printing: test loop will not be entered; instead the outer loop will end after printing:
``` > Too many attempts, blaming the monkey Eric even if he isn't typing or doesn't
Too many attempts, blaming the monkey Eric even if he isn't typing or doesn't exist. Bye. exist. Bye.
```
Why '*Eric*'? Because the judges stated in the [2018 guidelines][] that when Why '*Eric*'? Because the judges stated in the [2018 guidelines][] that when
there is a user input error the program should insult the pet fish Eric even if there is a user input error the program should insult the pet fish Eric even if
@@ -304,22 +299,21 @@ final but this is relevant) they give is:
The judges might not have a pet fish named Eric, so might want to state: The judges might not have a pet fish named Eric, so might want to state:
``` > This entry factors integers between 1 and
This entry factors integers between 1 and 2305567963945518424753102147331756070. 2305567963945518424753102147331756070\. Attempting to factor anything else will
Attempting to factor anything else will cause the program to insult your cause the program to insult your pet fish Eric, or in the case that you lack
pet fish Eric, or in the case that you lack such a pet, will insult the such a pet, will insult the pet that you do not have.
pet that you do not have.
```
After the final message they ask: After the final message they ask:
BTW: **What is so special about 2305567963945518424753102147331756070**? You tell us! > BTW: **What is so special about 2305567963945518424753102147331756070**? You
tell us!
The answer is this: **it is the primorial prime of 97:** the product of all The answer is this: **it is the primorial prime of 97:** the product of all
prime numbers less than or equal to N; **and the primorial prime of `N == 97` is prime numbers less than or equal to N; **and the primorial prime of `N == 97` is
`2305567963945518424753102147331756070`. There is no reference to this number `2305567963945518424753102147331756070`.** But there is no reference to this number
in my entry but it's nonetheless possible to **change the default target to it in my entry but it's nonetheless possible to change the default target to it
without modifying the source code**; there are two hints in this very **without modifying the source code**; there are two hints in this very
paragraph; the first sentence in fact: the answer to the judges' question and paragraph; the first sentence in fact: the answer to the judges' question and
the definition. Can you get the program to search the primorial prime of 97 the definition. Can you get the program to search the primorial prime of 97
without passing in specially? without passing in specially?
@@ -328,6 +322,7 @@ I was quite proud that when the next contest came the judges removed that
question. Later 2018 and all of 2019 was difficult for me so it was like I won a question. Later 2018 and all of 2019 was difficult for me so it was like I won a
second time for the same entry. second time for the same entry.
### On <del>user</del> monkey errors ### On <del>user</del> monkey errors
If the generation reaches `SIZE_MAX - 1` I consider it a monkey (or if you If the generation reaches `SIZE_MAX - 1` I consider it a monkey (or if you
@@ -349,7 +344,7 @@ assumption that **the user could in fact be a monkey called Eric** *although it
isn't insolent enough to say the user is a monkey for certain!* isn't insolent enough to say the user is a monkey for certain!*
[genetic algorithm]: https://web.archive.org/web/20180308131613/http://www.doc.ic.ac.uk/~nd/surprise_96/journal/vol1/hmw/article1.html [genetic algorithm]: https://web.archive.org/web/20180308131613/http://www.doc.ic.ac.uk/~nd/surprise_96/journal/vol1/hmw/article1.html
[2018 guidelines]: ../../2018/guidelines.txt [2018 guidelines]: ../guidelines.txt
<div id="hints"> <div id="hints">
@@ -372,11 +367,15 @@ precise the following characters are acceptable; it equates to this in C (note
it includes a literal space `' '` but it doesn't include other it includes a literal space `' '` but it doesn't include other
`isspace()` characters) and this is why some of the characters are escaped: `isspace()` characters) and this is why some of the characters are escaped:
const char keyboard[]=" !\"#$<%:>&'()*+,-./0123456789;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`{|}~"; ``` <!---c-->
const char keyboard[]=" !\"#$<%:>&'()*+,-./0123456789;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`{|}~";
```
The simpler keyboard looks like: The simpler keyboard looks like:
const char keyboard[]=" !\"&'(),.0123456789;?ABCDEFGHIJKLMNOPQRSTUVWXYZ"; ``` <!---c-->
const char keyboard[]=" !\"&'(),.0123456789;?ABCDEFGHIJKLMNOPQRSTUVWXYZ";
```
The program makes sure that the target string only has characters the keyboard The program makes sure that the target string only has characters the keyboard
can actually produce but there is a certain type of input error that might can actually produce but there is a certain type of input error that might
@@ -394,7 +393,7 @@ string; some I will document here (the summary being in the man page). You can
join options but there is a caveat with spaces and `-r` option as well as join options but there is a caveat with spaces and `-r` option as well as
the target string (see below). the target string (see below).
**Enable quiet output:** #### Enable quiet output:
``` ```
-q -q
@@ -404,7 +403,7 @@ This means don't print the generation and offspring output; only print (some) of
the options set (this is always done but wouldn't usually be seen due to verbose the options set (this is always done but wouldn't usually be seen due to verbose
output) and the final answer. output) and the final answer.
**Change the mutation rate to `<rate>`:** #### Change the mutation rate to `<rate>`:
``` ```
-r<num> -r<num>
@@ -502,9 +501,9 @@ The target string will be: `-TEST`. This means though that here:
./weasel -q -- -test -r5 ./weasel -q -- -test -r5
``` ```
The string to be searched would actually be `-r5` and the mutation rate The string to be searched would actually be `-r5` and the mutation rate will
will remain the default because after the `-` option is seen it will no remain the default because after the `-` option (that is `--`) is seen it will
longer parse additional options: only target strings if anything left on the no longer parse additional options: only target strings if anything left on the
command line. Because of the joining of arguments this means that the first two command line. Because of the joining of arguments this means that the first two
examples of the last set of three above are equivalent i.e. the following two examples of the last set of three above are equivalent i.e. the following two
are equivalent: are equivalent:
@@ -558,6 +557,7 @@ it no longer cares about the `-` for option parsing. In other words options
are only parsed if the first character is `-` and if the parser hasn't seen are only parsed if the first character is `-` and if the parser hasn't seen
the `-` - *in an earlier element of `argv`. This is not a bug!* the `-` - *in an earlier element of `argv`. This is not a bug!*
<div id="obfuscation"> <div id="obfuscation">
### Obfuscation ### Obfuscation
</div> </div>
@@ -608,12 +608,10 @@ So in this case I joined the options in the following order:
Quiet output. Quiet output.
2. `-r101` 2. `-r101`
Mutation rate 101 (out of range). Mutation rate 101 (out of range).
3. `-r5` 3. `-r5`
Mutation rate of 5 but note that during parsing I only print invalid mutation Mutation rate of 5 but note that during parsing I only print invalid mutation
@@ -622,7 +620,6 @@ being); so while it appears there is a bug, showing mutation rate out of range
three times, this is expected (given the next one, `-r101`). This means here three times, this is expected (given the next one, `-r101`). This means here
the typewriter was taken from Eric the monkey. the typewriter was taken from Eric the monkey.
4. `-r101` 4. `-r101`
Mutation rate to 101: this too is out of range (this is the second mutation rate Mutation rate to 101: this too is out of range (this is the second mutation rate
@@ -634,7 +631,6 @@ out of range message). The typewriter returns to Eric.
Set mutation rate to 1. Take that typewriter away! Set mutation rate to 1. Take that typewriter away!
6. `-r` 6. `-r`
Set mutation rate to 0; when there are no valid characters passed to Set mutation rate to 0; when there are no valid characters passed to
@@ -645,15 +641,14 @@ mutation rate; if there are any systems where the widths differ this *shouldn't
matter* because of truncation but I do in any case specifically check for `R < matter* because of truncation but I do in any case specifically check for `R <
0 || R > 100`. Either way the invalid range returns the typewriter to Eric. 0 || R > 100`. Either way the invalid range returns the typewriter to Eric.
7. `test` 7. `test`
Finally I requested it find the string `test` (will search for `TEST`). Finally I requested it find the string `test` (will search for `TEST`).
Given that it was a short string it did find the answer relatively quickly, even Given that it was a short string it did find the answer relatively quickly,
in monkey mode. even in monkey mode.
Another example: Another example:
``` <!---sh--> ``` <!---sh-->
$ ./weasel -q -r101 test -r5 $ ./weasel -q -r101 test -r5
@@ -664,12 +659,12 @@ Another example:
Generation 109 Offspring 13: TEST Generation 109 Offspring 13: TEST
``` ```
In this case I also enabled quiet mode but I didn't join the options; the In this case I also enabled quiet mode but I didn't join the options; the
`-r101` reports that it's out of range and sets monkey mode. I then specify `-r101` reports that it's out of range and sets monkey mode. I then specify
the target string and then set a valid mutation rate. This disabled monkey mode the target string and then set a valid mutation rate. This disabled monkey
which means that it'll use the genetic algorithm. mode which means that it'll use the genetic algorithm.
One more example of monkey mode: One more example of monkey mode:
``` <!---sh--> ``` <!---sh-->
$ ./weasel -q -mr101 test -r5 $ ./weasel -q -mr101 test -r5
@@ -681,18 +676,19 @@ One more example of monkey mode:
Generation 465298 Offspring 10: TEST Generation 465298 Offspring 10: TEST
``` ```
Here I also requested quiet output and then *explicitly requested that Eric the Here I also requested quiet output and then *explicitly requested that Eric
monkey types.* After this I set the mutation rate to be 101 which would have the monkey types.* After this I set the mutation rate to be 101 which would
set monkey mode (*in this case only temporarily as I later set it to a valid have set monkey mode (*in this case only temporarily as I later set it to a
number*) but since I have also requested monkey mode that won't matter. Then I valid number*) but since I have also requested monkey mode that won't
set the string to `test` and then set a valid mutation rate of 5. Now note matter. Then I set the string to `test` and then set a valid mutation rate
that it is actually set to 5 but also note that monkey mode remains active: it of 5. Now note that it is actually set to 5 but also note that monkey mode
also took a lot longer to come to a conclusion for even four characters. This remains active: it also took a lot longer to come to a conclusion for even
example does demonstrate one other thing in a subtle way though. four characters. This example does demonstrate one other thing in a subtle
way though.
When the program prints out each iteration (I'll give an example next) it goes a When the program prints out each iteration (I'll give an example next) it
lot slower; this makes sense because it's an expensive operation. Here are the goes a lot slower; this makes sense because printing is an expensive
times for the same but without quiet output enabled: operation. Here are the times for the same but without quiet output enabled:
``` ```
real 0m17.065s real 0m17.065s
@@ -700,7 +696,7 @@ times for the same but without quiet output enabled:
sys 0m2.402s sys 0m2.402s
``` ```
Whereas with quiet output: .. whereas with quiet output:
``` ```
real 0m0.127s real 0m0.127s
@@ -708,12 +704,12 @@ Whereas with quiet output:
sys 0m0.001s sys 0m0.001s
``` ```
Of course it isn't only down to the printing but the point is it slows it down Of course it isn't only down to the printing but the point is it slows it
significantly. Adding an option to print every X lines would go over the limit down significantly. Adding an option to print every X lines would go over
(`iocccsize -i` reports 2052!). the limit (`iocccsize -i` reports 2052!).
Finally I'll show a default example in normal output (I omit many lines showing 8. Finally I'll show a default example in normal output (I omit many lines showing
instead **[...]**). Note that the real/user/sys times are from the `time` instead `[...]`). Note that the real/user/sys times are from the `time`
bash shell built-in utility: that isn't output from my entry. bash shell built-in utility: that isn't output from my entry.
``` ```
@@ -740,13 +736,14 @@ bash shell built-in utility: that isn't output from my entry.
sys 0m0.001s sys 0m0.001s
``` ```
Keep in mind the way I display the generations and the fact that generation 0 Keep in mind the way I display the generations and the fact that generation 0
has no parents; it is generation 1 that starts working towards the goal. You'll has no parents; it is generation 1 that starts working towards the goal. You'll
see also **(mutation)** at the end of the line at this point (if you enable see also `(mutation)` at the end of the line at this point (if you enable monkey
monkey mode you'll find that it shows something else). The lines that only have mode you'll find that it shows something else). The lines that only have
back-quote ("\`") are separators: you won't see this between generation 0 and 1 but you will back-quote (`` "\`" ``) are separators: you won't see this between generation 0
between future generations - as well as the final answer (if the answer is in and 1 but you will between future generations - as well as the final answer (if
generation 0 you won't see the ``). the answer is in generation 0 you won't see the `` ` ``).
<div id="test"> <div id="test">
One final thing to consider is that **the program doesn't directly read from a One final thing to consider is that **the program doesn't directly read from a
@@ -934,23 +931,22 @@ Skip to [How to build](#build).
On the subject of beauty: the judges stated in the guidelines the following: On the subject of beauty: the judges stated in the guidelines the following:
``` > We want to get away from source that is simply **a compact blob of octets.**
We want to get away from source that is simply **a compact blob of Really try to be more creative than **blob coding.** *HINT!*
octets.** Really try to be more creative than **blob coding.** *HINT!*
```
And if you'll notice that although it *might look like a compact blob of octets* And if you'll notice that although it *might look like a compact blob of octets*
at first glance if you look throughout the file you'll see two statements to (although not really: a blob is by definition roundish) at first glance if you
set your thinking straight: look throughout the file you'll see two statements to set your thinking
straight:
**NO BLOB CODING** > **NO BLOB CODING**
>
**THIS IS NOT A COMPACT BLOB OF OCTETS** > **THIS IS NOT A COMPACT BLOB OF OCTETS**
So you see even if your eyes are trying to deceive you they're quite wrong. Yes So you see even if your eyes are trying to deceive you they're quite wrong. Yes
some of it might look like a blob but this is clearly false; *as all good some of it might look like a blob (for certain definitions of 'blob' :) ) but
programmers know if something is potentially confusing or misleading it should this is clearly false; *as all good programmers know if something is potentially
be made clear in the comments! :)* confusing or misleading it should be made clear in the comments! :)*
<div id="build"> <div id="build">
## **5. How to build** ## **5. How to build**
@@ -1157,7 +1153,8 @@ Skip to [Final thoughts](#thoughts).
I have included a RPM spec file for those with a Red Hat based Linux I have included a RPM spec file for those with a Red Hat based Linux
distribution; see [rpm.html](rpm.html) for details (including why I implemented distribution; see [rpm.html](rpm.html) for details (including why I implemented
this) if for some (strange or maybe even mad) reason you're interested. this) if for some (strange or maybe even mad) reason you're interested, which
basically means nobody but me.
[rpm.html]: rpm.html [rpm.html]: rpm.html
@@ -1180,50 +1177,48 @@ two things I think are rather amusing (in order of least to most):
Dennis Ritchie's Anti-Foreword: Dennis Ritchie's Anti-Foreword:
</div> </div>
``` > Anti-Foreword
Anti-Foreword >
> By Dennis Ritchie
By Dennis Ritchie > From: dmr@plan9.research.att.com
From: dmr@plan9.research.att.com > Date: Tue, 15 Mar 1994 00:38:07 EST
Date: Tue, 15 Mar 1994 00:38:07 EST > Subject: anti-foreword
Subject: anti-foreword >
> To the contributers to this book:
To the contributers to this book: >
> I have succumbed to the temptation you offered in your preface: I do write you
I have succumbed to the temptation you offered in your preface: I do write you > off as envious malcontents and romantic keepers of memories. The systems you
off as envious malcontents and romantic keepers of memories. The systems you > remember so fondly (TOPS-20, ITS, Multics, Lisp Machine, Cedar/Mesa, the Dorado)
remember so fondly (TOPS-20, ITS, Multics, Lisp Machine, Cedar/Mesa, the Dorado) > are not just out to pasture, they are fertilizing it from below.
are not just out to pasture, they are fertilizing it from below. >
> Your judgments are not keen, they are intoxicated by metaphor. In the Preface
Your judgments are not keen, they are intoxicated by metaphor. In the Preface > you suffer first from heat, lice, and malnourishment, then become prisoners in
you suffer first from heat, lice, and malnourishment, then become prisoners in > a Gulag. In Chapter 1 you are in turn infected by a virus, racked by drug
a Gulag. In Chapter 1 you are in turn infected by a virus, racked by drug > addiction, and addled by puffiness of the genome.
addiction, and addled by puffiness of the genome. >
> Yet your prison without coherent design continues to imprison you. How can
Yet your prison without coherent design continues to imprison you. How can > this be, if it has no strong places? The rational prisoner exploits the weak
this be, if it has no strong places? The rational prisoner exploits the weak > places, creates order from chaos: instead, collectives like the FSF vindicate
places, creates order from chaos: instead, collectives like the FSF vindicate > their jailers by building cells almost compatible with the existing ones, albeit
their jailers by building cells almost compatible with the existing ones, albeit > with more features. The journalist with three undergraduate degrees from MIT,
with more features. The journalist with three undergraduate degrees from MIT, > the researcher at Microsoft, and the senior scientist at Apple might volunteer a
the researcher at Microsoft, and the senior scientist at Apple might volunteer a > few words about the regulations of the prisons to which they have been
few words about the regulations of the prisons to which they have been > transferred.
transferred. >
> Your sense of the possible is in no sense pure: sometimes you want the same
Your sense of the possible is in no sense pure: sometimes you want the same > thing you have, but wish you had done it yourselves; other times you want
thing you have, but wish you had done it yourselves; other times you want > something different, but can't seem to get people to use it; sometimes one
something different, but can't seem to get people to use it; sometimes one > wonders why you just don't shut up and tell people to buy a PC with Windows or a
wonders why you just don't shut up and tell people to buy a PC with Windows or a > Mac. No Gulag or lice, just a future whose intellectual tone and interaction
Mac. No Gulag or lice, just a future whose intellectual tone and interaction > style is set by Sonic the Hedgehog. You claim to seek progress, but you succeed
style is set by Sonic the Hedgehog. You claim to seek progress, but you succeed > mainly in whining.
mainly in whining. >
> Here is my metaphor: your book is a pudding stuffed with apposite
Here is my metaphor: your book is a pudding stuffed with apposite > observations, many well-conceived. Like excrement, it contains enough undigested
observations, many well-conceived. Like excrement, it contains enough undigested > nuggets of nutrition to sustain life for some. But it is not a tasty pie: it
nuggets of nutrition to sustain life for some. But it is not a tasty pie: it > reeks too much of contempt and of envy.
reeks too much of contempt and of envy. >
> Bon appetit!
Bon appetit!
```
Yes he misspelt *'contributors'*! But then again we're talking about obfuscation Yes he misspelt *'contributors'*! But then again we're talking about obfuscation
and since it doesn't break his message it's not broken - it's just obfuscated and since it doesn't break his message it's not broken - it's just obfuscated
@@ -1234,56 +1229,51 @@ contest is about? :)
Ken Thompson's ending: Ken Thompson's ending:
</div> </div>
``` > Creators Admit C, Unix Were Hoax
Creators Admit C, Unix Were Hoax >
> FOR IMMEDIATE RELEASE
FOR IMMEDIATE RELEASE >
> In an announcement that has stunned the computer industry, Ken Thompson,
In an announcement that has stunned the computer industry, Ken Thompson, Dennis Ritchie, and Brian Kernighan admitted that the Unix operating system and
Dennis Ritchie, and Brian Kernighan admitted that the Unix operating system and C programming language created by them is an elaborate April Fools prank kept
C programming language created by them is an elaborate April Fools prank kept alive for more than 20 years. Speaking at the recent UnixWorld Software
alive for more than 20 years. Speaking at the recent UnixWorld Software Development Forum, Thompson revealed the following:
Development Forum, Thompson revealed the following: >
> "In 1969, AT&T had just terminated their work with the GE/AT&T Multics
"In 1969, AT&T had just terminated their work with the GE/AT&T Multics project. Brian and I had just started working with an early release of Pascal
project. Brian and I had just started working with an early release of Pascal from Professor Nichlaus Wirth's ETH labs in Switzerland, and we were impressed
from Professor Nichlaus Wirth's ETH labs in Switzerland, and we were impressed with its elegant simplicity and power. Dennis had just finished reading Bored of
with its elegant simplicity and power. Dennis had just finished reading Bored of the Rings, a hilarious National Lampoon parody of the great Tolkien Lord of the
the Rings, a hilarious National Lampoon parody of the great Tolkien Lord of the Rings trilogy. As a lark, we decided to do parodies of the Multics environment
Rings trilogy. As a lark, we decided to do parodies of the Multics environment and Pascal. Dennis and I were responsible for the operating environment. We
and Pascal. Dennis and I were responsible for the operating environment. We looked at Multics and designed the new system to be as complex and cryptic as
looked at Multics and designed the new system to be as complex and cryptic as possible to maximize casual users' frustration levels, calling it Unix as a
possible to maximize casual users' frustration levels, calling it Unix as a parody of Multics, as well as other more risque allusions.
parody of Multics, as well as other more risque allusions. >
> "Then Dennis and Brian worked on a truly warped version of Pascal, called
"Then Dennis and Brian worked on a truly warped version of Pascal, called "A." "A." When we found others were actually trying to programs with A, we quickly
When we found others were actually trying to programs with A, we quickly added added additional cryptic features and evolved into B, BCPL, and finally C. We
additional cryptic features and evolved into B, BCPL, and finally C. We stopped stopped when we got a clean compile on the following syntax:
when we got a clean compile on the following syntax: >
``` > `for(;P("\n"),R=;P("|"))for(e=C;e=P("_"+(*u++/`<br>
> `8)%2))P("|"+(*u/4)%2);`
``` <!---c--> >
for(;P("\n"),R=;P("|"))for(e=C;e=P("_"+(*u++/ >
8)%2))P("|"+(*u/4)%2); > "To think that modern programmers would try to use a language that allowed
``` such a statement was beyond our comprehension! We actually thought of selling
this to the Soviets to set their computer science progress back 20 or more
``` years. Imagine our surprise when AT&T and other U.S. corporations actually began
"To think that modern programmers would try to use a language that allowed trying to use Unix and C! It has taken them 20 years to develop enough
such a statement was beyond our comprehension! We actually thought of selling expertise to generate even marginally useful applications using this 1960s
this to the Soviets to set their computer science progress back 20 or more technological parody, but we are impressed with the tenacity (if not common
years. Imagine our surprise when AT&T and other U.S. corporations actually began sense) of the general Unix and C programmer.
trying to use Unix and C! It has taken them 20 years to develop enough >
expertise to generate even marginally useful applications using this 1960s > "In any event, Brian, Dennis, and I have been working exclusively in Lisp
technological parody, but we are impressed with the tenacity (if not common on the Apple Macintosh for the past few years and feel really guilty about the
sense) of the general Unix and C programmer. chaos, confusion, and truly bad programming that has resulted from our silly
prank so long ago."
"In any event, Brian, Dennis, and I have been working exclusively in Lisp on >
the Apple Macintosh for the past few years and feel really guilty about the > Major Unix and C vendors and customers, including AT&T, Microsoft,
chaos, confusion, and truly bad programming that has resulted from our silly
prank so long ago."
```
Major Unix and C vendors and customers, including AT&T, Microsoft,
Hewlett-Packard, GTE, NCR, and DEC have refused comment at this time. Borland Hewlett-Packard, GTE, NCR, and DEC have refused comment at this time. Borland
International, a leading vendor of Pascal and C tools, including the popular International, a leading vendor of Pascal and C tools, including the popular
Turbo Pascal, Turbo C, and Turbo C++, stated they had suspected this for a Turbo Pascal, Turbo C, and Turbo C++, stated they had suspected this for a
@@ -1295,13 +1285,15 @@ cryptic statement, Professor Wirth of the ETH Institute and father of the
Pascal, Modula 2, and Oberon structured languages, merely stated that P. T. Pascal, Modula 2, and Oberon structured languages, merely stated that P. T.
Barnum was correct. Barnum was correct.
<hr>
So is it a hoax about a non-hoax, a non-hoax about a hoax, a non-hoax about a So is it a hoax about a non-hoax, a non-hoax about a hoax, a non-hoax about a
non-hoax or is it a hoax about a hoax ? :) And if it's any of those what does it non-hoax or is it a hoax about a hoax ? :) And if it's any of those what does it
mean about Unix and C?** And if a hoax is involved *what is the hoax?* The pedant mean about Unix and C?** And if a hoax is involved *what is the hoax?* The pedant
and Tolkienist that I am has to state that **Tolkien didn't consider The Lord of and Tolkienist that I am has to state that **Tolkien didn't consider The Lord of
the Rings a trilogy** *(and he made that very clear)* but that doesn't take away the Rings a trilogy** *(and he made that very clear)* but that doesn't take away
from the humour by any stretch (*if anyone wants me to elaborate or debate the from the humour by any stretch (*if anyone wants me to elaborate or debate the
matter do send me an email - I love Tolkien's legendarium and having another matter do send me an email - I love Tolkien's Legendarium and having another
person to talk about it with is more than welcome!*). Ken suggested that there person to talk about it with is more than welcome!*). Ken suggested that there
is a lack of common sense but since he was part of its creation I don't think is a lack of common sense but since he was part of its creation I don't think
it's a bad thing; **on the contrary it makes all of us C programmers even more it's a bad thing; **on the contrary it makes all of us C programmers even more
+165 -153
View File
@@ -547,14 +547,16 @@ dedicated to this entry beyond what will be published on the IOCCC website.</p>
<p>It is an implementation of Richard Dawkins’ <a href="https://en.wikipedia.org/wiki/Weasel_program">Weasel program</a> (Wikipedia). <p>It is an implementation of Richard Dawkins’ <a href="https://en.wikipedia.org/wiki/Weasel_program">Weasel program</a> (Wikipedia).
According to Wikipedia in chapter three of his book <a href="https://en.wikipedia.org/wiki/The_Blind_Watchmaker">The Blind Watchmaker</a> According to Wikipedia in chapter three of his book <a href="https://en.wikipedia.org/wiki/The_Blind_Watchmaker">The Blind Watchmaker</a>
Dawkins wrote:</p> Dawkins wrote:</p>
<pre><code> I don&#39;t know who it was first pointed out that, given enough time, a monkey <blockquote>
bashing away at random on a typewriter could produce all the works of <p>I don’t know who it was first pointed out that, given enough time, a monkey
Shakespeare. The operative phrase is, of course, *given enough time.* Let us bashing away at random on a typewriter could produce all the works of
limit the task facing our monkey somewhat. Suppose that he has to produce, not Shakespeare. The operative phrase is, of course, <em>given enough time.</em> Let us
the complete works of Shakespeare but just the short sentence &#39;Methinks it is limit the task facing our monkey somewhat. Suppose that he has to produce, not
like a weasel&#39;, and we shall make it relatively easy by giving him a typewriter the complete works of Shakespeare but just the short sentence ‘Methinks it is
with a restricted keyboard, one with just the 26 (capital) letters, and a space like a weasel’, and we shall make it relatively easy by giving him a typewriter
bar. How long will he take to write this one little sentence?</code></pre> with a restricted keyboard, one with just the 26 (capital) letters, and a space
bar. How long will he take to write this one little sentence?</p>
</blockquote>
<p>He refers to the <a href="https://en.wikipedia.org/wiki/Infinite_monkey_theorem">Infinite Monkey Theorem</a> (Wikipedia). As he points out the <p>He refers to the <a href="https://en.wikipedia.org/wiki/Infinite_monkey_theorem">Infinite Monkey Theorem</a> (Wikipedia). As he points out the
operative phrase is <em>given enough time</em>; but even if it’s extremely unlikely operative phrase is <em>given enough time</em>; but even if it’s extremely unlikely
<em>technically the probability is greater than 0</em>. He simplified it for the <em>technically the probability is greater than 0</em>. He simplified it for the
@@ -577,16 +579,18 @@ comparison and output will always be capitalised).</p>
<p>Here you can find a general explanation of a <em><a href="https://web.archive.org/web/20180308131613/http://www.doc.ic.ac.uk/~nd/surprise_96/journal/vol1/hmw/article1.html">genetic algorithm</a></em> as well as a <p>Here you can find a general explanation of a <em><a href="https://web.archive.org/web/20180308131613/http://www.doc.ic.ac.uk/~nd/surprise_96/journal/vol1/hmw/article1.html">genetic algorithm</a></em> as well as a
brief history. Although the link provides more information (including images to brief history. Although the link provides more information (including images to
try and show the way they work) for those interested I will cite the summary:</p> try and show the way they work) for those interested I will cite the summary:</p>
<pre><code> Genetic Algorithms (GAs) are adaptive heuristic search algorithm based on the <blockquote>
evolutionary ideas of natural selection and genetics. As such they represent an <p>Genetic Algorithms (GAs) are adaptive heuristic search algorithm based on the
intelligent exploitation of a random search used to solve optimization problems. evolutionary ideas of natural selection and genetics. As such they represent an
Although randomised, GAs are by no means random, instead they exploit historical intelligent exploitation of a random search used to solve optimization problems.
information to direct the search into the region of better performance within Although randomised, GAs are by no means random, instead they exploit historical
the search space. The basic techniques of the GAs are designed to simulate information to direct the search into the region of better performance within
processes in natural systems necessary for evolution, specially those follow the the search space. The basic techniques of the GAs are designed to simulate
principles first laid down by Charles Darwin of &quot;survival of the fittest.&quot;. processes in natural systems necessary for evolution, specially those follow the
Since in nature, competition among individuals for scanty resources results in principles first laid down by Charles Darwin of “survival of the fittest.”.
the fittest individuals dominating over the weaker ones.</code></pre> Since in nature, competition among individuals for scanty resources results in
the fittest individuals dominating over the weaker ones.</p>
</blockquote>
<p><strong>OBFUSCATION NOTE: Some of the below might help you follow the code more <p><strong>OBFUSCATION NOTE: Some of the below might help you follow the code more
easily.</strong></p> easily.</strong></p>
<p>For each <em>generation</em> there is a total of <code>N</code> <em>offspring</em>; generation 0 is <p>For each <em>generation</em> there is a total of <code>N</code> <em>offspring</em>; generation 0 is
@@ -612,24 +616,32 @@ found.</p>
<p>Note that the generation is checked <em>before the scoring takes place</em> by a prefix <p>Note that the generation is checked <em>before the scoring takes place</em> by a prefix
increment equality check; when the generation is <code>SIZE_MAX - 1</code> the fitness increment equality check; when the generation is <code>SIZE_MAX - 1</code> the fitness
test loop will not be entered; instead the outer loop will end after printing:</p> test loop will not be entered; instead the outer loop will end after printing:</p>
<pre><code> Too many attempts, blaming the monkey Eric even if he isn&#39;t typing or doesn&#39;t exist. Bye.</code></pre> <blockquote>
<p>Why ‘<em>Eric</em>’? Because the judges stated in the <a href="../../2018/guidelines.txt">2018 guidelines</a> that when <p>Too many attempts, blaming the monkey Eric even if he isn’t typing or doesn’t
exist. Bye.</p>
</blockquote>
<p>Why ‘<em>Eric</em>’? Because the judges stated in the <a href="../guidelines.txt">2018 guidelines</a> that when
there is a user input error the program should insult the pet fish Eric even if there is a user input error the program should insult the pet fish Eric even if
such a fish (no, weasels do not equate monkeys to fish but see below) doesn’t such a fish (no, weasels do not equate monkeys to fish but see below) doesn’t
exist. The second to last example limitation example note (it’s improved in the exist. The second to last example limitation example note (it’s improved in the
final but this is relevant) they give is:</p> final but this is relevant) they give is:</p>
<p>The judges might not have a pet fish named Eric, so might want to state:</p> <p>The judges might not have a pet fish named Eric, so might want to state:</p>
<pre><code> This entry factors integers between 1 and 2305567963945518424753102147331756070. <blockquote>
Attempting to factor anything else will cause the program to insult your <p>This entry factors integers between 1 and
pet fish Eric, or in the case that you lack such a pet, will insult the 2305567963945518424753102147331756070. Attempting to factor anything else will
pet that you do not have.</code></pre> cause the program to insult your pet fish Eric, or in the case that you lack
such a pet, will insult the pet that you do not have.</p>
</blockquote>
<p>After the final message they ask:</p> <p>After the final message they ask:</p>
<p>BTW: <strong>What is so special about 2305567963945518424753102147331756070</strong>? You tell us!</p> <blockquote>
<p>BTW: <strong>What is so special about 2305567963945518424753102147331756070</strong>? You
tell us!</p>
</blockquote>
<p>The answer is this: <strong>it is the primorial prime of 97:</strong> the product of all <p>The answer is this: <strong>it is the primorial prime of 97:</strong> the product of all
prime numbers less than or equal to N; <strong>and the primorial prime of <code>N == 97</code> is prime numbers less than or equal to N; <strong>and the primorial prime of <code>N == 97</code> is
<code>2305567963945518424753102147331756070</code>. There is no reference to this number <code>2305567963945518424753102147331756070</code>.</strong> But there is no reference to this number
in my entry but it’s nonetheless possible to </strong>change the default target to it in my entry but it’s nonetheless possible to change the default target to it
without modifying the source code**; there are two hints in this very <strong>without modifying the source code</strong>; there are two hints in this very
paragraph; the first sentence in fact: the answer to the judges’ question and paragraph; the first sentence in fact: the answer to the judges’ question and
the definition. Can you get the program to search the primorial prime of 97 the definition. Can you get the program to search the primorial prime of 97
without passing in specially?</p> without passing in specially?</p>
@@ -676,12 +688,12 @@ can actually produce but there is a certain type of input error that might
string; some I will document here (the summary being in the man page). You can string; some I will document here (the summary being in the man page). You can
join options but there is a caveat with spaces and <code>-r</code> option as well as join options but there is a caveat with spaces and <code>-r</code> option as well as
the target string (see below).</p> the target string (see below).</p>
<p><strong>Enable quiet output:</strong></p> <h4 id="enable-quiet-output">Enable quiet output:</h4>
<pre><code> -q</code></pre> <pre><code> -q</code></pre>
<p>This means don’t print the generation and offspring output; only print (some) of <p>This means don’t print the generation and offspring output; only print (some) of
the options set (this is always done but wouldn’t usually be seen due to verbose the options set (this is always done but wouldn’t usually be seen due to verbose
output) and the final answer.</p> output) and the final answer.</p>
<p><strong>Change the mutation rate to <code>&lt;rate&gt;</code>:</strong></p> <h4 id="change-the-mutation-rate-to-rate">Change the mutation rate to <code>&lt;rate&gt;</code>:</h4>
<pre><code> -r&lt;num&gt;</code></pre> <pre><code> -r&lt;num&gt;</code></pre>
<p>Please note that there cannot be a space between the <code>-r</code> and the number. <p>Please note that there cannot be a space between the <code>-r</code> and the number.
This is to simplify the parsing of options. As for combining options you can do This is to simplify the parsing of options. As for combining options you can do
@@ -743,9 +755,9 @@ example if you were to do any of:</p>
./weasel -q -- -test</code></pre> ./weasel -q -- -test</code></pre>
<p>The target string will be: <code>-TEST</code>. This means though that here:</p> <p>The target string will be: <code>-TEST</code>. This means though that here:</p>
<pre><code> ./weasel -q -- -test -r5</code></pre> <pre><code> ./weasel -q -- -test -r5</code></pre>
<p>The string to be searched would actually be <code>-r5</code> and the mutation rate <p>The string to be searched would actually be <code>-r5</code> and the mutation rate will
will remain the default because after the <code>-</code> option is seen it will no remain the default because after the <code>-</code> option (that is <code>--</code>) is seen it will
longer parse additional options: only target strings if anything left on the no longer parse additional options: only target strings if anything left on the
command line. Because of the joining of arguments this means that the first two command line. Because of the joining of arguments this means that the first two
examples of the last set of three above are equivalent i.e. the following two examples of the last set of three above are equivalent i.e. the following two
are equivalent:</p> are equivalent:</p>
@@ -834,11 +846,11 @@ returns a <code>long</code> but I compare the return value of <code>rand()</code
mutation rate; if there are any systems where the widths differ this <em>shouldn’t mutation rate; if there are any systems where the widths differ this <em>shouldn’t
matter</em> because of truncation but I do in any case specifically check for <code>R &lt; 0 || R &gt; 100</code>. Either way the invalid range returns the typewriter to Eric.</p></li> matter</em> because of truncation but I do in any case specifically check for <code>R &lt; 0 || R &gt; 100</code>. Either way the invalid range returns the typewriter to Eric.</p></li>
<li><p><code>test</code></p> <li><p><code>test</code></p>
<p>Finally I requested it find the string <code>test</code> (will search for <code>TEST</code>).</p></li> <p>Finally I requested it find the string <code>test</code> (will search for <code>TEST</code>).</p>
<p>Given that it was a short string it did find the answer relatively quickly,
even in monkey mode.</p>
<p>Another example:</p></li>
</ol> </ol>
<p>Given that it was a short string it did find the answer relatively quickly, even
in monkey mode.</p>
<p>Another example:</p>
<pre><code> $ ./weasel -q -r101 test -r5 <pre><code> $ ./weasel -q -r101 test -r5
quiet output quiet output
mutation rate out of range mutation rate out of range
@@ -847,8 +859,8 @@ in monkey mode.</p>
Generation 109 Offspring 13: TEST</code></pre> Generation 109 Offspring 13: TEST</code></pre>
<p>In this case I also enabled quiet mode but I didn’t join the options; the <p>In this case I also enabled quiet mode but I didn’t join the options; the
<code>-r101</code> reports that it’s out of range and sets monkey mode. I then specify <code>-r101</code> reports that it’s out of range and sets monkey mode. I then specify
the target string and then set a valid mutation rate. This disabled monkey mode the target string and then set a valid mutation rate. This disabled monkey
which means that it’ll use the genetic algorithm.</p> mode which means that it’ll use the genetic algorithm.</p>
<p>One more example of monkey mode:</p> <p>One more example of monkey mode:</p>
<pre><code> $ ./weasel -q -mr101 test -r5 <pre><code> $ ./weasel -q -mr101 test -r5
quiet output quiet output
@@ -857,30 +869,33 @@ which means that it’ll use the genetic algorithm.</p>
mutation rate 5 mutation rate 5
monkey at typewriter monkey at typewriter
Generation 465298 Offspring 10: TEST</code></pre> Generation 465298 Offspring 10: TEST</code></pre>
<p>Here I also requested quiet output and then <em>explicitly requested that Eric the <p>Here I also requested quiet output and then <em>explicitly requested that Eric
monkey types.</em> After this I set the mutation rate to be 101 which would have the monkey types.</em> After this I set the mutation rate to be 101 which would
set monkey mode (<em>in this case only temporarily as I later set it to a valid have set monkey mode (<em>in this case only temporarily as I later set it to a
number</em>) but since I have also requested monkey mode that won’t matter. Then I valid number</em>) but since I have also requested monkey mode that won’t
set the string to <code>test</code> and then set a valid mutation rate of 5. Now note matter. Then I set the string to <code>test</code> and then set a valid mutation rate
that it is actually set to 5 but also note that monkey mode remains active: it of 5. Now note that it is actually set to 5 but also note that monkey mode
also took a lot longer to come to a conclusion for even four characters. This remains active: it also took a lot longer to come to a conclusion for even
example does demonstrate one other thing in a subtle way though.</p> four characters. This example does demonstrate one other thing in a subtle
<p>When the program prints out each iteration (I’ll give an example next) it goes a way though.</p>
lot slower; this makes sense because it’s an expensive operation. Here are the <p>When the program prints out each iteration (I’ll give an example next) it
times for the same but without quiet output enabled:</p> goes a lot slower; this makes sense because printing is an expensive
operation. Here are the times for the same but without quiet output enabled:</p>
<pre><code> real 0m17.065s <pre><code> real 0m17.065s
user 0m1.245s user 0m1.245s
sys 0m2.402s</code></pre> sys 0m2.402s</code></pre>
<p>Whereas with quiet output:</p> <p>.. whereas with quiet output:</p>
<pre><code> real 0m0.127s <pre><code> real 0m0.127s
user 0m0.125s user 0m0.125s
sys 0m0.001s</code></pre> sys 0m0.001s</code></pre>
<p>Of course it isn’t only down to the printing but the point is it slows it down <p>Of course it isn’t only down to the printing but the point is it slows it
significantly. Adding an option to print every X lines would go over the limit down significantly. Adding an option to print every X lines would go over
(<code>iocccsize -i</code> reports 2052!).</p> the limit (<code>iocccsize -i</code> reports 2052!).</p>
<p>Finally I’ll show a default example in normal output (I omit many lines showing <ol start="8" type="1">
instead <strong>[…]</strong>). Note that the real/user/sys times are from the <code>time</code> <li>Finally I’ll show a default example in normal output (I omit many lines showing
bash shell built-in utility: that isn’t output from my entry.</p> instead <code>[...]</code>). Note that the real/user/sys times are from the <code>time</code>
bash shell built-in utility: that isn’t output from my entry.</li>
</ol>
<pre><code> target &#39;METHINKS IT IS LIKE A WEASEL&#39; <pre><code> target &#39;METHINKS IT IS LIKE A WEASEL&#39;
mutation rate 1 mutation rate 1
Generation 0 Offspring 1: 4V YGY.GH/}_|&gt;Q1M.R8;KD[=(05 Generation 0 Offspring 1: 4V YGY.GH/}_|&gt;Q1M.R8;KD[=(05
@@ -904,11 +919,11 @@ bash shell built-in utility: that isn’t output from my entry.</p>
sys 0m0.001s</code></pre> sys 0m0.001s</code></pre>
<p>Keep in mind the way I display the generations and the fact that generation 0 <p>Keep in mind the way I display the generations and the fact that generation 0
has no parents; it is generation 1 that starts working towards the goal. You’ll has no parents; it is generation 1 that starts working towards the goal. You’ll
see also <strong>(mutation)</strong> at the end of the line at this point (if you enable see also <code>(mutation)</code> at the end of the line at this point (if you enable monkey
monkey mode you’ll find that it shows something else). The lines that only have mode you’ll find that it shows something else). The lines that only have
back-quote (“`”) are separators: you won’t see this between generation 0 and 1 but you will back-quote (<code>"\`"</code>) are separators: you won’t see this between generation 0
between future generations - as well as the final answer (if the answer is in and 1 but you will between future generations - as well as the final answer (if
generation 0 you won’t see the ``).</p> the answer is in generation 0 you won’t see the <code>`</code>).</p>
<div id="test"> <div id="test">
<p>One final thing to consider is that <strong>the program doesn’t directly read from a <p>One final thing to consider is that <strong>the program doesn’t directly read from a
file</strong>. This combined with the way the shell works could possibly confuse some file</strong>. This combined with the way the shell works could possibly confuse some
@@ -1044,17 +1059,22 @@ deciphering #7 help you decipher #5).</p>
<h3 id="beauty">Beauty</h3> <h3 id="beauty">Beauty</h3>
<p>Skip to <a href="#build">How to build</a>.</p> <p>Skip to <a href="#build">How to build</a>.</p>
<p>On the subject of beauty: the judges stated in the guidelines the following:</p> <p>On the subject of beauty: the judges stated in the guidelines the following:</p>
<pre><code> We want to get away from source that is simply **a compact blob of <blockquote>
octets.** Really try to be more creative than **blob coding.** *HINT!*</code></pre> <p>We want to get away from source that is simply <strong>a compact blob of octets.</strong>
Really try to be more creative than <strong>blob coding.</strong> <em>HINT!</em></p>
</blockquote>
<p>And if you’ll notice that although it <em>might look like a compact blob of octets</em> <p>And if you’ll notice that although it <em>might look like a compact blob of octets</em>
at first glance if you look throughout the file you’ll see two statements to (although not really: a blob is by definition roundish) at first glance if you
set your thinking straight:</p> look throughout the file you’ll see two statements to set your thinking
straight:</p>
<blockquote>
<p><strong>NO BLOB CODING</strong></p> <p><strong>NO BLOB CODING</strong></p>
<p><strong>THIS IS NOT A COMPACT BLOB OF OCTETS</strong></p> <p><strong>THIS IS NOT A COMPACT BLOB OF OCTETS</strong></p>
</blockquote>
<p>So you see even if your eyes are trying to deceive you they’re quite wrong. Yes <p>So you see even if your eyes are trying to deceive you they’re quite wrong. Yes
some of it might look like a blob but this is clearly false; <em>as all good some of it might look like a blob (for certain definitions of ‘blob’ :) ) but
programmers know if something is potentially confusing or misleading it should this is clearly false; <em>as all good programmers know if something is potentially
be made clear in the comments! :)</em></p> confusing or misleading it should be made clear in the comments! :)</em></p>
<div id="build"> <div id="build">
<h2 id="how-to-build"><strong>5. How to build</strong></h2> <h2 id="how-to-build"><strong>5. How to build</strong></h2>
</div> </div>
@@ -1187,7 +1207,8 @@ however leaving it as it is because this is what won.</p>
<p>Skip to <a href="#thoughts">Final thoughts</a>.</p> <p>Skip to <a href="#thoughts">Final thoughts</a>.</p>
<p>I have included a RPM spec file for those with a Red Hat based Linux <p>I have included a RPM spec file for those with a Red Hat based Linux
distribution; see <a href="rpm.html">rpm.html</a> for details (including why I implemented distribution; see <a href="rpm.html">rpm.html</a> for details (including why I implemented
this) if for some (strange or maybe even mad) reason you’re interested.</p> this) if for some (strange or maybe even mad) reason you’re interested, which
basically means nobody but me.</p>
<div id="thoughts"> <div id="thoughts">
<h2 id="final-thoughts"><strong>6. Final thoughts</strong></h2> <h2 id="final-thoughts"><strong>6. Final thoughts</strong></h2>
</div> </div>
@@ -1203,48 +1224,42 @@ two things I think are rather amusing (in order of least to most):</p>
<div id="dmr"> <div id="dmr">
<p>Dennis Ritchie’s Anti-Foreword:</p> <p>Dennis Ritchie’s Anti-Foreword:</p>
</div> </div>
<pre><code> Anti-Foreword <blockquote>
<p>Anti-Foreword</p>
By Dennis Ritchie <p>By Dennis Ritchie
From: dmr@plan9.research.att.com From: dmr@plan9.research.att.com
Date: Tue, 15 Mar 1994 00:38:07 EST Date: Tue, 15 Mar 1994 00:38:07 EST
Subject: anti-foreword Subject: anti-foreword</p>
<p>To the contributers to this book:</p>
To the contributers to this book: <p>I have succumbed to the temptation you offered in your preface: I do write you
off as envious malcontents and romantic keepers of memories. The systems you
I have succumbed to the temptation you offered in your preface: I do write you remember so fondly (TOPS-20, ITS, Multics, Lisp Machine, Cedar/Mesa, the Dorado)
off as envious malcontents and romantic keepers of memories. The systems you are not just out to pasture, they are fertilizing it from below.</p>
remember so fondly (TOPS-20, ITS, Multics, Lisp Machine, Cedar/Mesa, the Dorado) <p>Your judgments are not keen, they are intoxicated by metaphor. In the Preface
are not just out to pasture, they are fertilizing it from below. you suffer first from heat, lice, and malnourishment, then become prisoners in
a Gulag. In Chapter 1 you are in turn infected by a virus, racked by drug
Your judgments are not keen, they are intoxicated by metaphor. In the Preface addiction, and addled by puffiness of the genome.</p>
you suffer first from heat, lice, and malnourishment, then become prisoners in <p>Yet your prison without coherent design continues to imprison you. How can
a Gulag. In Chapter 1 you are in turn infected by a virus, racked by drug this be, if it has no strong places? The rational prisoner exploits the weak
addiction, and addled by puffiness of the genome. places, creates order from chaos: instead, collectives like the FSF vindicate
their jailers by building cells almost compatible with the existing ones, albeit
Yet your prison without coherent design continues to imprison you. How can with more features. The journalist with three undergraduate degrees from MIT,
this be, if it has no strong places? The rational prisoner exploits the weak the researcher at Microsoft, and the senior scientist at Apple might volunteer a
places, creates order from chaos: instead, collectives like the FSF vindicate few words about the regulations of the prisons to which they have been
their jailers by building cells almost compatible with the existing ones, albeit transferred.</p>
with more features. The journalist with three undergraduate degrees from MIT, <p>Your sense of the possible is in no sense pure: sometimes you want the same
the researcher at Microsoft, and the senior scientist at Apple might volunteer a thing you have, but wish you had done it yourselves; other times you want
few words about the regulations of the prisons to which they have been something different, but can’t seem to get people to use it; sometimes one
transferred. wonders why you just don’t shut up and tell people to buy a PC with Windows or a
Mac. No Gulag or lice, just a future whose intellectual tone and interaction
Your sense of the possible is in no sense pure: sometimes you want the same style is set by Sonic the Hedgehog. You claim to seek progress, but you succeed
thing you have, but wish you had done it yourselves; other times you want mainly in whining.</p>
something different, but can&#39;t seem to get people to use it; sometimes one <p>Here is my metaphor: your book is a pudding stuffed with apposite
wonders why you just don&#39;t shut up and tell people to buy a PC with Windows or a observations, many well-conceived. Like excrement, it contains enough undigested
Mac. No Gulag or lice, just a future whose intellectual tone and interaction nuggets of nutrition to sustain life for some. But it is not a tasty pie: it
style is set by Sonic the Hedgehog. You claim to seek progress, but you succeed reeks too much of contempt and of envy.</p>
mainly in whining. <p>Bon appetit!</p>
</blockquote>
Here is my metaphor: your book is a pudding stuffed with apposite
observations, many well-conceived. Like excrement, it contains enough undigested
nuggets of nutrition to sustain life for some. But it is not a tasty pie: it
reeks too much of contempt and of envy.
Bon appetit!</code></pre>
<p>Yes he misspelt <em>‘contributors’</em>! But then again we’re talking about obfuscation <p>Yes he misspelt <em>‘contributors’</em>! But then again we’re talking about obfuscation
and since it doesn’t break his message it’s not broken - it’s just obfuscated and since it doesn’t break his message it’s not broken - it’s just obfuscated
albeit not very much (and it still <em>‘compiles’!</em>); and isn’t that what this albeit not very much (and it still <em>‘compiles’!</em>); and isn’t that what this
@@ -1252,46 +1267,41 @@ contest is about? :)</p>
<div id="ken"> <div id="ken">
<p>Ken Thompson’s ending:</p> <p>Ken Thompson’s ending:</p>
</div> </div>
<pre><code> Creators Admit C, Unix Were Hoax <blockquote>
<p>Creators Admit C, Unix Were Hoax</p>
FOR IMMEDIATE RELEASE <p>FOR IMMEDIATE RELEASE</p>
<p>In an announcement that has stunned the computer industry, Ken Thompson,
In an announcement that has stunned the computer industry, Ken Thompson, Dennis Ritchie, and Brian Kernighan admitted that the Unix operating system and
Dennis Ritchie, and Brian Kernighan admitted that the Unix operating system and C programming language created by them is an elaborate April Fools prank kept
C programming language created by them is an elaborate April Fools prank kept alive for more than 20 years. Speaking at the recent UnixWorld Software
alive for more than 20 years. Speaking at the recent UnixWorld Software Development Forum, Thompson revealed the following:</p>
Development Forum, Thompson revealed the following: <p>“In 1969, AT&amp;T had just terminated their work with the GE/AT&amp;T Multics
project. Brian and I had just started working with an early release of Pascal
&quot;In 1969, AT&amp;T had just terminated their work with the GE/AT&amp;T Multics from Professor Nichlaus Wirth’s ETH labs in Switzerland, and we were impressed
project. Brian and I had just started working with an early release of Pascal with its elegant simplicity and power. Dennis had just finished reading Bored of
from Professor Nichlaus Wirth&#39;s ETH labs in Switzerland, and we were impressed the Rings, a hilarious National Lampoon parody of the great Tolkien Lord of the
with its elegant simplicity and power. Dennis had just finished reading Bored of Rings trilogy. As a lark, we decided to do parodies of the Multics environment
the Rings, a hilarious National Lampoon parody of the great Tolkien Lord of the and Pascal. Dennis and I were responsible for the operating environment. We
Rings trilogy. As a lark, we decided to do parodies of the Multics environment looked at Multics and designed the new system to be as complex and cryptic as
and Pascal. Dennis and I were responsible for the operating environment. We possible to maximize casual users’ frustration levels, calling it Unix as a
looked at Multics and designed the new system to be as complex and cryptic as parody of Multics, as well as other more risque allusions.</p>
possible to maximize casual users&#39; frustration levels, calling it Unix as a <p>“Then Dennis and Brian worked on a truly warped version of Pascal, called”A.” When we found others were actually trying to programs with A, we quickly
parody of Multics, as well as other more risque allusions. added additional cryptic features and evolved into B, BCPL, and finally C. We
stopped when we got a clean compile on the following syntax:</p>
&quot;Then Dennis and Brian worked on a truly warped version of Pascal, called &quot;A.&quot; <p><code>for(;P("\n"),R=;P("|"))for(e=C;e=P("_"+(*u++/</code><br>
When we found others were actually trying to programs with A, we quickly added <code>8)%2))P("|"+(*u/4)%2);</code></p>
additional cryptic features and evolved into B, BCPL, and finally C. We stopped <p>“To think that modern programmers would try to use a language that allowed
when we got a clean compile on the following syntax:</code></pre> such a statement was beyond our comprehension! We actually thought of selling
<pre><code> for(;P(&quot;\n&quot;),R=;P(&quot;|&quot;))for(e=C;e=P(&quot;_&quot;+(*u++/ this to the Soviets to set their computer science progress back 20 or more
8)%2))P(&quot;|&quot;+(*u/4)%2);</code></pre> years. Imagine our surprise when AT&amp;T and other U.S. corporations actually began
<pre><code> &quot;To think that modern programmers would try to use a language that allowed trying to use Unix and C! It has taken them 20 years to develop enough
such a statement was beyond our comprehension! We actually thought of selling expertise to generate even marginally useful applications using this 1960s
this to the Soviets to set their computer science progress back 20 or more technological parody, but we are impressed with the tenacity (if not common
years. Imagine our surprise when AT&amp;T and other U.S. corporations actually began sense) of the general Unix and C programmer.</p>
trying to use Unix and C! It has taken them 20 years to develop enough <p>“In any event, Brian, Dennis, and I have been working exclusively in Lisp
expertise to generate even marginally useful applications using this 1960s on the Apple Macintosh for the past few years and feel really guilty about the
technological parody, but we are impressed with the tenacity (if not common chaos, confusion, and truly bad programming that has resulted from our silly
sense) of the general Unix and C programmer. prank so long ago.”</p>
&quot;In any event, Brian, Dennis, and I have been working exclusively in Lisp on
the Apple Macintosh for the past few years and feel really guilty about the
chaos, confusion, and truly bad programming that has resulted from our silly
prank so long ago.&quot;</code></pre>
<p>Major Unix and C vendors and customers, including AT&amp;T, Microsoft, <p>Major Unix and C vendors and customers, including AT&amp;T, Microsoft,
Hewlett-Packard, GTE, NCR, and DEC have refused comment at this time. Borland Hewlett-Packard, GTE, NCR, and DEC have refused comment at this time. Borland
International, a leading vendor of Pascal and C tools, including the popular International, a leading vendor of Pascal and C tools, including the popular
@@ -1303,13 +1313,15 @@ the RS/6000, merely stating “Workplace OS will be available Real Soon Now.”
cryptic statement, Professor Wirth of the ETH Institute and father of the cryptic statement, Professor Wirth of the ETH Institute and father of the
Pascal, Modula 2, and Oberon structured languages, merely stated that P. T. Pascal, Modula 2, and Oberon structured languages, merely stated that P. T.
Barnum was correct.</p> Barnum was correct.</p>
</blockquote>
<hr>
<p>So is it a hoax about a non-hoax, a non-hoax about a hoax, a non-hoax about a <p>So is it a hoax about a non-hoax, a non-hoax about a hoax, a non-hoax about a
non-hoax or is it a hoax about a hoax ? :) And if it’s any of those what does it non-hoax or is it a hoax about a hoax ? :) And if it’s any of those what does it
mean about Unix and C?** And if a hoax is involved <em>what is the hoax?</em> The pedant mean about Unix and C?** And if a hoax is involved <em>what is the hoax?</em> The pedant
and Tolkienist that I am has to state that <strong>Tolkien didn’t consider The Lord of and Tolkienist that I am has to state that <strong>Tolkien didn’t consider The Lord of
the Rings a trilogy</strong> <em>(and he made that very clear)</em> but that doesn’t take away the Rings a trilogy</strong> <em>(and he made that very clear)</em> but that doesn’t take away
from the humour by any stretch (<em>if anyone wants me to elaborate or debate the from the humour by any stretch (<em>if anyone wants me to elaborate or debate the
matter do send me an email - I love Tolkien’s legendarium and having another matter do send me an email - I love Tolkien’s Legendarium and having another
person to talk about it with is more than welcome!</em>). Ken suggested that there person to talk about it with is more than welcome!</em>). Ken suggested that there
is a lack of common sense but since he was part of its creation I don’t think is a lack of common sense but since he was part of its creation I don’t think
it’s a bad thing; <strong>on the contrary it makes all of us C programmers even more it’s a bad thing; <strong>on the contrary it makes all of us C programmers even more
+7 -29
View File
@@ -392,38 +392,16 @@
<h2 id="an-rpm-what-kind-of-absolute-madness-is-this">An RPM: what kind of absolute MADNESS is this ?</h2> <h2 id="an-rpm-what-kind-of-absolute-madness-is-this">An RPM: what kind of absolute MADNESS is this ?</h2>
<p>What kind of crazy idea is this? Install an IOCCC entry? I realise it seems odd <p>What kind of crazy idea is this? Install an IOCCC entry? I realise it seems odd
(at best) so why did I make a rpm spec file and why did I hint at building RPMs (at best) so why did I make a rpm spec file and why did I hint at building RPMs
for others? I can’t say precisely; <strong>certainly I’m under no impression that for others? I can’t say precisely; <strong>certainly I’m under <em>NO IMPRESSION</em> that
anyone else will want to use it</strong> <em>but the entry was fun enough for me that I anyone else will want to use it</strong> <em>but the entry was fun enough for me that I
actually will</em> (a number of my programs over the years are programs I actually actually will</em> (a number of my programs over the years are programs I actually
install and I already have done so with this entry).</p> install and I already have done so with this entry).</p>
<p>I already have my own RPM repository and initially after having won I set it up <p>Nonetheless I am keeping the
so that I could host the weasel rpm (binary and source) there. At the same time <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2018/ferguson/weasel.spec">weasel.spec</a> file in the entry as it was part of my
though I feel the entry belongs on the IOCCC website; that is to say the only submission but I won’t explain here how to set up the build environment or how
place the raw files should be downloadable from is the IOCCC website itself. to build a RPM; even if anyone did want to (and I know nobody else will) want to
Simon Cooper (the judge who at the time dealt with setting up the entries on the do this, they can figure it out themselves. Again, this was more personal but
IOCCC website) asked me if there is any real attachment in having the RPM built since the Judges’ remarks were fun for me I am keeping this here anyway.</p>
as part of the entry and the answer is ‘no’. He did suggest too that if I were
to have the RPM hosted on the IOCCC website not only would it place a burden on
me to keep it up to date (not that it ever needed to be updated) but it would
place a burden on the judges. This is no longer true with GitHub but anyway
since this was for personal reasons I decided that:</p>
<ul>
<li><p>I would not host the actual source code or scripts on my website; they will
remain on the IOCCC website. This will most likely never change; instead I would
link to the entry directory so that they remain where they belong: the IOCCC
website itself. I have set up an <a href="https://ioccc.xexyl.net/2018/weasel/errata">errata page</a> however should there be anything
requiring a fix.</p></li>
<li><p>I am keeping the weasel.spec file in the entry as it was part of my
submission but I do not explain here how to set up the build environment or how
to build a RPM: if you know how to use <strong>rpmbuild</strong> then you should be able to
work it out. Again that’s a crazy idea but again it was there and it was part of
the judges’ comments (which I liked a lot) which is yet another reason I kept
it.</p></li>
<li><p>Because I strongly suspect (in other words since I know) I am the only one
who has any desire for actually installing an IOCCC entry I did not do anything
further. Nevertheless more information on my entry can be found at
<a href="https://ioccc.xexyl.net/2018/weasel">https://ioccc.xexyl.net/2018/weasel</a>.</p></li>
</ul>
<hr style="width:10%;text-align:left;margin-left:0"> <hr style="width:10%;text-align:left;margin-left:0">
<p>Jump to: <a href="#">top</a></p> <p>Jump to: <a href="#">top</a></p>
<!-- <!--
+7 -35
View File
@@ -2,45 +2,17 @@
What kind of crazy idea is this? Install an IOCCC entry? I realise it seems odd What kind of crazy idea is this? Install an IOCCC entry? I realise it seems odd
(at best) so why did I make a rpm spec file and why did I hint at building RPMs (at best) so why did I make a rpm spec file and why did I hint at building RPMs
for others? I can't say precisely; **certainly I'm under no impression that for others? I can't say precisely; **certainly I'm under _NO IMPRESSION_ that
anyone else will want to use it** *but the entry was fun enough for me that I anyone else will want to use it** *but the entry was fun enough for me that I
actually will* (a number of my programs over the years are programs I actually actually will* (a number of my programs over the years are programs I actually
install and I already have done so with this entry). install and I already have done so with this entry).
I already have my own RPM repository and initially after having won I set it up Nonetheless I am keeping the
so that I could host the weasel rpm (binary and source) there. At the same time [weasel.spec](%%REPO_URL%%/2018/ferguson/weasel.spec) file in the entry as it was part of my
though I feel the entry belongs on the IOCCC website; that is to say the only submission but I won't explain here how to set up the build environment or how
place the raw files should be downloadable from is the IOCCC website itself. to build a RPM; even if anyone did want to (and I know nobody else will) want to
Simon Cooper (the judge who at the time dealt with setting up the entries on the do this, they can figure it out themselves. Again, this was more personal but
IOCCC website) asked me if there is any real attachment in having the RPM built since the Judges' remarks were fun for me I am keeping this here anyway.
as part of the entry and the answer is 'no'. He did suggest too that if I were
to have the RPM hosted on the IOCCC website not only would it place a burden on
me to keep it up to date (not that it ever needed to be updated) but it would
place a burden on the judges. This is no longer true with GitHub but anyway
since this was for personal reasons I decided that:
* I would not host the actual source code or scripts on my website; they will
remain on the IOCCC website. This will most likely never change; instead I would
link to the entry directory so that they remain where they belong: the IOCCC
website itself. I have set up an [errata page][] however should there be anything
requiring a fix.
* I am keeping the weasel.spec file in the entry as it was part of my
submission but I do not explain here how to set up the build environment or how
to build a RPM: if you know how to use **rpmbuild** then you should be able to
work it out. Again that's a crazy idea but again it was there and it was part of
the judges' comments (which I liked a lot) which is yet another reason I kept
it.
* Because I strongly suspect (in other words since I know) I am the only one
who has any desire for actually installing an IOCCC entry I did not do anything
further. Nevertheless more information on my entry can be found at
[https://ioccc.xexyl.net/2018/weasel][].
[errata page]: https://ioccc.xexyl.net/2018/weasel/errata
[https://ioccc.xexyl.net/2018/weasel]: https://ioccc.xexyl.net/2018/weasel
<hr style="width:10%;text-align:left;margin-left:0"> <hr style="width:10%;text-align:left;margin-left:0">
+26 -31
View File
@@ -231,7 +231,7 @@ Let's try some:
``` ```
The program you've just run was the [winning entry of the first IOCCC contest from The program you've just run was the [winning entry of the first IOCCC contest from
1984] [1] (or was it 1894?), a personal favorite of mine. It is rather 1984][1] (or was it 1894?), a personal favorite of mine. It is rather
tightly bound to running on either a PDP-11 or a VAX-11. Now you have one. tightly bound to running on either a PDP-11 or a VAX-11. Now you have one.
Hitting Control-C will return you to the BSD UNIX prompt. Hitting Control-D Hitting Control-C will return you to the BSD UNIX prompt. Hitting Control-D
@@ -245,7 +245,7 @@ well enough with whatever sort of ANSI terminal emulation you are using.
Note that I have not mounted the `/usr` disk here, so some commands from Note that I have not mounted the `/usr` disk here, so some commands from
`/usr/bin` will be missing, along with all of the `man` pages. They are `/usr/bin` will be missing, along with all of the `man` pages. They are
[available online] [2] if you need them. Adding a second RK05 disk was [available online][2] if you need them. Adding a second RK05 disk was
possible, but I didn't get around to it... As the Judges can no doubt attest, possible, but I didn't get around to it... As the Judges can no doubt attest,
"Mid 2017" creeps up on you quicker than you expect. :) "Mid 2017" creeps up on you quicker than you expect. :)
@@ -320,7 +320,7 @@ Assuming you're more careful than that, we can try a few commands:
Why is Version 6 interesting? Well, it was the oldest version that I could Why is Version 6 interesting? Well, it was the oldest version that I could
find a boot image of that had a C compiler... This C compiler is recognizably find a boot image of that had a C compiler... This C compiler is recognizably
C, but not quite the same syntax as we have today. It's much closer to the C, but not quite the same syntax as we have today. It's much closer to the
[B language] [3] from which it is derived. In particular, this C compiler [B language][3] from which it is derived. In particular, this C compiler
would not be able to compile `mullender.c` (as simple as it is), because the would not be able to compile `mullender.c` (as simple as it is), because the
following syntax features don't exist yet: following syntax features don't exist yet:
@@ -351,10 +351,10 @@ back to the BSD emulation, you should either delete `rk05.fs` or do a
We now set the Wayback Machine to the very start of it all, 1969. We now set the Wayback Machine to the very start of it all, 1969.
[The story] [4] here is interesting and well worth a read. Bell Labs was [The story][4] here is interesting and well worth a read. Bell Labs was
pulling out of the Multics project and Ken Thompson and his colleagues had pulling out of the Multics project and Ken Thompson and his colleagues had
become accustomed to the relatively nice programming environment. They also become accustomed to the relatively nice programming environment. They also
enjoyed the early computer game [*Space Travel*] [5] and wanted another system enjoyed the early computer game [*Space Travel*][5] and wanted another system
to run it on. They found a PDP-7 which was already obsolete at the time to to run it on. They found a PDP-7 which was already obsolete at the time to
port *Space Travel* to. The primitive programming environment influenced port *Space Travel* to. The primitive programming environment influenced
Thompson to recreate parts of the Multics experience in the much more Thompson to recreate parts of the Multics experience in the much more
@@ -385,14 +385,11 @@ respectively. Let's try the Dennis Richie's `dmr` account:
Even though this is not Ken's doing, I feel this gives me licence to Even though this is not Ken's doing, I feel this gives me licence to
include this quote from the BSD `fortune` program: include this quote from the BSD `fortune` program:
``` > Ken Thompson has an automobile which he helped design. Unlike most
Ken Thompson has an automobile which he helped design. Unlike automobiles, it has neither speedometer, nor gas gauge, nor any of the numerous
most automobiles, it has neither speedometer, nor gas gauge, idiot lights which plague the modern driver. Rather, if the driver makes any
nor any of the numerous idiot lights which plague the modern mistake, a giant "?" lights up in the center of the dashboard. "The experienced
driver. Rather, if the driver makes any mistake, a giant "?" driver", he says, "will usually know what's wrong."
lights up in the center of the dashboard. "The experienced
driver", he says, "will usually know what's wrong."
```
What's the deal here? Well, that's a slightly long story. The short version What's the deal here? Well, that's a slightly long story. The short version
is we have gone so far back in the history of UNIX that *we don't have is we have gone so far back in the history of UNIX that *we don't have
@@ -461,16 +458,14 @@ Now `ls` will work, and we can try some other things while we are here:
``` ```
The last command is invoking the compiler for an extremely early version of The last command is invoking the compiler for an extremely early version of
the [B programming language] [3], the predecessor to C. Thompson missed the the [B programming language][3], the predecessor to C. Thompson missed the
convenience of writing code in a high-level language -- Multics was written convenience of writing code in a high-level language -- Multics was written
in a version of PL/1 -- and wanted the same convenience in UNIX. He preferred in a version of PL/1 -- and wanted the same convenience in UNIX. He preferred
BCPL (a typeless language) to PL/1. As Dennis Ritchie [wrote] [6]: BCPL (a typeless language) to PL/1. As Dennis Ritchie [wrote][6]:
> B can be thought of as C without types; more accurately, it is BCPL
squeezed into 8K bytes of memory and filtered through Thompson's brain.
```
B can be thought of as C without types; more accurately,
it is BCPL squeezed into 8K bytes of memory and filtered
through Thompson's brain.
```
A look at the B reference manual will show the strong correlation with C, and A look at the B reference manual will show the strong correlation with C, and
shows the source of a lot of C's mysteriousness -- some of which is preserved shows the source of a lot of C's mysteriousness -- some of which is preserved
@@ -531,14 +526,14 @@ version of C, it felt cheap, as it would be
It was during this time that I discovered that in 2016, members of the Unix It was during this time that I discovered that in 2016, members of the Unix
Heritage Society got access to [printouts of assembly-language source for the Heritage Society got access to [printouts of assembly-language source for the
original version of UNIX] [7]. With what was a [huge amount of work] [8], original version of UNIX][7]. With what was a [huge amount of work][8],
they scanned in the printouts, fixed up the OCR translations, built assembler they scanned in the printouts, fixed up the OCR translations, built assembler
and file system tools from scratch and made an accurate emulation of and file system tools from scratch and made an accurate emulation of
Thompson's PDP-7 that allowed them to get the system up and running. Although Thompson's PDP-7 that allowed them to get the system up and running. Although
source for the entire kernel and about half of the user-space commands were source for the entire kernel and about half of the user-space commands were
present (including the runtime and libraries for the B compiler), the present (including the runtime and libraries for the B compiler), the
remainder needed to be written from scratch, including the shell. The final remainder needed to be written from scratch, including the shell. The final
results of the project are [available on GitHub] [9]. results of the project are [available on GitHub][9].
None of this was remotely easy (as I was to discover myself). The PDP-7 is None of this was remotely easy (as I was to discover myself). The PDP-7 is
long gone, and the documentation for it is less complete than one would like. long gone, and the documentation for it is less complete than one would like.
@@ -563,7 +558,7 @@ division and shifting.
* Perforated Tape Reader Type 444. * Perforated Tape Reader Type 444.
* RB09 Fixed Disk Controller. * RB09 Fixed Disk Controller.
The [PDP-7] [10] is an odd duck by modern computer standards: The [PDP-7][10] is an odd duck by modern computer standards:
* 18 bit words, with no byte addressing. * 18 bit words, with no byte addressing.
* Both one's and two's complement math (there is `ADD` for one's complement and * Both one's and two's complement math (there is `ADD` for one's complement and
@@ -588,7 +583,7 @@ memory locations to support. Being clever also helps.
* I/O is done with dedicated I/O instructions (which are also microcoded). * I/O is done with dedicated I/O instructions (which are also microcoded).
* The RB09 disk controller gets a special mention here because of its * The RB09 disk controller gets a special mention here because of its
particularly annoying encoding of track and sector offsets in particularly annoying encoding of track and sector offsets in
[packed BCD] [11]. A non-trivial amount of code space in the simulator [packed BCD][11]. A non-trivial amount of code space in the simulator
is needed to convert into and out of BCD, along with an equivalent amount is needed to convert into and out of BCD, along with an equivalent amount
of code in the UNIX kernel itself. of code in the UNIX kernel itself.
@@ -639,7 +634,7 @@ You still have two other UNICES to play with.
What about the other two UNIX variants? These are both covered by licences What about the other two UNIX variants? These are both covered by licences
that allow me to use them. Back in 2002, Caldera International released that allow me to use them. Back in 2002, Caldera International released
Research Unix versions 1-7 and 32V under a [permissive BSD-like license] [12]. Research Unix versions 1-7 and 32V under a [permissive BSD-like license][12].
BSD UNIX is based off of v7 UNIX, and of course has its own permissive BSD UNIX is based off of v7 UNIX, and of course has its own permissive
BSD licence. And in 2017, Nokia also released versions 8-10 under the BSD licence. And in 2017, Nokia also released versions 8-10 under the
condition that it will not assert copyright rights for non-commercial use. condition that it will not assert copyright rights for non-commercial use.
@@ -719,7 +714,7 @@ came about from the realization that I needed a response to the late-discovered
licence issue, I'm quite pleased with the result -- it enables an interesting licence issue, I'm quite pleased with the result -- it enables an interesting
window on the dawn of the UNIX era. I feel that someone should complete the window on the dawn of the UNIX era. I feel that someone should complete the
circle here by emulating a VAX 780 on the PDP-11 and run 4.2BSD on it, so that circle here by emulating a VAX 780 on the PDP-11 and run 4.2BSD on it, so that
we can get the [original runtime environment used for the first IOCCC] [13]. we can get the [original runtime environment used for the first IOCCC][13].
### Compile-time Options: ### Compile-time Options:
@@ -757,7 +752,7 @@ you will need to escape `$` as `$$` to protect it from `make`.
### What is the ASCII art supposed to be? ### What is the ASCII art supposed to be?
The ASCII art represents a torn piece of [paper tape] [14]. The ASCII art represents a torn piece of [paper tape][14].
### Acknowledgements ### Acknowledgements
@@ -765,19 +760,19 @@ The ASCII art represents a torn piece of [paper tape] [14].
None of this could have been possible without the hard work of None of this could have been possible without the hard work of
* Warren Toomey and the other members of the * Warren Toomey and the other members of the
[The Unix Heritage Society] [15] [The Unix Heritage Society][15]
* Robert M. Supnik and the other contributors to [SimH] [16], the simulator * Robert M. Supnik and the other contributors to [SimH][16], the simulator
for historic computer architectures. The number of times I needed to for historic computer architectures. The number of times I needed to
"Use the Source, Luke" on SimH to unravel some dark corner of these "Use the Source, Luke" on SimH to unravel some dark corner of these
machines was uncountable. machines was uncountable.
* [Bitsavers] [17], which acquired, scanned and preserved all the manuals * [Bitsavers][17], which acquired, scanned and preserved all the manuals
I spent many hours squinting at. I spent many hours squinting at.
* Ken Thompson, Dennis Ritchie, Brian Kernigan, M\. D\. McIlroy, J\. F\. * Ken Thompson, Dennis Ritchie, Brian Kernigan, M\. D\. McIlroy, J\. F\.
Osssanna, Rudd Canaday and the other members of the Bell Labs Osssanna, Rudd Canaday and the other members of the Bell Labs
Computing Science Research Center who were responsible for the invention Computing Science Research Center who were responsible for the invention
of UNIX, the C programming language, and the innumerable other innovations of UNIX, the C programming language, and the innumerable other innovations
that we now take for granted as part of the modern software landscape. that we now take for granted as part of the modern software landscape.
In particular, the [home page of the late Dennis Ritchie] [18] contained In particular, the [home page of the late Dennis Ritchie][18] contained
a trove of useful information on the evolution of UNIX and C and is a trove of useful information on the evolution of UNIX and C and is
recommended for perusal by others who share my peculiar retro computing recommended for perusal by others who share my peculiar retro computing
passion. passion.
+31 -29
View File
@@ -548,8 +548,8 @@ Let’s try some:</p>
/dev/rk0 / 1958 1688 270 86% /dev/rk0 / 1958 1688 270 86%
# bin/cc mullender.c # bin/cc mullender.c
# ./a.out</code></pre> # ./a.out</code></pre>
<p>The program you’ve just run was the [winning entry of the first IOCCC contest from <p>The program you’ve just run was the <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1984/mullender/mullender.c" title="mullender.c">winning entry of the first IOCCC contest from
1984] <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1984/mullender/mullender.c" title="mullender.c">1</a> (or was it 1894?), a personal favorite of mine. It is rather 1984</a> (or was it 1894?), a personal favorite of mine. It is rather
tightly bound to running on either a PDP-11 or a VAX-11. Now you have one.</p> tightly bound to running on either a PDP-11 or a VAX-11. Now you have one.</p>
<p>Hitting Control-C will return you to the BSD UNIX prompt. Hitting Control-D <p>Hitting Control-C will return you to the BSD UNIX prompt. Hitting Control-D
will log you out of the single-user session and get you back to the <code>:login:</code> will log you out of the single-user session and get you back to the <code>:login:</code>
@@ -561,7 +561,7 @@ carriage. I’ve also predefined <code>TERM</code> to <code>vt100</code>, which
well enough with whatever sort of ANSI terminal emulation you are using.</p> well enough with whatever sort of ANSI terminal emulation you are using.</p>
<p>Note that I have not mounted the <code>/usr</code> disk here, so some commands from <p>Note that I have not mounted the <code>/usr</code> disk here, so some commands from
<code>/usr/bin</code> will be missing, along with all of the <code>man</code> pages. They are <code>/usr/bin</code> will be missing, along with all of the <code>man</code> pages. They are
[available online] <a href="http://minnie.tuhs.org/cgi-bin/utree.pl?file=2.9BSD" title="2.9 BSD">2</a> if you need them. Adding a second RK05 disk was <a href="http://minnie.tuhs.org/cgi-bin/utree.pl?file=2.9BSD" title="2.9 BSD">available online</a> if you need them. Adding a second RK05 disk was
possible, but I didn’t get around to it… As the Judges can no doubt attest, possible, but I didn’t get around to it… As the Judges can no doubt attest,
“Mid 2017” creeps up on you quicker than you expect. :)</p> “Mid 2017” creeps up on you quicker than you expect. :)</p>
<p>Once you’ve had enough fun in BSD 2.9, type Control-E to exit the emulation.</p> <p>Once you’ve had enough fun in BSD 2.9, type Control-E to exit the emulation.</p>
@@ -617,7 +617,7 @@ may need to use Control-E to quit the emulation.</p>
<p>Why is Version 6 interesting? Well, it was the oldest version that I could <p>Why is Version 6 interesting? Well, it was the oldest version that I could
find a boot image of that had a C compiler… This C compiler is recognizably find a boot image of that had a C compiler… This C compiler is recognizably
C, but not quite the same syntax as we have today. It’s much closer to the C, but not quite the same syntax as we have today. It’s much closer to the
[B language] <a href="https://www.bell-labs.com/usr/dmr/www/kbman.html" title="B Language">3</a> from which it is derived. In particular, this C compiler <a href="https://www.bell-labs.com/usr/dmr/www/kbman.html" title="B Language">B language</a> from which it is derived. In particular, this C compiler
would not be able to compile <code>mullender.c</code> (as simple as it is), because the would not be able to compile <code>mullender.c</code> (as simple as it is), because the
following syntax features don’t exist yet:</p> following syntax features don’t exist yet:</p>
<ul> <ul>
@@ -641,10 +641,10 @@ back to the BSD emulation, you should either delete <code>rk05.fs</code> or do a
<code>make clean</code> before you do a <code>make</code>.</p> <code>make clean</code> before you do a <code>make</code>.</p>
<h3 id="building-and-running-unix-v0">Building and Running UNIX v0:</h3> <h3 id="building-and-running-unix-v0">Building and Running UNIX v0:</h3>
<p>We now set the Wayback Machine to the very start of it all, 1969.</p> <p>We now set the Wayback Machine to the very start of it all, 1969.</p>
<p>[The story] <a href="https://www.bell-labs.com/usr/dmr/www/hist.html" title="UNIX history">4</a> here is interesting and well worth a read. Bell Labs was <p><a href="https://www.bell-labs.com/usr/dmr/www/hist.html" title="UNIX history">The story</a> here is interesting and well worth a read. Bell Labs was
pulling out of the Multics project and Ken Thompson and his colleagues had pulling out of the Multics project and Ken Thompson and his colleagues had
become accustomed to the relatively nice programming environment. They also become accustomed to the relatively nice programming environment. They also
enjoyed the early computer game [<em>Space Travel</em>] <a href="https://www.bell-labs.com/usr/dmr/www/spacetravel.html" title="Space Travel">5</a> and wanted another system enjoyed the early computer game <a href="https://www.bell-labs.com/usr/dmr/www/spacetravel.html" title="Space Travel"><em>Space Travel</em></a> and wanted another system
to run it on. They found a PDP-7 which was already obsolete at the time to to run it on. They found a PDP-7 which was already obsolete at the time to
port <em>Space Travel</em> to. The primitive programming environment influenced port <em>Space Travel</em> to. The primitive programming environment influenced
Thompson to recreate parts of the Multics experience in the much more Thompson to recreate parts of the Multics experience in the much more
@@ -665,12 +665,13 @@ respectively. Let’s try the Dennis Richie’s <code>dmr</code> account:</p>
. ?</code></pre> . ?</code></pre>
<p>Even though this is not Ken’s doing, I feel this gives me licence to <p>Even though this is not Ken’s doing, I feel this gives me licence to
include this quote from the BSD <code>fortune</code> program:</p> include this quote from the BSD <code>fortune</code> program:</p>
<pre><code> Ken Thompson has an automobile which he helped design. Unlike <blockquote>
most automobiles, it has neither speedometer, nor gas gauge, <p>Ken Thompson has an automobile which he helped design. Unlike most
nor any of the numerous idiot lights which plague the modern automobiles, it has neither speedometer, nor gas gauge, nor any of the numerous
driver. Rather, if the driver makes any mistake, a giant &quot;?&quot; idiot lights which plague the modern driver. Rather, if the driver makes any
lights up in the center of the dashboard. &quot;The experienced mistake, a giant “?” lights up in the center of the dashboard. “The experienced
driver&quot;, he says, &quot;will usually know what&#39;s wrong.&quot;</code></pre> driver”, he says, “will usually know what’s wrong.”</p>
</blockquote>
<p>What’s the deal here? Well, that’s a slightly long story. The short version <p>What’s the deal here? Well, that’s a slightly long story. The short version
is we have gone so far back in the history of UNIX that <em>we don’t have is we have gone so far back in the history of UNIX that <em>we don’t have
filesystem paths yet</em>. In other words, we can’t say something like filesystem paths yet</em>. In other words, we can’t say something like
@@ -728,13 +729,14 @@ directory, and the new name).</p>
Hello, World! Hello, World!
@</code></pre> @</code></pre>
<p>The last command is invoking the compiler for an extremely early version of <p>The last command is invoking the compiler for an extremely early version of
the [B programming language] <a href="https://www.bell-labs.com/usr/dmr/www/kbman.html" title="B Language">3</a>, the predecessor to C. Thompson missed the the <a href="https://www.bell-labs.com/usr/dmr/www/kbman.html" title="B Language">B programming language</a>, the predecessor to C. Thompson missed the
convenience of writing code in a high-level language – Multics was written convenience of writing code in a high-level language – Multics was written
in a version of PL/1 – and wanted the same convenience in UNIX. He preferred in a version of PL/1 – and wanted the same convenience in UNIX. He preferred
BCPL (a typeless language) to PL/1. As Dennis Ritchie [wrote] <a href="https://www.bell-labs.com/usr/dmr/www/chist.html" title="C History">6</a>:</p> BCPL (a typeless language) to PL/1. As Dennis Ritchie <a href="https://www.bell-labs.com/usr/dmr/www/chist.html" title="C History">wrote</a>:</p>
<pre><code> B can be thought of as C without types; more accurately, <blockquote>
it is BCPL squeezed into 8K bytes of memory and filtered <p>B can be thought of as C without types; more accurately, it is BCPL
through Thompson&#39;s brain.</code></pre> squeezed into 8K bytes of memory and filtered through Thompson’s brain.</p>
</blockquote>
<p>A look at the B reference manual will show the strong correlation with C, and <p>A look at the B reference manual will show the strong correlation with C, and
shows the source of a lot of C’s mysteriousness – some of which is preserved shows the source of a lot of C’s mysteriousness – some of which is preserved
simply so that C could compile the <em>dozens</em> of lines of existing B code…</p> simply so that C could compile the <em>dozens</em> of lines of existing B code…</p>
@@ -787,15 +789,15 @@ that was still a possibility on an interpreted version of B or a stripped-down
version of C, it felt cheap, as it would be version of C, it felt cheap, as it would be
<a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1984/mullender/mullender.c">mullender.c</a> only in spirit.</p> <a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1984/mullender/mullender.c">mullender.c</a> only in spirit.</p>
<p>It was during this time that I discovered that in 2016, members of the Unix <p>It was during this time that I discovered that in 2016, members of the Unix
Heritage Society got access to [printouts of assembly-language source for the Heritage Society got access to <a href="http://www.tuhs.org/Archive/Distributions/Research/McIlroy_v0/" title="V0 Scans">printouts of assembly-language source for the
original version of UNIX] <a href="http://www.tuhs.org/Archive/Distributions/Research/McIlroy_v0/" title="V0 Scans">7</a>. With what was a [huge amount of work] <a href="https://web.archive.org/web/20180826162445/https://minnie.tuhs.org//Y5/wkt_hapop_paper.pdf" title="UNIX v0">8</a>, original version of UNIX</a>. With what was a <a href="https://web.archive.org/web/20180826162445/https://minnie.tuhs.org//Y5/wkt_hapop_paper.pdf" title="UNIX v0">huge amount of work</a>,
they scanned in the printouts, fixed up the OCR translations, built assembler they scanned in the printouts, fixed up the OCR translations, built assembler
and file system tools from scratch and made an accurate emulation of and file system tools from scratch and made an accurate emulation of
Thompson’s PDP-7 that allowed them to get the system up and running. Although Thompson’s PDP-7 that allowed them to get the system up and running. Although
source for the entire kernel and about half of the user-space commands were source for the entire kernel and about half of the user-space commands were
present (including the runtime and libraries for the B compiler), the present (including the runtime and libraries for the B compiler), the
remainder needed to be written from scratch, including the shell. The final remainder needed to be written from scratch, including the shell. The final
results of the project are [available on GitHub] <a href="https://github.com/DoctorWkt/pdp7-unix" title="PDP-7 UNIX">9</a>.</p> results of the project are <a href="https://github.com/DoctorWkt/pdp7-unix" title="PDP-7 UNIX">available on GitHub</a>.</p>
<p>None of this was remotely easy (as I was to discover myself). The PDP-7 is <p>None of this was remotely easy (as I was to discover myself). The PDP-7 is
long gone, and the documentation for it is less complete than one would like. long gone, and the documentation for it is less complete than one would like.
In addition, the devices attached for it were a bit of a mystery. The disk In addition, the devices attached for it were a bit of a mystery. The disk
@@ -817,7 +819,7 @@ division and shifting.</li>
<li>Perforated Tape Reader Type 444.</li> <li>Perforated Tape Reader Type 444.</li>
<li>RB09 Fixed Disk Controller.</li> <li>RB09 Fixed Disk Controller.</li>
</ul> </ul>
<p>The [PDP-7] <a href="http://bitsavers.trailing-edge.com/pdf/dec/pdp7/F-75P_PDP7prelimUM_Dec64.pdf" title="PDP-7 Manual">10</a> is an odd duck by modern computer standards:</p> <p>The <a href="http://bitsavers.trailing-edge.com/pdf/dec/pdp7/F-75P_PDP7prelimUM_Dec64.pdf" title="PDP-7 Manual">PDP-7</a> is an odd duck by modern computer standards:</p>
<ul> <ul>
<li>18 bit words, with no byte addressing.</li> <li>18 bit words, with no byte addressing.</li>
<li>Both one’s and two’s complement math (there is <code>ADD</code> for one’s complement and <li>Both one’s and two’s complement math (there is <code>ADD</code> for one’s complement and
@@ -842,7 +844,7 @@ memory locations to support. Being clever also helps.</li>
<li>I/O is done with dedicated I/O instructions (which are also microcoded).</li> <li>I/O is done with dedicated I/O instructions (which are also microcoded).</li>
<li>The RB09 disk controller gets a special mention here because of its <li>The RB09 disk controller gets a special mention here because of its
particularly annoying encoding of track and sector offsets in particularly annoying encoding of track and sector offsets in
[packed BCD] <a href="https://en.wikipedia.org/wiki/Binary-coded_decimal" title="BCD">11</a>. A non-trivial amount of code space in the simulator <a href="https://en.wikipedia.org/wiki/Binary-coded_decimal" title="BCD">packed BCD</a>. A non-trivial amount of code space in the simulator
is needed to convert into and out of BCD, along with an equivalent amount is needed to convert into and out of BCD, along with an equivalent amount
of code in the UNIX kernel itself.</li> of code in the UNIX kernel itself.</li>
</ul> </ul>
@@ -885,7 +887,7 @@ can just not do so. Delete the lines from the <code>Makefile</code> and sleep we
You still have two other UNICES to play with.</p> You still have two other UNICES to play with.</p>
<p>What about the other two UNIX variants? These are both covered by licences <p>What about the other two UNIX variants? These are both covered by licences
that allow me to use them. Back in 2002, Caldera International released that allow me to use them. Back in 2002, Caldera International released
Research Unix versions 1-7 and 32V under a [permissive BSD-like license] <a href="http://www.tuhs.org/Archive/Caldera-license.pdf" title="Caldera Licence">12</a>. Research Unix versions 1-7 and 32V under a <a href="http://www.tuhs.org/Archive/Caldera-license.pdf" title="Caldera Licence">permissive BSD-like license</a>.
BSD UNIX is based off of v7 UNIX, and of course has its own permissive BSD UNIX is based off of v7 UNIX, and of course has its own permissive
BSD licence. And in 2017, Nokia also released versions 8-10 under the BSD licence. And in 2017, Nokia also released versions 8-10 under the
condition that it will not assert copyright rights for non-commercial use.</p> condition that it will not assert copyright rights for non-commercial use.</p>
@@ -956,7 +958,7 @@ came about from the realization that I needed a response to the late-discovered
licence issue, I’m quite pleased with the result – it enables an interesting licence issue, I’m quite pleased with the result – it enables an interesting
window on the dawn of the UNIX era. I feel that someone should complete the window on the dawn of the UNIX era. I feel that someone should complete the
circle here by emulating a VAX 780 on the PDP-11 and run 4.2BSD on it, so that circle here by emulating a VAX 780 on the PDP-11 and run 4.2BSD on it, so that
we can get the [original runtime environment used for the first IOCCC] <a href="https://groups.google.com/forum/?hl=en#!msg/net.lang.c/lx-TAuEyeRI/HdOOnNx6LC0J" title="First annual IOCCC announcement">13</a>.</p> we can get the <a href="https://groups.google.com/forum/?hl=en#!msg/net.lang.c/lx-TAuEyeRI/HdOOnNx6LC0J" title="First annual IOCCC announcement">original runtime environment used for the first IOCCC</a>.</p>
<h3 id="compile-time-options">Compile-time Options:</h3> <h3 id="compile-time-options">Compile-time Options:</h3>
<p>The following command flags control the compilation:</p> <p>The following command flags control the compilation:</p>
<ul> <ul>
@@ -989,24 +991,24 @@ quoting here – there are at least three levels going on. In particular,
you will need to escape <code>$</code> as <code>$$</code> to protect it from <code>make</code>.</li> you will need to escape <code>$</code> as <code>$$</code> to protect it from <code>make</code>.</li>
</ul> </ul>
<h3 id="what-is-the-ascii-art-supposed-to-be">What is the ASCII art supposed to be?</h3> <h3 id="what-is-the-ascii-art-supposed-to-be">What is the ASCII art supposed to be?</h3>
<p>The ASCII art represents a torn piece of [paper tape] <a href="https://en.wikipedia.org/wiki/Punched_tape" title="Paper Tape">14</a>.</p> <p>The ASCII art represents a torn piece of <a href="https://en.wikipedia.org/wiki/Punched_tape" title="Paper Tape">paper tape</a>.</p>
<h3 id="acknowledgements">Acknowledgements</h3> <h3 id="acknowledgements">Acknowledgements</h3>
<p>None of this could have been possible without the hard work of</p> <p>None of this could have been possible without the hard work of</p>
<ul> <ul>
<li>Warren Toomey and the other members of the <li>Warren Toomey and the other members of the
[The Unix Heritage Society] <a href="http://www.tuhs.org" title="The Unix Heritage Society">15</a></li> <a href="http://www.tuhs.org" title="The Unix Heritage Society">The Unix Heritage Society</a></li>
<li>Robert M. Supnik and the other contributors to [SimH] <a href="http://simh.trailing-edge.com" title="SimH">16</a>, the simulator <li>Robert M. Supnik and the other contributors to <a href="http://simh.trailing-edge.com" title="SimH">SimH</a>, the simulator
for historic computer architectures. The number of times I needed to for historic computer architectures. The number of times I needed to
“Use the Source, Luke” on SimH to unravel some dark corner of these “Use the Source, Luke” on SimH to unravel some dark corner of these
machines was uncountable.</li> machines was uncountable.</li>
<li>[Bitsavers] <a href="http://bitsavers.trailing-edge.com" title="Bitsavers.org">17</a>, which acquired, scanned and preserved all the manuals <li><a href="http://bitsavers.trailing-edge.com" title="Bitsavers.org">Bitsavers</a>, which acquired, scanned and preserved all the manuals
I spent many hours squinting at.</li> I spent many hours squinting at.</li>
<li>Ken Thompson, Dennis Ritchie, Brian Kernigan, M. D. McIlroy, J. F. <li>Ken Thompson, Dennis Ritchie, Brian Kernigan, M. D. McIlroy, J. F.
Osssanna, Rudd Canaday and the other members of the Bell Labs Osssanna, Rudd Canaday and the other members of the Bell Labs
Computing Science Research Center who were responsible for the invention Computing Science Research Center who were responsible for the invention
of UNIX, the C programming language, and the innumerable other innovations of UNIX, the C programming language, and the innumerable other innovations
that we now take for granted as part of the modern software landscape. that we now take for granted as part of the modern software landscape.
In particular, the [home page of the late Dennis Ritchie] <a href="https://www.bell-labs.com/usr/dmr/www/" title="DMR Homepage">18</a> contained In particular, the <a href="https://www.bell-labs.com/usr/dmr/www/" title="DMR Homepage">home page of the late Dennis Ritchie</a> contained
a trove of useful information on the evolution of UNIX and C and is a trove of useful information on the evolution of UNIX and C and is
recommended for perusal by others who share my peculiar retro computing recommended for perusal by others who share my peculiar retro computing
passion.</li> passion.</li>
+6 -13
View File
@@ -26,10 +26,8 @@ least 125x38, try:
It is said by some students of Astronomy: It is said by some students of Astronomy:
``` > Oh, Be A Fine Gal, Kiss Me!<br>
Oh, Be A Fine Gal, Kiss Me! > Oh, Be A Fine Gentleman, Kiss Me!
Oh, Be A Fine Gentleman, Kiss Me!
```
Many [Mnemonic variations](http://www.star.ucl.ac.uk/%7Epac/obafgkmrns.html) exist. Many [Mnemonic variations](http://www.star.ucl.ac.uk/%7Epac/obafgkmrns.html) exist.
You might wish, on a star, to better understand the colors being displayed. You might wish, on a star, to better understand the colors being displayed.
@@ -173,21 +171,16 @@ Because the rot13 is too easy to decode with the plain eyes, I decided to use
the [Caesar cipher](https://en.wikipedia.org/wiki/Caesar_cipher) with the key the [Caesar cipher](https://en.wikipedia.org/wiki/Caesar_cipher) with the key
18: 18:
``` > Lzw xajkl tsffwj ak wfugvwv mkafy AWWW 754 xdgslk gf dafw 47. Al ak hjaflwv
Lzw xajkl tsffwj ak wfugvwv mkafy AWWW 754 xdgslk gf dafw 47. Al ak hjaflwv gfdq gf dalldw-wfvasf esuzafwk.
gfdq gf dalldw-wfvasf esuzafwk.
```
If you want to or must know and don't know how to decipher this, you might look If you want to or must know and don't know how to decipher this, you might look
at the [Caesar cipher decoder](https://www.dcode.fr/caesar-cipher). Find the at the [Caesar cipher decoder](https://www.dcode.fr/caesar-cipher). Find the
text that says: text that says:
``` > Manual decryption and parameters Shift/Key (number)
Manual decryption and parameters
Shift/Key (number)
```
and enter 18 and then click the button that says: `DECRYPT (BRUTEFORCE)`. .. and enter 18 and then click the button that says: `DECRYPT (BRUTEFORCE)`.
<!-- <!--
+12 -7
View File
@@ -418,8 +418,10 @@ least 125x38, try:</p>
<pre><code> ./try.sh</code></pre> <pre><code> ./try.sh</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2> <h2 id="judges-remarks">Judges’ remarks:</h2>
<p>It is said by some students of Astronomy:</p> <p>It is said by some students of Astronomy:</p>
<pre><code> Oh, Be A Fine Gal, Kiss Me! <blockquote>
Oh, Be A Fine Gentleman, Kiss Me!</code></pre> <p>Oh, Be A Fine Gal, Kiss Me!<br>
Oh, Be A Fine Gentleman, Kiss Me!</p>
</blockquote>
<p>Many <a href="http://www.star.ucl.ac.uk/%7Epac/obafgkmrns.html">Mnemonic variations</a> exist. <p>Many <a href="http://www.star.ucl.ac.uk/%7Epac/obafgkmrns.html">Mnemonic variations</a> exist.
You might wish, on a star, to better understand the colors being displayed. You might wish, on a star, to better understand the colors being displayed.
And those in the deep south might wish to go north for a better view.</p> And those in the deep south might wish to go north for a better view.</p>
@@ -514,14 +516,17 @@ questions:</p>
<p>Because the rot13 is too easy to decode with the plain eyes, I decided to use <p>Because the rot13 is too easy to decode with the plain eyes, I decided to use
the <a href="https://en.wikipedia.org/wiki/Caesar_cipher">Caesar cipher</a> with the key the <a href="https://en.wikipedia.org/wiki/Caesar_cipher">Caesar cipher</a> with the key
18:</p> 18:</p>
<pre><code> Lzw xajkl tsffwj ak wfugvwv mkafy AWWW 754 xdgslk gf dafw 47. Al ak hjaflwv <blockquote>
gfdq gf dalldw-wfvasf esuzafwk.</code></pre> <p>Lzw xajkl tsffwj ak wfugvwv mkafy AWWW 754 xdgslk gf dafw 47. Al ak hjaflwv
gfdq gf dalldw-wfvasf esuzafwk.</p>
</blockquote>
<p>If you want to or must know and don’t know how to decipher this, you might look <p>If you want to or must know and don’t know how to decipher this, you might look
at the <a href="https://www.dcode.fr/caesar-cipher">Caesar cipher decoder</a>. Find the at the <a href="https://www.dcode.fr/caesar-cipher">Caesar cipher decoder</a>. Find the
text that says:</p> text that says:</p>
<pre><code> Manual decryption and parameters <blockquote>
Shift/Key (number)</code></pre> <p>Manual decryption and parameters Shift/Key (number)</p>
<p>and enter 18 and then click the button that says: <code>DECRYPT (BRUTEFORCE)</code>.</p> </blockquote>
<p>.. and enter 18 and then click the button that says: <code>DECRYPT (BRUTEFORCE)</code>.</p>
<!-- <!--
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved. Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
+6 -6
View File
@@ -3084,7 +3084,7 @@ loop printing whitespace.</li>
<pre><code> $ ./prog &lt; ioccc.json &gt; ioccc.html <pre><code> $ ./prog &lt; ioccc.json &gt; ioccc.html
Assertion failed: (rulez), function C, file prog.c, line 124. Assertion failed: (rulez), function C, file prog.c, line 124.
Abort trap: 6</code></pre> Abort trap: 6</code></pre>
<p>(from say running <code>./try.sh) but this is expected and the file</code>ioccc.html` will <p>(from say running <code>./try.sh</code>) but this is expected and the file <code>ioccc.html</code> will
be generated properly.</p> be generated properly.</p>
<p>Some JSON files might cause the program to continue to run and seemingly <p>Some JSON files might cause the program to continue to run and seemingly
infinitely increase the size of the output file. This can happen if you try infinitely increase the size of the output file. This can happen if you try
@@ -3108,12 +3108,12 @@ crash and halt. If this is the case type ctrl-e to quit the emulator and try
again.</p> again.</p>
<p>The author also stated that it is possible to corrupt the virtual disk. If you <p>The author also stated that it is possible to corrupt the virtual disk. If you
do this you should type <code>make clobber all</code> and try again.</p> do this you should type <code>make clobber all</code> and try again.</p>
<p>Cody caused a funny problem where it showed <code>ERROR</code> after each command. The <p>A funny problem where it showed <code>ERROR</code> after each command was noticed. The
solution was to hit ctrl-e and start again. He does not know if this is what was solution was to hit ctrl-e and start again. It is not known if this is what was
referred to by the author but there was likely no typo involved.</p> referred to by the author but there was likely no typo involved.</p>
<p>Cody notes that if you are using the saved mode you must type <code>sync</code> prior to <p>Another issue noticed is that if you are using the saved mode you must type
exiting the program or else the next time you run it the file will not exist (or <code>sync</code> prior to exiting the program or else the next time you run it the file
in the case of compiled code it won’t be executable).</p> will not exist (or in the case of compiled code it won’t be executable).</p>
<div id="2018_vokes"> <div id="2018_vokes">
<h2 id="vokes">2018/vokes</h2> <h2 id="vokes">2018/vokes</h2>
</div> </div>
+6 -6
View File
@@ -3871,7 +3871,7 @@ When you run it on a JSON file you will see something like:
Abort trap: 6 Abort trap: 6
``` ```
(from say running `./try.sh) but this is expected and the file `ioccc.html` will (from say running `./try.sh`) but this is expected and the file `ioccc.html` will
be generated properly. be generated properly.
Some JSON files might cause the program to continue to run and seemingly Some JSON files might cause the program to continue to run and seemingly
@@ -3909,13 +3909,13 @@ again.
The author also stated that it is possible to corrupt the virtual disk. If you The author also stated that it is possible to corrupt the virtual disk. If you
do this you should type `make clobber all` and try again. do this you should type `make clobber all` and try again.
Cody caused a funny problem where it showed `ERROR` after each command. The A funny problem where it showed `ERROR` after each command was noticed. The
solution was to hit ctrl-e and start again. He does not know if this is what was solution was to hit ctrl-e and start again. It is not known if this is what was
referred to by the author but there was likely no typo involved. referred to by the author but there was likely no typo involved.
Cody notes that if you are using the saved mode you must type `sync` prior to Another issue noticed is that if you are using the saved mode you must type
exiting the program or else the next time you run it the file will not exist (or `sync` prior to exiting the program or else the next time you run it the file
in the case of compiled code it won't be executable). will not exist (or in the case of compiled code it won't be executable).
<div id="2018_vokes"> <div id="2018_vokes">