From 515281417ccda2941e80881b9223ee1f696a24fc Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Mon, 5 Aug 2024 09:48:14 -0700 Subject: [PATCH] Fix html files in 2001 This also includes a few updates to the bugs file. --- 2001/anonymous/README.md | 8 +-- 2001/anonymous/index.html | 8 +-- 2001/bellard/README.md | 1 - 2001/bellard/index.html | 3 +- 2001/coupard/README.md | 6 ++ 2001/coupard/index.html | 4 ++ 2001/ctk/README.md | 4 +- 2001/ctk/index.html | 2 +- 2001/dgbeards/README.md | 16 ++--- 2001/dgbeards/index.html | 16 +++-- 2001/herrmann1/README.md | 47 +++++++------ 2001/herrmann1/index.html | 52 +++++++------- 2001/jason/README.md | 8 --- 2001/jason/index.html | 4 -- 2001/kev/README.md | 4 +- 2001/kev/index.html | 4 +- 2001/ollinger/README.md | 62 ++++++++--------- 2001/ollinger/index.html | 54 +++++++-------- 2001/rosten/README.md | 13 ++-- 2001/rosten/index.html | 13 ++-- 2001/schweikh/README.md | 7 -- 2001/schweikh/index.html | 3 - 2001/westley/README.md | 10 ++- 2001/westley/index.html | 15 ++-- 2001/williams/README.md | 2 +- 2001/williams/index.html | 2 +- bugs.html | 142 ++++++++++++++++++-------------------- bugs.md | 31 ++++----- 28 files changed, 264 insertions(+), 277 deletions(-) diff --git a/2001/anonymous/README.md b/2001/anonymous/README.md index 800329350..0c2ffce1b 100644 --- a/2001/anonymous/README.md +++ b/2001/anonymous/README.md @@ -6,7 +6,7 @@ The programs that this program is supposed to act on, [anonymous.ten.c](%%REPO_URL%%/2001/anonymous/anonymous.ten.c) and [anonymous.bed.c](%%REPO_URL%%/2001/anonymous/anonymous.bed.c), -compiled with `make`, MUST be compiled as 32-bit ELF binaries. In the case that +compiled with `make`, **MUST** be compiled as **32-bit ELF binaries**. In the case that this fails these programs will be compiled as 64-bit binaries as alternate code, `anonymous.ten.alt` and `anonymous.bed.alt`, ELF or otherwise. However trying to use the entry on these files will fail. See [Alternate code](#alternate-code) @@ -38,7 +38,7 @@ For more detailed information see [2001/anonymous in bugs.html](../../bugs.html# ./anonymous anonymous.bed # if able to compile as a 32-bit (-m32) ELF binary ``` -NOTE: if the 32-bit version cannot be compiled the script will at least compile +**NOTE**: if the 32-bit version cannot be compiled the script will at least compile [anonymous.ten](%%REPO_URL%%/2001/anonymous/anonymous.ten.c) as a 64-bit program (or whatever your system is set to) and run it directly. @@ -196,7 +196,7 @@ global state, and the other doesn't. There is also quite a nice trick where I wave a magic wand, and a chunk of code which should only be run when the program is run for the first time (setting the -[PC / IP](https://en.wikipedia.org/wiki/Program_counter) to point at `main()` +[PC/IP](https://en.wikipedia.org/wiki/Program_counter) to point at `main()` etc.) gets turned into a frogstring. The C compiler sees a string by itself in the code, thinks "yup, that's a valid C expression", and quietly moves on to the next line of code. @@ -231,7 +231,7 @@ new set of switches, and the call to `execv(3)` asks for the newly compiled program to be executed. I would point out that almost every other entry to this competition also require a C compiler (well, the published winning entries at any rate, and I recognize that a few don't). There is little real difference between this -program and one like last year's entry [dhyang](%%REPO_URL%%/2000/dhyang/dhyang.c); both are +program and one like last year's entry [dhyang](../../2000/dhyang/index.html); both are just C programs that generate C code as their output. Enjoy and thanks! diff --git a/2001/anonymous/index.html b/2001/anonymous/index.html index 7f42874a8..ae897fe14 100644 --- a/2001/anonymous/index.html +++ b/2001/anonymous/index.html @@ -411,7 +411,7 @@ Location: GB - United Kingdom of Great
    make

The programs that this program is supposed to act on, anonymous.ten.c and anonymous.bed.c, -compiled with make, MUST be compiled as 32-bit ELF binaries. In the case that +compiled with make, MUST be compiled as 32-bit ELF binaries. In the case that this fails these programs will be compiled as 64-bit binaries as alternate code, anonymous.ten.alt and anonymous.bed.alt, ELF or otherwise. However trying to use the entry on these files will fail. See Alternate code @@ -429,7 +429,7 @@ whatever your system will compile them as).

    ./try.sh
 
     ./anonymous anonymous.bed # if able to compile as a 32-bit (-m32) ELF binary
