From ccdd8133ed75da22a14b249e0d27f41adc904650 Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Sun, 21 Apr 2024 00:52:21 -0700 Subject: [PATCH] remove name name attributes in 2018/ferguson/README.md --- 2018/ferguson/README.md | 83 ++++++++++++++++++++++++++++++---------- 2018/ferguson/index.html | 73 ++++++++++++++++++++++++----------- 2 files changed, 113 insertions(+), 43 deletions(-) diff --git a/2018/ferguson/README.md b/2018/ferguson/README.md index 8ddd9561c..99b5a96f5 100644 --- a/2018/ferguson/README.md +++ b/2018/ferguson/README.md @@ -198,7 +198,9 @@ dedicated to this entry beyond what will be published on the IOCCC website. [FILES]: FILES [rpm.html]: rpm.html -## **1. What it is** +
+## **1. What it is** +
Skip to [How it works](#how). @@ -238,7 +240,9 @@ comparison and output will always be capitalised). [Weasel program]: https://en.wikipedia.org/wiki/Weasel_program [The Blind Watchmaker]: https://en.wikipedia.org/wiki/The_Blind_Watchmaker -## **2. How it works** +
+## **2. How it works** +
Skip to [Hints](#hints). @@ -348,14 +352,18 @@ isn't insolent enough to say the user is a monkey for certain!* [2018 guidelines]: ../../2018/guidelines.txt -## **3. Hints** +
+## **3. Hints** +
Skip to [Obfuscation](#obfuscation). I noted that there are a number of additional features and here I will document some of them. -### Keyboards +
+### Keyboards +
Skip to [Options](#options). @@ -375,7 +383,9 @@ can actually produce but there is a certain type of input error that might *appear* to be a bug; see specifically [Input Error Example](#error). -### Options +
+### Options +
Skip to [Spoilers](#spoiler). @@ -548,7 +558,9 @@ 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 the `-` - *in an earlier element of `argv`. This is not a bug!* -### Spoilers +
+### Spoilers +
Skip to [Example Invocations](#invocations). @@ -563,7 +575,9 @@ offspring of each generation will be assigned a pseudo-randomly positioned character in the keyboard. If you want to enable this specially you can use the `-m` option (*-m for monkey*). -### Example Invocations +
+### Example Invocations +
Skip to [Input Error Example](#error). @@ -734,10 +748,11 @@ monkey mode you'll find that it shows something else). The lines that only have between future generations - as well as the final answer (if the answer is in generation 0 you won't see the ``). - +
One final thing to consider is that **the program doesn't directly read from a file**. This combined with the way the shell works could possibly confuse some people. Take the following invocations: +
``` (1) $ echo test > test @@ -821,7 +836,9 @@ script you will have to directly pass the options to the script** like the above example shows (but the strings will still only be read from the `test-strings.txt` file). -### Input Error Example +
+### Input Error Example +
Skip to [Obfuscation](#obfuscation). @@ -853,7 +870,9 @@ distinctly seen like a letter, digit or symbol is: `isprint('\n') == 0 && isspace('\n') == 1`. You can add these characters but the output will be rather confusing and hard to read. -## **4. Obfuscation** +
+## **4. Obfuscation** +
### Techniques @@ -907,7 +926,9 @@ code. In case you wondered deciphering #5 won't decipher #7 (neither will deciphering #7 help you decipher #5). -### Beauty +
+### Beauty +
Skip to [How to build](#build). @@ -931,9 +952,13 @@ some of it might look like a blob but this is clearly false; *as all good programmers know if something is potentially confusing or misleading it should be made clear in the comments! :)* -## **5. How to build** +
+## **5. How to build** +
-### S, M and N Constants +
+### S, M and N Constants +
Skip to [Compilation](#compiling). @@ -997,7 +1022,9 @@ The Makefile simplifies how to reconfigure this value with the variable ``` -### Compilation +
+### Compilation +
Skip to [Portability](#portability). @@ -1035,7 +1062,9 @@ If you wanted to change the maximum number attempts to 100 you could do: ``` -### Portability +
+### Portability +
Skip to [An aside on bugs](#bugs). @@ -1101,7 +1130,9 @@ Kernel Version: Darwin 17.5.0 Darwin 17.5.0 Darwin Kernel Version 17.5.0: Mon Mar 5 22:24:32 PST 2018; root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64 ``` -#### An aside +
+#### An aside +
Skip to [Installing](#rpm). @@ -1118,7 +1149,9 @@ unreasonable monkeys. I will say though that there is at least one place I see after having won that could be slightly more efficient (can you find it?); I am however leaving it as it is because this is what won. -### Installing +
+### Installing +
Skip to [Final thoughts](#thoughts). @@ -1128,7 +1161,9 @@ this) if for some (strange or maybe even mad) reason you're interested. [rpm.html]: rpm.html -## **6. Final thoughts** +
+## **6. Final thoughts** +
Skip to [Winning comments](#winning). @@ -1141,7 +1176,9 @@ code must be quite difficult (though maybe not as much as if you were to have to look at Microsoft Windows code or code for Windows in any case ? :)) and these two things I think are rather amusing (in order of least to most): -Dennis Ritchie's Anti-Foreword: +
+Dennis Ritchie's Anti-Foreword: +
``` Anti-Foreword @@ -1193,7 +1230,9 @@ and since it doesn't break his message it's not broken - it's just obfuscated albeit not very much (and it still *'compiles'!*); and isn't that what this contest is about? :) -Ken Thompson's ending: +
+Ken Thompson's ending: +
``` Creators Admit C, Unix Were Hoax @@ -1279,7 +1318,9 @@ I'm missing but either way it's a funny piece. It could also be for irony itself for the contest but decided for the message by itself in the end). I would prefer believing that whether true or not. -## **7. Winning comments, thanks, dedications, links, etc.** +
+## **7. Winning comments, thanks, dedications, links, etc.** +
I feel incredibly honoured, privileged and I am extremely happy and proud to have won! I am more proud and happy about this than anything I have ever done in diff --git a/2018/ferguson/index.html b/2018/ferguson/index.html index 40c3c514a..63913ad33 100644 --- a/2018/ferguson/index.html +++ b/2018/ferguson/index.html @@ -284,7 +284,9 @@ from the infamous UNIX-HATERS Handbook.

Winning thoughts: 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 dedicated to this entry beyond what will be published on the IOCCC website.

-

1. What it is

+
+

1. What it is

+

Skip to How it works.

It is an implementation of Richard Dawkins’ Weasel program (Wikipedia). According to Wikipedia in chapter three of his book The Blind Watchmaker @@ -312,7 +314,9 @@ more details.

algorithm) towards the solution of the string METHINKS IT IS LIKE A WEASEL (note that I use toupper() so it doesn’t matter what case the input is the comparison and output will always be capitalised).

-

2. How it works

+
+

2. How it works

+

Skip to Hints.

Here you can find a general explanation of a genetic algorithm as well as a brief history. Although the link provides more information (including images to @@ -394,11 +398,11 @@ such a monkey isn’t typing or even doesn’t exist (because it’s not the ). 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 isn’t insolent enough to say the user is a monkey for certain!

-

3. Hints

+

3. Hints

Skip to Obfuscation.

I noted that there are a number of additional features and here I will document some of them.

-

Keyboards

+

Keyboards

Skip to Options.

The keyboard, as noted, has more than just the alphabet and space. To be precise the following characters are acceptable; it equates to this in C (note @@ -410,7 +414,7 @@ it includes a literal space ' ' but it doesn’t include other

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 appear to be a bug; see specifically Input Error Example.

-

Options

+

Options

Skip to Spoilers.

There are a number of options you can pass to the program besides the target string; some I will document here (the summary being in the man page). You can @@ -517,7 +521,9 @@ itself) and then the target string would literally be set to -r- for option parsing. In other words options 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!

-

Spoilers

+
+

Spoilers

+

Skip to Example Invocations.

The Easter egg: Since Dawkins references the Infinite Monkey Theorem it simulates a monkey using a typewriter! This mode has the following changes:

@@ -528,7 +534,9 @@ the string is of length 28 (the default) then all 28 characters in each offspring of each generation will be assigned a pseudo-randomly positioned character in the keyboard. If you want to enable this specially you can use the -m option (-m for monkey).

-

Example Invocations

+
+

Example Invocations

+

Skip to Input Error Example.

The following examples are used to demonstrate better the command line parsing. In order to do that though I had to first document the -m option because @@ -645,10 +653,11 @@ has no parents; it is generation 1 that starts working towards the goal. You’l see also (mutation) at the end of the line at this point (if you enable monkey mode you’ll find that it shows something else). The lines that only have are separators: you won't see this between generation 0 and 1 but you will between future generations - as well as the final answer (if the answer is in generation 0 you won't see the).

-

-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 file. This combined with the way the shell works could possibly confuse some people. Take the following invocations:

+
    (1) $ echo test > test
     (2) $ ./weasel test
     (3) $ ./weasel < test
@@ -706,7 +715,9 @@ search for TEST. In other words if you want to pass options
 script you will have to directly pass the options to the script like the above
 example shows (but the strings will still only be read from the
 test-strings.txt file).

-

Input Error Example

+
+

Input Error Example

+

Skip to Obfuscation.

There is a type of input error, as I said, that might appear to be a bug. What actually is going on though is due to a technicality on how spaces are printed @@ -730,7 +741,7 @@ invalid character ('\n' itself which means another line break) and finally the closing '. Specifically isspace() characters aren’t distinctly seen like a letter, digit or symbol is: isprint('\n') == 0 && isspace('\n') == 1. You can add these characters but the output will be rather confusing and hard to read.

-

4. Obfuscation

+

4. Obfuscation

Techniques

Skip to Beauty.

The following might be some of the techniques used in this entry:

@@ -772,7 +783,7 @@ code.

In case you wondered deciphering #5 won’t decipher #7 (neither will deciphering #7 help you decipher #5).

-

Beauty

+

Beauty

Skip to How to build.

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
@@ -786,8 +797,12 @@ set your thinking straight:

some of it might look like a blob but this is clearly false; as all good programmers know if something is potentially confusing or misleading it should be made clear in the comments! :)

-

5. How to build

-

S, M and N Constants

+
+

5. How to build

+
+
+

S, M and N Constants

+

Skip to Compilation.

There are three #defined constants that can be redefined at compilation to modify the behaviour of the program in a number of ways (see the @@ -828,7 +843,9 @@ and the larger the values the more memory it’ll require.

The Makefile simplifies how to reconfigure this value with the variable OFFSPRING:

    make clobber OFFSPRING=55 all
-

Compilation

+
+

Compilation

+

Skip to Portability.

The following options must always be passed to the compiler:

    -DQ='typedef' -D'g(o)'='goto o;' -D'w(x)'="x:" -D'H(main)'='r(main)'
@@ -844,7 +861,7 @@ result. Remember too that S (MAX_SIZE) cannot be less N are capped at SIZE_MAX - 1 or whatever M (MAX_ATTEMPTS) is set to.

If you wanted to change the maximum number attempts to 100 you could do:

    make clobber MAX_ATTEMPTS=100 everything
-

Portability

+

Portability

Skip to An aside on bugs.

This entry requires at least C99 even if you translate digraphs. The program doesn’t require third-party libraries and should work on any Unix based system. @@ -890,7 +907,9 @@ Kernel Version: Darwin 17.5.0

InstalledDir: /Library/Developer/CommandLineTools/usr/bin $ uname -srmv Darwin 17.5.0 Darwin Kernel Version 17.5.0: Mon Mar 5 22:24:32 PST 2018; root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64
-

An aside

+
+

An aside

+

Skip to Installing.

Any undocumented bugs are the result of insolent monkeys tampering with any number of things. That includes but is not limited to running the program on a @@ -904,12 +923,16 @@ and easy fashion if ever; or any other meddling including being petulant and/or unreasonable monkeys. I will say though that there is at least one place I see after having won that could be slightly more efficient (can you find it?); I am however leaving it as it is because this is what won.

-

Installing

+
+

Installing

+

Skip to Final thoughts.

I have included a RPM spec file for those with a Red Hat based Linux distribution; see rpm.html for details (including why I implemented this) if for some (strange or maybe even mad) reason you’re interested.

-

6. Final thoughts

+
+

6. Final thoughts

+

Skip to Winning comments.

The judges suggested that making them laugh helps entries chance of winning. Well laughter helps everything so in case you haven’t seen - and even if you @@ -919,7 +942,9 @@ that book) I include it below; because I agree that looking at a lot of twisted code must be quite difficult (though maybe not as much as if you were to have to look at Microsoft Windows code or code for Windows in any case ? :)) and these two things I think are rather amusing (in order of least to most):

-

Dennis Ritchie’s Anti-Foreword:

+
+

Dennis Ritchie’s Anti-Foreword:

+
    Anti-Foreword
 
     By Dennis Ritchie
@@ -966,7 +991,9 @@ two things I think are rather amusing (in order of least to most):

and since it doesn’t break his message it’s not broken - it’s just obfuscated albeit not very much (and it still ‘compiles’!); and isn’t that what this contest is about? :)

-

Ken Thompson’s ending:

+
+

Ken Thompson’s ending:

+
    Creators Admit C, Unix Were Hoax
 
     FOR IMMEDIATE RELEASE
@@ -1036,7 +1063,9 @@ I’m missing but either way it’s a funny piece. It could also be for irony it
 (actually I had previously thought of somehow implementing something like that
 for the contest but decided for the message by itself in the end). I would
 prefer believing that whether true or not.

- +
+ +

I feel incredibly honoured, privileged and I am extremely happy and proud to have won! I am more proud and happy about this than anything I have ever done in my life and I don’t think there can be anything else I can be more proud of in