From 9e0831cc3df5f399429b915d12154a778262e8c4 Mon Sep 17 00:00:00 2001
From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com>
Date: Thu, 14 Aug 2025 06:16:35 -0700
Subject: [PATCH 1/3] Various fixes, improvements in 2024/ferguson1
The alt code was an old version that should not have even been there.
The extra event was something that was meant to be somewhere else (like
it is in the prog.c) and the event (even 23) is something else.
I put in the data files another joke with the intention of using that
for the event until I remembered the event was wrong.
The alt code has an improvement: it now is possible to specify your
hp/stamina and max number of turns.
In prog.c remove an unused variable.
Updated Judges' remarks to better reflect what happens (in particular
improve the commits from yesterday - correcting it but keeping the same
flow of the judges).
Updated deobfuscation.md (rebuilt deobfuscation.html).
Rebuilt index.html.
---
2024/ferguson1/README.md | 46 ++++++++++++++++-------
2024/ferguson1/data.asc.src | Bin 51639 -> 51664 bytes
2024/ferguson1/data.scrnshot.src | Bin 79702 -> 79993 bytes
2024/ferguson1/data.src | Bin 83592 -> 83969 bytes
2024/ferguson1/deobfuscation.html | 20 ++++++----
2024/ferguson1/deobfuscation.md | 21 +++++++----
2024/ferguson1/index.html | 36 ++++++++++++------
2024/ferguson1/prog.alt.c | 47 ++++++++++++------------
2024/ferguson1/prog.c | 2 +-
2024/ferguson1/strings.asc.loc.txt | 5 ++-
2024/ferguson1/strings.loc.txt | 7 +++-
2024/ferguson1/strings.scrnshot.loc.txt | 8 +++-
12 files changed, 120 insertions(+), 72 deletions(-)
diff --git a/2024/ferguson1/README.md b/2024/ferguson1/README.md
index ba65efa1b..a10029084 100644
--- a/2024/ferguson1/README.md
+++ b/2024/ferguson1/README.md
@@ -47,18 +47,20 @@ practical reasons.
```
./prog.alt
+ ./prog.alt 55 # 55 = number of turns, default 21
+ ./prog.alt 42 6666 # 42 = number of turns (default 21), 6666 = hp (default 666)
- ./prog.alt2
+ ./prog.alt2 # submitted code with bug fix
```
## Judges' remarks:
You will have to go to "Fun-Damentals" to understand the logic flow of this
-game. While you goto as many as 149 times and jump hundreds if not over one
-thousand times to travel from `main()` to a successful `exit(666)` you may have
-a devil of a time trying to figure out how this program actually does what it
-does.
+game. While the code might goto as many as 149 times to travel from `main()` to
+a successful `exit(666)` you may have a devil of a time trying to figure out how
+this program actually does what it does as it jumps hundreds if not thousands of
+times.
Before you set off on your adventure to decode this program's logic, make
sure you have enough food, ammo, clothes, oxen, and programming supplies.
@@ -76,19 +78,37 @@ finish and not counting macros but counting all function calls (not libc
functions just the few functions in prog.c), there were a total of **1416** (!)
line jumps. Skipping prog.c function calls and it was still **1131** jumps! The
prog.c, if you remove `#include`s, blank lines, lines with just a brace and
-lines that have only variables, **has just 58 (!) lines of code**. A very tiny
+lines that have only variables, **only has 58 (!) lines of code**. A very tiny
fraction of the time a line might be repeated in a row ONCE but that does not
-really matter.
-
-**NOTE**: I actually submitted two versions. This one is not encrypted. The
-encrypted one even encrypted emojis without having to decrypt them in order to
-print them (and everything else). I have kept references to encryption in this
-file even after publication. I do have a copy of it if anyone is interested.
+really matter, as it is still technically a jump.
**SUGGESTION**: if you dare, try opening
[prog.gotos.c](%%REPO_URL%%/2024/ferguson1/prog.gotos.c) in an editor with
syntax highlighting and then highlight `goto`. Alternatively, try it with `grep`
-if your grep has colours enabled (probably easier).
+if your grep has colours enabled (probably easier). This is a nice one to try:
+
+```
+ grep -E 'heaven|goto|666|hell' prog.gotos.c
+```
+
+Alternatively, in vim you might try, making sure you're in command mode first
+(hit ESC if you don't know - if that doesn't work try hitting it again as it can
+depend on what you're doing):
+
+```
+ /heaven\|goto\|666\|hell
+```
+
+Read it and weep and scream (or curse :-) )!
+
+**NOTE**: I actually submitted two versions, one encrypted (even emojis); any
+document mentioning encryption is left for personal reasons out of
+laziness and exhaustion from working on improving the presentation even after it
+won. I have a copy of the code and data files
+[here](https://ioccc.xexyl.net/2024/oregon/encrypted.txz) (more details on it
+can be found [here](https://ioccc.xexyl.net/2024/oregon/) or else in the
+markdown files in the tarball), if anyone is interested, assuming there's not an
+extended power cut or something else goes wrong.
The following variables are of primary concern (some temporary ones are not documented I think):
V(A+16)) (note that the date is not set
@@ -512,6 +514,8 @@ certain messages. But if you buy more that could in theory happen again. Note
that some messages might be printed instead of the you have run out of oxen
message, if they’re the ones causing it, though I’m not going to say this is in
every case as there are a lot of ways for this to happen.C: alt code only, max number of turns (specified at command line, default
+21).m. make alt
./prog.alt
+ ./prog.alt 55 # 55 = number of turns, default 21
+ ./prog.alt 42 6666 # 42 = number of turns (default 21), 6666 = hp (default 666)
- ./prog.alt2
+ ./prog.alt2 # submitted code with bug fix
You will have to go to “Fun-Damentals” to understand the logic flow of this
-game. While you goto as many as 149 times and jump hundreds if not over one
-thousand times to travel from main() to a successful exit(666) you may have
-a devil of a time trying to figure out how this program actually does what it
-does.
main() to
+a successful exit(666) you may have a devil of a time trying to figure out how
+this program actually does what it does as it jumps hundreds if not thousands of
+times.
Before you set off on your adventure to decode this program’s logic, make
sure you have enough food, ammo, clothes, oxen, and programming supplies.
You’ll be driving for 2170 miles through a wild wilderness inspired
@@ -517,18 +519,28 @@ finish and not counting macros but counting all function calls (not libc
functions just the few functions in prog.c), there were a total of 1416 (!)
line jumps. Skipping prog.c function calls and it was still 1131 jumps! The
prog.c, if you remove #includes, blank lines, lines with just a brace and
-lines that have only variables, has just 58 (!) lines of code. A very tiny
+lines that have only variables, only has 58 (!) lines of code. A very tiny
fraction of the time a line might be repeated in a row ONCE but that does not
-really matter.
NOTE: I actually submitted two versions. This one is not encrypted. The -encrypted one even encrypted emojis without having to decrypt them in order to -print them (and everything else). I have kept references to encryption in this -file even after publication. I do have a copy of it if anyone is interested.
SUGGESTION: if you dare, try opening
prog.gotos.c in an editor with
syntax highlighting and then highlight goto. Alternatively, try it with grep
-if your grep has colours enabled (probably easier).
grep -E 'heaven|goto|666|hell' prog.gotos.c
+Alternatively, in vim you might try, making sure you’re in command mode first +(hit ESC if you don’t know - if that doesn’t work try hitting it again as it can +depend on what you’re doing):
+ /heaven\|goto\|666\|hell
+Read it and weep and scream (or curse :-) )!
NOTE: I actually submitted two versions, one encrypted (even emojis); any
+document mentioning encryption is left for personal reasons out of
+laziness and exhaustion from working on improving the presentation even after it
+won. I have a copy of the code and data files
+here (more details on it
+can be found here or else in the
+markdown files in the tarball), if anyone is interested, assuming there’s not an
+extended power cut or something else goes wrong.
cc -E. First prog.c. Prepare to b
horrified, if you’re not already:
131 goto
301 semicolon
- 143 colons
+ 143 colon
51 if
11 else
3 while
@@ -666,7 +666,7 @@ horrified, if you’re not already:
1.01 goto per keyword? But then there’s the cpp filtered code…
149 goto
339 semicolon
- 143 colons
+ 143 colon
51 if
11 else
7 while
@@ -691,7 +691,7 @@ horrified, if you’re not already:
For comparison, here is the original version:
116 goto
294 semicolon
- 138 colons
+ 138 colon
50 if
11 else
4 while
@@ -715,7 +715,7 @@ horrified, if you’re not already:
And the pre-processed one:
134 goto
332 semicolon
- 138 colons
+ 138 colon
50 if
11 else
8 while
diff --git a/2024/ferguson1/obfuscation.md b/2024/ferguson1/obfuscation.md
index 47e73c308..1919807c3 100644
--- a/2024/ferguson1/obfuscation.md
+++ b/2024/ferguson1/obfuscation.md
@@ -231,7 +231,7 @@ horrified, if you're not already:
```
131 goto
301 semicolon
- 143 colons
+ 143 colon
51 if
11 else
3 while
@@ -259,7 +259,7 @@ horrified, if you're not already:
```
149 goto
339 semicolon
- 143 colons
+ 143 colon
51 if
11 else
7 while
@@ -289,7 +289,7 @@ For comparison, here is the original version:
```
116 goto
294 semicolon
- 138 colons
+ 138 colon
50 if
11 else
4 while
@@ -317,7 +317,7 @@ And the pre-processed one:
```
134 goto
332 semicolon
- 138 colons
+ 138 colon
50 if
11 else
8 while
From c98a12b5934f64d7b7791894a8363bec4197e7a6 Mon Sep 17 00:00:00 2001
From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com>
Date: Thu, 14 Aug 2025 10:30:03 -0700
Subject: [PATCH 3/3] Typo fixes in 2024/ferguson1/commented.c
---
2024/ferguson1/commented.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/2024/ferguson1/commented.c b/2024/ferguson1/commented.c
index 4e7ca8e52..f1ed628a2 100644
--- a/2024/ferguson1/commented.c
+++ b/2024/ferguson1/commented.c
@@ -13,11 +13,6 @@
* mocking you if you eat his frozen body is not tied to an event in prog.c but
* it is here.
*
- * Actually this is closer to prog.alt.c in the sense that event 23 there also
- * has the son ghost mocking the PC. The difference is prog.alt.c has an event
- * 24 and that is not here. This almost certainly has fewer gotos in code (if we
- * count the comments probably not).
- *
* Finally this code is from an earlier version so some of it might be missing,
* not just the events, and not just the gotos, but potentially other things
* too, possibly bugs that were fixed in prog.c but are not here (and no more
@@ -27,7 +22,8 @@
* WARNING: this code and its comments are not up to date. I wrote 116 before
* filtered through the cpp and 134 after the cpp and I didn't wish to
* repeatedly revisit this file trying to explain everything. As it is I barely
- * finished this in time.
+ * finished this in time. After publication this was updated with the complete
+ * version as well.
*/
#include
#include