-

NOTE: if the 32-bit version cannot be compiled the script will at least compile +

NOTE: if the 32-bit version cannot be compiled the script will at least compile anonymous.ten as a 64-bit program (or whatever your system is set to) and run it directly.

What happens if the x86 program has already been modified by this program? The @@ -537,7 +537,7 @@ local variables which shadow global variables: so one modifies the global state, and the other doesn’t.

There is also quite a nice trick where I wave a magic wand, and a chunk of code which should only be run when the program is run for the first time (setting the -PC / IP to point at main() +PC/IP to point at main() etc.) gets turned into a frogstring. The C compiler sees a string by itself in the code, thinks “yup, that’s a valid C expression”, and quietly moves on to the next line of code.

@@ -564,7 +564,7 @@ new set of switches, and the call to execv(3) asks for the newly co program to be executed. I would point out that almost every other entry to this competition also require a C compiler (well, the published winning entries at any rate, and I recognize that a few don’t). There is little real difference between this -program and one like last year’s entry dhyang; both are +program and one like last year’s entry dhyang; both are just C programs that generate C code as their output.

Enjoy and thanks!

To build:

    make
-

There is an alternate version with vi(m) key movements. See alternate +

There is an alternate version with vi(m) key movements. See Alternate code below.

To use:

    ./ctk
