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] 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.