2018/ferguson fixes

Make test.sh +x.

Formatting fixes.

Typo fixes.

Other things as well.

I'm actually aware of some other things that could still be done including
removing some text that is no longer needed (and some that probably is
not needed) but this can come at a later date.
This commit is contained in:
Cody Boone Ferguson committed 2023-02-15 10:17:08 -08:00
1 parent 517e936b63
commit ca8d780e70
4 files changed
+56 -33

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
prog-simple
prog.orig
weasel
weasel-simple
+24 -11
View File
@@ -119,7 +119,7 @@ from the infamous *UNIX-HATERS Handbook*.
**[Winning thoughts](#winning):** What it means to me to win as well as some **[Winning thoughts](#winning):** What it means to me to win as well as some
dedications and thanks. Here too I include a link to a website which will be dedications and thanks. Here too I include a link to a website which will be
dedicated to this entry beyond what will be published on the IOCCC website dedicated to this entry beyond what will be published on the IOCCC website.
[FILES]: FILES [FILES]: FILES
[rpm.md]: rpm.md [rpm.md]: rpm.md
@@ -238,8 +238,14 @@ 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?
**On user errors:** if the generation reaches **`SIZE_MAX - 1`** I consider it a I was quite proud that when the next contest came the judges removed that
user (or monkey) error; if the user insists on being so petulant as to try such question. Later 2018 and all of 2019 was difficult for me so it was like I won a
second time for the same entry.
### On user errors
If the generation reaches **`SIZE_MAX - 1`** I consider it a
user (or monkey) error; if the user insists on being so petulant enough as to try such
a ridiculous set of parameters in an attempt to make it be no more successful a ridiculous set of parameters in an attempt to make it be no more successful
than a monkey typing *then it shouldn't be any more successful than a monkey; if than a monkey typing *then it shouldn't be any more successful than a monkey; if
it by chance reaches the target it's because a monkey could too!* Either way it by chance reaches the target it's because a monkey could too!* Either way
@@ -256,7 +262,7 @@ Fish Theorem*). So although the user might not be a monkey the program makes the
assumption that **the user could in fact be a monkey called Eric** *although it 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]: 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]: http://ioccc.org/2018/guidelines.txt [2018 guidelines]: http://ioccc.org/2018/guidelines.txt
@@ -476,32 +482,38 @@ So in this case I joined the options in the following order:
1. **`-q`** 1. **`-q`**
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
rate (only after parsing do I print the final mutation rate whatever it ends up rate (only after parsing do I print the final mutation rate whatever it ends up
being); so while it appears there is a bug, showing mutation rate out of range 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
out of range message). The typewriter returns to Eric. out of range message). The typewriter returns to Eric.
5. **`-r1`** 5. **`-r1`**
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
**`strtol()`** it should return 0: this is the third message about being out of **`strtol()`** it should return 0: this is the third message about being out of
range. Note here that **`rand()`** returns an **`int`** and **`strtol()`** range. Note here that **`rand()`** returns an **`int`** and **`strtol()`**
returns a **`long`** but I compare the return value of **`rand()`** to the returns a **`long`** but I compare the return value of **`rand()`** to the
@@ -509,9 +521,10 @@ 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, even
in monkey mode. in monkey mode.
+28 -22
View File
@@ -1,22 +1,26 @@
What? Install an IOCCC entry? I realise it seems odd so why did I make a rpm ## An RPM: what kind of absolute MADNESS is this ?
spec file and why did I hint at building RPMs for others? I can't say precisely;
**certainly I'm under no impression that anyone else will want to use it** *but What kind of crazy idea is this? Install an IOCCC entry? I realise it seems odd
the entry was fun enough for me that I actually will* (a number of my programs (at best) so why did I make a rpm spec file and why did I hint at building RPMs
over the years are programs I actually install and I already have done so with for others? I can't say precisely; **certainly I'm under no impression that
this entry). I already have my own RPM repository and initially after having won anyone else will want to use it** *but the entry was fun enough for me that I
I set it up so that I could host the weasel rpm (binary and source) there. At actually will* (a number of my programs over the years are programs I actually
the same time though I feel the entry belongs on the IOCCC website; that is to install and I already have done so with this entry).
say the only place the raw files should be downloadable from is the IOCCC
website itself. Simon Cooper (the judge who deals with setting up the entries on I already have my own RPM repository and initially after having won I set it up
the IOCCC website) asked me if there is any real attachment in having the RPM so that I could host the weasel rpm (binary and source) there. At the same time
built as part of the entry and the answer is 'no'. He did suggest too that if though I feel the entry belongs on the IOCCC website; that is to say the only
I were to have the RPM hosted on the IOCCC website not only would it place a place the raw files should be downloadable from is the IOCCC website itself.
burden on me to keep it up to date but it would place a burden on the judges - Simon Cooper (the judge who at the time dealt with setting up the entries on the
in other words he himself. Even if it wasn't a burden to me I agree on the other IOCCC website) asked me if there is any real attachment in having the RPM built
part and so I have instead come to the following ideas: 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 will not host the actual source code or scripts on my website; they will * 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 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 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 website itself. I have set up an [errata page][] however should there be anything
@@ -25,12 +29,14 @@ requiring a fix.
* I am keeping the weasel.spec file in the entry as it was part of my * 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 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 to build a RPM: if you know how to use **`rpmbuild`** then you should be able to
work it out. 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 I am the only one who has any desire for actually * Because I strongly suspect (in other words since I know) I am the only one
installing an IOCCC entry I will not worry about setting up a repository; if I who has any desire for actually installing an IOCCC entry I did not do anything
do set up a repository in the future I will include information on it somewhere further. Nevertheless more information on my entry can be found at
at [https://ioccc.xexyl.net/2018/weasel][]. [https://ioccc.xexyl.net/2018/weasel][].
[errata page]: https://ioccc.xexyl.net/2018/weasel/errata [errata page]: https://ioccc.xexyl.net/2018/weasel/errata
[https://ioccc.xexyl.net/2018/weasel]: https://ioccc.xexyl.net/2018/weasel [https://ioccc.xexyl.net/2018/weasel]: https://ioccc.xexyl.net/2018/weasel
Regular → Executable
View File
File mode changed.