diff --git a/2001/dgbeards/README.md b/2001/dgbeards/README.md index 0fae3939e..bf64669e3 100644 --- a/2001/dgbeards/README.md +++ b/2001/dgbeards/README.md @@ -4,7 +4,7 @@ make ``` -There is an alternate version based on the author's remarks. See [alternate +There is an alternate version based on the author's remarks. See [Alternate code](#alternate-code) below for more details. @@ -221,13 +221,11 @@ this is not so. A: When compiled with `gcc -Wall`, the compiler generated the following warnings: -``` - suggest parentheses around + or - in operand of & - array subscript has type 'char' - return type defaults to 'int' - control reaches end of non-void function - value computed is not used -``` +> suggest parentheses around `+` or `-` in operand of `&`
+> array subscript has type '`char`'
+> return type defaults to '`int`'
+> control reaches end of non-void function
+> value computed is not used The `value computed is not used` warning happens because I use the `&&` operator and take advantage of short circuit evaluation instead of using @@ -248,7 +246,7 @@ appropriate sportsmanship for a program of this genre and can think of no worse job than trying to find an elusive bug in an intentionally obfuscated program. -[Judge's note: This was followed by a description of the bug, and +[**Judges' note**: This was followed by a description of the bug, and the comment:] Note, if this program wins, the author thinks it would be good to leave diff --git a/2001/dgbeards/index.html b/2001/dgbeards/index.html index 1923950b7..67c728c98 100644 --- a/2001/dgbeards/index.html +++ b/2001/dgbeards/index.html @@ -409,7 +409,7 @@ Location: US - United States of America

To build:

    make
-

There is an alternate version based on the author’s remarks. See alternate +

There is an alternate version based on the author’s remarks. See Alternate code below for more details.

Bugs and (Mis)features:

The current status of this entry is:

@@ -560,11 +560,13 @@ this is not so.

Q: What about the compiler warnings?

A: When compiled with gcc -Wall, the compiler generated the following warnings:

-
    suggest parentheses around + or - in operand of &
-    array subscript has type 'char'
-    return type defaults to 'int'
-    control reaches end of non-void function
-    value computed is not used
+
+

suggest parentheses around + or - in operand of &
+array subscript has type ‘char’
+return type defaults to ‘int’
+control reaches end of non-void function
+value computed is not used

+

The value computed is not used warning happens because I use the && operator and take advantage of short circuit evaluation instead of using an if() statement.

@@ -578,7 +580,7 @@ eliminate them and that can’t be done given the size limit.

appropriate sportsmanship for a program of this genre and can think of no worse job than trying to find an elusive bug in an intentionally obfuscated program.

-

[Judge’s note: This was followed by a description of the bug, and +

[Judges’ note: This was followed by a description of the bug, and the comment:]

Note, if this program wins, the author thinks it would be good to leave this information out of the remarks and encourage others to try and diff --git a/2001/herrmann1/README.md b/2001/herrmann1/README.md index c282e4a6e..7b68e8683 100644 --- a/2001/herrmann1/README.md +++ b/2001/herrmann1/README.md @@ -164,8 +164,8 @@ expected, and one more I is appended to the row.) Let's call it Some explanations: - The tape alphabet is always O and I. -- The states can be anything starting with "st". "start" and -"stop" are the start and stop states, respectively. +- The states can be anything starting with "`st`". "`start`" and +"`stop`" are the start and stop states, respectively. - To define a state, use two lines: one for each letter on the tape. You may omit one of the lines if the Turing machine will never enter the state reading that letter. (In the example, the @@ -220,13 +220,13 @@ Tape: * ``` -and the return code will be 1. As you can see, the Turing machine +and the return code will be `1`. As you can see, the Turing machine moved over the `O`s, but when it arrived at the `I` (still in state start), the error occurred. Note that other kinds of errors can cause compilation to fail. If this happens, the build script will write the error message of -gcc into a file called `error` and then exit. +`gcc` into a file called `error` and then exit. ### What the build script does @@ -238,7 +238,7 @@ beginning of the program; this is where the animation takes place (except in the first and last few steps). However, there's a technical problem to overcome: Some compilers -(including gcc) insert a lot of white space during the +(including `gcc`) insert a lot of white space during the preprocessing. This is bad for two reasons. First, the animated picture won't look right. And second, after some time, the file will grow too big for your hard disk. (The amount of white space @@ -246,12 +246,12 @@ grows exponentially.) So after each preprocessing, the first thing the build script does is remove all the unnecessary white space using `sed`. -(gcc would even insert `#line` directives if I didn't suppress +(`gcc` would even insert `#line` directives if I didn't suppress them with the `-P` option.) ### Some more details -- The arguments passed to the build script are passed on to gcc +- The arguments passed to the build script are passed on to `gcc` with a `-D` before. I had a slight technical problem doing this (especially with the spaces that can appear within the tape argument). That made the build script a bit longer. @@ -266,8 +266,8 @@ lines of code.) `herrmann1-2.c` are generated. - Also, a file `error` is generated. This file is removed after -the compilation, except if gcc produced an error; then it contains -the error message. (I can't let gcc output all its messages +the compilation, except if `gcc` produced an error; then it contains +the error message. (I can't let `gcc` output all its messages directly, because the warnings would clobber the animation. I could have made the compile script output the error file in case of an error, but I didn't want to make it yet longer.) @@ -318,9 +318,10 @@ to use many variables more than once. - I couldn't refrain from doing a little bit of nasty stuff like - #define a 0&0 - #if !a - +``` + #define a 0&0 + #if !a +``` Of course, it is a bit more subtle, and even useful. - The layout of the source code..., well, let's call it the @@ -330,9 +331,9 @@ indenting and modern art. There are even some comments... ### Compatibility -- It works with many versions of gcc. I tested it with versions +- It works with many versions of `gcc`. I tested it with versions 2.7.2.1, 2.8.1, 2.95.2, and ecgs-2.91.66. However, an old version -of gcc produced "internal compiler errors" (obviously not my +of `gcc` produced "internal compiler errors" (obviously not my fault). - The only warnings I get tell me that I'm undefining `__FILE__` and @@ -356,21 +357,25 @@ script, so that one does not have to choose "preprocess" from the menu over and over again. I leave this as an exercise to the experienced Mac programmer.) -- In the build script, I passed the `-P` option to gcc to suppress +- In the build script, I passed the `-P` option to `gcc` to suppress the insertion of `#line` directives. If your compiler doesn't support this option (and does insert `#line` directives), you should change the call to `sed` to remove them, too: Add - -e "/^#line/ d" +``` + -e "/^#line/ d" +``` - to the sed parameters. Or, if your `#line` directives look like - - # 15 "filename" + to the `sed` parameters. Or, if your `#line` directives look like +``` + # 15 "filename" +``` add - -e "/^# [0-9]/ d" - +``` + -e "/^# [0-9]/ d" +``` instead. - First, I had `-ansi -pedantic` turned on, but on some systems, diff --git a/2001/herrmann1/index.html b/2001/herrmann1/index.html index a31614d35..289ab09c9 100644 --- a/2001/herrmann1/index.html +++ b/2001/herrmann1/index.html @@ -511,8 +511,8 @@ expected, and one more I is appended to the row.) Let’s call it #define st2_O I, left, stop

Some explanations: - The tape alphabet is always O and I. -- The states can be anything starting with “st”. “start” and -“stop” are the start and stop states, respectively. +- The states can be anything starting with “st”. “start” and +“stop” are the start and stop states, respectively. - To define a state, use two lines: one for each letter on the tape. You may omit one of the lines if the Turing machine will never enter the state reading that letter. (In the example, the @@ -541,12 +541,12 @@ line

            *
     ..OOOOOOOOIIIIOO..
             *
-

and the return code will be 1. As you can see, the Turing machine +

and the return code will be 1. As you can see, the Turing machine moved over the Os, but when it arrived at the I (still in state start), the error occurred.

Note that other kinds of errors can cause compilation to fail. If this happens, the build script will write the error message of -gcc into a file called error and then exit.

+gcc into a file called error and then exit.

What the build script does

In principle, the build script simply runs the preprocessor over and over again, until nothing changes anymore; then, the program @@ -554,18 +554,18 @@ is compiled. After each preprocessing step, the script outputs the beginning of the program; this is where the animation takes place (except in the first and last few steps).

However, there’s a technical problem to overcome: Some compilers -(including gcc) insert a lot of white space during the +(including gcc) insert a lot of white space during the preprocessing. This is bad for two reasons. First, the animated picture won’t look right. And second, after some time, the file will grow too big for your hard disk. (The amount of white space grows exponentially.) So after each preprocessing, the first thing the build script does is remove all the unnecessary white space using sed.

-

(gcc would even insert #line directives if I didn’t suppress +

(gcc would even insert #line directives if I didn’t suppress them with the -P option.)

Some more details

+
    #define a 0&0
+    #if !a
+

Of course, it is a bit more subtle, and even useful.

+

Compatibility

+
    -e "/^#line/ d"
+

to the sed parameters. Or, if your #line directives look like

+
    # 15 "filename"

add

-
  -e "/^# [0-9]/ d"
-

instead.

+
    -e "/^# [0-9]/ d"
+

instead.

+