Merge pull request #194 from xexyl/24ferg1-gotos

2024/ferguson1 bug fix, make goto complete (149)
This commit is contained in:
Landon Curt Noll authored and GitHub committed 2025-08-16 16:37:58 -07:00
commit 975542a5d6
16 files changed
+876 -640

No files matched your search

+10 -2
View File
@@ -38,12 +38,20 @@
"entry_text" : "alternate source code" "entry_text" : "alternate source code"
}, },
{ {
"file_path" : "prog.goto.max.c", "file_path" : "prog.alt2.c",
"inventory_order" : 40, "inventory_order" : 40,
"OK_to_edit" : true, "OK_to_edit" : true,
"display_as" : "c", "display_as" : "c",
"display_via_github" : true, "display_via_github" : true,
"entry_text" : "entry source code with maxed out gotos" "entry_text" : "original source code with minor bug fix"
},
{
"file_path" : "prog.gotos.c",
"inventory_order" : 90,
"OK_to_edit" : true,
"display_as" : "c",
"display_via_github" : true,
"entry_text" : "prog.c with merged lines to show mass of gotos"
}, },
{ {
"file_path" : "prog.orig.c", "file_path" : "prog.orig.c",
+4 -3
View File
@@ -17,10 +17,11 @@ data.scrnshot
lencount lencount
mbcheck mbcheck
printer printer
prog.alt
prog.alt2
prog.alt2.asc
prog.alt2.scrnshot
prog.alt.asc prog.alt.asc
prog.alt.scrnshot prog.alt.scrnshot
prog.asc prog.asc
prog.goto.max
prog.goto.max.asc
prog.goto.max.scrnshot
prog.scrnshot prog.scrnshot
+44 -29
View File
@@ -154,12 +154,12 @@ TARGET= ${PROG} ${PROG}.asc ${PROG}.scrnshot
# .alt is as above more events # .alt is as above more events
# #
ALT_OBJ= ${PROG}.alt.o ${PROG}.alt.asc.o ${PROG}.alt.scrnshot.o ${PROG}.goto.max.o \ ALT_OBJ= ${PROG}.alt.o ${PROG}.alt.asc.o ${PROG}.alt.scrnshot.o \
${PROG}.goto.max.asc.o ${PROG}.goto.max.scrnshot.o ${PROG}.alt2.o ${PROG}.alt2.asc.o ${PROG}.alt2.scrnshot.o
ALT_TARGET= ${PROG}.alt ${PROG}.alt.asc ${PROG}.alt.scrnshot ${PROG}.goto.max \ ALT_TARGET= ${PROG}.alt ${PROG}.alt.asc ${PROG}.alt.scrnshot \
${PROG}.goto.max.asc ${PROG}.goto.max.scrnshot ${PROG}.alt2 ${PROG}.alt2.asc ${PROG}.alt2.scrnshot
# list any data files supplied with the submission # The following notes were provided by the author in his Makefile:
# #
# Don't include data, data.asc or data.scrnshot. # Don't include data, data.asc or data.scrnshot.
# The data rule (although it's better to use makedata the data rule might work - # The data rule (although it's better to use makedata the data rule might work -
@@ -216,7 +216,7 @@ test: lencount mbcheck
@./lencount -t -i data.scrnshot.src @./lencount -t -i data.scrnshot.src
@./mbcheck @./mbcheck
# ASCII only version of submission code, hence why the DATA macro is defined # ASCII only version of entry code, hence why the DATA macro is defined
# here, not in CDEFINE. # here, not in CDEFINE.
# #
${PROG}.asc: ${PROG}.c ${PROG}.asc: ${PROG}.c
@@ -246,7 +246,7 @@ addpadding: addpadding.c
bytecount: bytecount.c bytecount: bytecount.c
${CC} ${CFLAGS} -Wno-unreachable-code-break bytecount.c -o $@ ${LDFLAGS} ${CC} ${CFLAGS} -Wno-unreachable-code-break bytecount.c -o $@ ${LDFLAGS}
# this tool helped me verify the locations of strings were correct (locations # this tool helped verify the locations of strings were correct (locations
# are based on the blocksize). The bytecount also helped. # are based on the blocksize). The bytecount also helped.
# #
bytetest: bytetest.c bytetest: bytetest.c
@@ -258,17 +258,18 @@ bytetest: bytetest.c
byteread: byteread.c byteread: byteread.c
${CC} ${CFLAGS} byteread.c -o $@ ${LDFLAGS} ${CC} ${CFLAGS} byteread.c -o $@ ${LDFLAGS}
# this tool was helpful to help identify if any emojis in the ASCII only version # this tool was earlier used to help in identifying any emojis in the ASCII only
# slipped through (however, mbcheck is a better one: this tool is still # version that might have slipped through (however, mbcheck is a better one: this tool is still
# useful however). Probably only the judges will find this interesting just like # useful however). Mostly provided for the judges but I, the author, included
# most of the tools I have provided. # most of the tools (most of which are meant only for the judges as well).
# #
bytecheck: bytecheck.c bytecheck: bytecheck.c
${CC} ${CFLAGS} -Wno-unreachable-code-break bytecheck.c -o $@ ${LDFLAGS} ${CC} ${CFLAGS} -Wno-unreachable-code-break bytecheck.c -o $@ ${LDFLAGS}
# by default this checks for multibyte characters (well 2, 3, 4) in the ASCII # by default this checks for multibyte characters (well 2, 3, 4) in the ASCII
# data source file, reporting if any are found. If any are found it will report # data source file, reporting if any are found. If any are found it will report
# which string so it can be fixed. # which string so it can be fixed. This is used as part of the build process,
# and if any are found it will fail to compile (or it should).
# #
mbcheck: mbcheck.c mbcheck: mbcheck.c
${CC} ${CFLAGS} -Wno-unreachable-code-break mbcheck.c -o $@ ${LDFLAGS} ${CC} ${CFLAGS} -Wno-unreachable-code-break mbcheck.c -o $@ ${LDFLAGS}
@@ -290,7 +291,8 @@ printer: printer.c
lencount: lencount.c lencount: lencount.c
${CC} ${CFLAGS} -Wno-unreachable-code-break lencount.c -o $@ ${LDFLAGS} ${CC} ${CFLAGS} -Wno-unreachable-code-break lencount.c -o $@ ${LDFLAGS}
# The author provided these notes in his Makefile:
#
# IMPORTANT NOTES FOR THE JUDGES. # IMPORTANT NOTES FOR THE JUDGES.
# #
# The makedata.sh script will generate files that are needed by some of the # The makedata.sh script will generate files that are needed by some of the
@@ -320,9 +322,13 @@ padding: addpadding test
./addpadding ./addpadding
@echo "Done." @echo "Done."
# The author provided these remarks in his Makefile:
#
# see remarks.md for more details. This script is mostly useful for the some of # see remarks.md for more details. This script is mostly useful for the some of
# the other tools but it can be used for prog.c and prog.alt.c indirectly as it # the other tools but it can be used for prog.c and prog.alt.c (and prog.alt2.c
# also does build the data files from the source files. # which is the originally submitted code but with a minor bug fix - prog.alt.c
# was already taken) indirectly as it also does build the data files from the
# source files.
# #
# An example use of when I personally use this rule: when I actually make an # An example use of when I personally use this rule: when I actually make an
# edit to the data source files. As you will probably have noticed the printer.c # edit to the data source files. As you will probably have noticed the printer.c
@@ -345,6 +351,7 @@ ${PROG}.alt: ${PROG}.alt.c
${MAKE} padding ${MAKE} padding
${CC} ${CFLAGS} -DDATA='"data"' ${PROG}.alt.c -o $@ ${LDFLAGS} ${CC} ${CFLAGS} -DDATA='"data"' ${PROG}.alt.c -o $@ ${LDFLAGS}
# ASCII only version of alt code (Devil's Cut above). This is why indeed the # ASCII only version of alt code (Devil's Cut above). This is why indeed the
# DATA variable is not in the CDEFINE - the .asc versions use the data.asc file. # DATA variable is not in the CDEFINE - the .asc versions use the data.asc file.
# #
@@ -352,17 +359,6 @@ ${PROG}.alt.asc: ${PROG}.alt.c
${MAKE} padding ${MAKE} padding
${CC} ${CFLAGS} -DDATA='"data.asc"' ${PROG}.alt.c -o $@ ${LDFLAGS} ${CC} ${CFLAGS} -DDATA='"data.asc"' ${PROG}.alt.c -o $@ ${LDFLAGS}
# goto maxed out - regular data file
#
${PROG}.goto.max: ${PROG}.goto.max.c
${MAKE} padding
${CC} ${CFLAGS} -DDATA='"data"' ${PROG}.goto.max.c -o $@ ${LDFLAGS}
# goto maxed out - ASCII only data file
#
${PROG}.goto.max.asc: ${PROG}.goto.max.c
${MAKE} padding
${CC} ${CFLAGS} -DDATA='"data.asc"' ${PROG}.goto.max.c -o $@ ${LDFLAGS}
# screenshot friendly version of alt code # screenshot friendly version of alt code
# #
@@ -370,11 +366,30 @@ ${PROG}.alt.scrnshot: ${PROG}.alt.c
${MAKE} padding ${MAKE} padding
${CC} ${CFLAGS} -DDATA='"data.scrnshot"' ${PROG}.alt.c -o $@ ${LDFLAGS} ${CC} ${CFLAGS} -DDATA='"data.scrnshot"' ${PROG}.alt.c -o $@ ${LDFLAGS}
# goto maxed out - screenshot friendly version # For practical reasons, the author submitted code that was not as full of gotos
# as he had in mind. After the win he decided to add it to the repo. But since
# there was already an alt.c file this original code, which has a minor bug fix,
# is in .alt2.c.
# #
${PROG}.goto.max.scrnshot: ${PROG}.goto.max.c
# Original submitted code with a minor bug fix
#
${PROG}.alt2: ${PROG}.alt2.c
${MAKE} padding ${MAKE} padding
${CC} ${CFLAGS} -DDATA='"data.scrnshot"' ${PROG}.goto.max.c -o $@ ${LDFLAGS} ${CC} ${CFLAGS} -DDATA='"data"' ${PROG}.alt2.c -o $@ ${LDFLAGS}
# Original submitted code with a minor bug fix - ASCII only version
#
${PROG}.alt2.asc: ${PROG}.alt2.c
${MAKE} padding
${CC} ${CFLAGS} -DDATA='"data.asc"' ${PROG}.alt2.c -o $@ ${LDFLAGS}
# Original submitted code with a minor bug fix - screenshot friendly version
#
${PROG}.alt2.scrnshot: ${PROG}.alt2.c
${MAKE} padding
${CC} ${CFLAGS} -DDATA='"data.scrnshot"' ${PROG}.alt2.c -o $@ ${LDFLAGS}
# data files # data files
# #
+135 -110
View File
@@ -29,8 +29,11 @@ YouTube show for this entry:
## Alternate code: ## Alternate code:
The author provided two alternate versions, one which has more events and far The author provided two alt versions: one submitted with more events, though not
fewer `goto`s and the other which maxed out the `goto`s at 149 (up from 134)! many more, along with a few other functional differences, and after winning, the
prog.c was made the prog.alt2.c code and the prog.c was made the complete
version (149 `goto`s up from 134) that was not made prog.c during submission for
practical reasons.
### Alternate build: ### Alternate build:
@@ -44,43 +47,52 @@ fewer `goto`s and the other which maxed out the `goto`s at 149 (up from 134)!
``` <!---sh--> ``` <!---sh-->
./prog.alt ./prog.alt
./prog.alt2
``` ```
## Judges' remarks: ## Judges' remarks:
You will have to go to "Fun-Damentals" to understand the logic flow of You will have to go to "Fun-Damentals" to understand the logic flow of this
this game. While you jump as many as 134 times to travel from `main()` game. While you goto as many as 149 times and jump hundreds if not over one
to a successful `exit(666)` you may have a devil of a time trying to thousand times to travel from `main()` to a successful `exit(666)` you may have
figure out how this program actually does what it does. a devil of a time trying to figure out how this program actually does what it
does.
Before you set off on your adventure to decode this program's logic, make 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. sure you have enough food, ammo, clothes, oxen, and programming supplies.
You’ll be driving for 2170 miles through a wild wilderness inspired You’ll be driving for 2170 miles through a wild wilderness inspired
by [Oregon Trail](https://en.wikipedia.org/wiki/The_Oregon_Trail_&lpar;series&rpar;), so you’ll need to be prepared for anything! Regardless of by [Oregon
how well prepared you are, you will have a devil of a time jumping around Trail](https://en.wikipedia.org/wiki/The_Oregon_Trail_&lpar;series&rpar;), so
inside this C code. :-) you’ll need to be prepared for anything! Regardless of how well prepared you
are, you will have a devil of a time jumping around inside this C code. :-)
## Author's remarks: ## Author's remarks:
> Fun fact: after winning this, the author played the game in gdb from start to > Fun fact: after winning this, the author played the game in gdb from start to
finish and not counting macros but counting all function calls (not libc 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 **985** (!) 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 **776** jumps! The 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 prog.c, if you remove `#include`s, blank lines, lines with just a brace and
lines that have only variables, **has just 59 (!) lines of code**. A very tiny lines that have only variables, **has just 58 (!) lines of code**. A very tiny
fraction of the time a line might be repeated in a row ONCE but that does not fraction of the time a line might be repeated in a row ONCE but that does not
really matter. The [maxed out goto really matter.
version](%%REPO_URL%%/2024/ferguson1/prog.goto.max.c) is far worse.
**NOTE**: I actually submitted two versions. This one is not encrypted. The **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 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 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. file even after publication. I do have a copy of it if anyone is interested.
**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).
<div id="devil"> <div id="devil">
### A Pact With the Devil On the Oregon Trail (...and his 134 regrets of goto) ### A Pact With the Devil On the Oregon Trail (...and his <del>134</del> 149 regrets of goto)
</div> </div>
The _Go To Hell In A Handcart Travel Company_ **PROUDLY** welcomes all sinners to The _Go To Hell In A Handcart Travel Company_ **PROUDLY** welcomes all sinners to
@@ -2161,8 +2173,9 @@ features versus problems, though possibly more exist.
Obviously since you can buy oxen at the forts (something not possible in the Obviously since you can buy oxen at the forts (something not possible in the
original game for some reason) then even if you ran out (and perhaps you ate original game for some reason) then even if you ran out (and perhaps you ate
one) it could happen again. Remember you might end up eating an ox just because one, which of course is not in the original either) it could happen again.
he looks at you funny, not just because you are out of food. Remember you might end up eating an ox just because he looks at you funny, not
just because you are out of food!
If you don't have an ox and you are out of food you die from starvation. But If you don't have an ox and you are out of food you die from starvation. But
what happens when you die of starvation? Well it says: what happens when you die of starvation? Well it says:
@@ -2193,31 +2206,32 @@ to do much at all unless you had a great amount of it; which of course the
player character (PC) does not. player character (PC) does not.
Actually the only reason: for the amusing rhyme that fits with the jokes, Actually the only reason: for the amusing rhyme that fits with the jokes,
nothing else (it makes it more interesting and amusing than 'You ran out of food nothing else (but it *does* make it more interesting and amusing than 'You ran
and starved to death', doesn't it?). out of food and starved to death', doesn't it?).
The fact the original game does not have you decide on drinking water (and see The fact the original game does not have you decide on drinking water (and see
section on other differences for the subject of decision making) means I could section on other differences for the subject of decision making) means I could
take some liberty with it. Besides, didn't I say you would learn by what did not take some liberty with it. Besides, didn't I say you would learn by what did not
happen? They certainly did drink water and unsafe water (I'm sure) too, so my happen? They certainly did drink water and unsafe water (I'm sure) too, so my
joke is all the more appropriate (even if it's inappropriate in some company joke is all the more appropriate (even if it's inappropriate in some company
:-), perhaps your grandparents - although depending on your age now maybe not). :-), perhaps your grandparents - although depending on your age now maybe not.
May my grandparents rest in peace, hopefully not with the devil).
Sometimes it is suggested an ox is lost/whatever (not lost as in it wanders off Sometimes it is suggested an ox is lost/whatever (not lost as in it wanders off
but rather in the sense that you have fewer oxen) even if you don't have one. It but rather in the sense that you have fewer oxen, for instance getting stuck in
does this in a number of ways like referring to the famous 'spared no expense' a river) even if you don't have one. It does this in a number of ways like
from Jurassic Park. It also is a nod the IOCCC guidelines that talk about a fish referring to the famous 'spared no expense' from Jurassic Park. It also is a nod
Eric that might or might not exist. the IOCCC guidelines that talk about a fish Eric that might or might not exist.
I decided to not call him Eric because there is potential for more than one ox I decided to not call him Eric because there is potential for more than one ox
(you'll note in other messages I got past this issue by making it like in real (you'll note in other messages I got past this issue by making it like in real
life - wagon trains and large groups - though again some times wagon for the life - wagon trains and large groups - though again sometimes wagon for the
joke - plus being ambiguous). Of course the narrator as the Devil is telling all joke - plus being ambiguous). Of course the narrator as the Devil is telling all
sorts of lies too so that hardly matters. sorts of lies too so that hardly matters.
As for whether this could happen: in theory it could but if you run out of oxen As for whether this could happen: in theory it could but if you run out of oxen
you're not going to get very far anyway. In other cases, like eating an oxen, you're not going to get very far anyway. In other cases, like eating an ox, the
the check is in place, although in retrospect it would be very amusing if it did check is in place, although in retrospect it would be very amusing if it did
not. But that would still not be realistic and some of this has to be at least not. But that would still not be realistic and some of this has to be at least
somewhat realistic. somewhat realistic.
@@ -2467,10 +2481,12 @@ really does not seem to be dead (it's quite sneaky).
I could be wrong on whether this is one the compiler missed though: it's hard to I could be wrong on whether this is one the compiler missed though: it's hard to
follow all the `goto`s. As you find out in [obfuscation.html](obfuscation.html) it's follow all the `goto`s. As you find out in [obfuscation.html](obfuscation.html) it's
134 after pre-processing! One of the alt versions I supplied is 131 before the 149 after pre-processing! The second alt code is what I originally submitted as
cpp and 149 after. I did not submit that for practical reasons but I kind of prog.c but after winning I made the more complete (149 gotos post cpp, 131 prior
wish I had, now that it won. Nonetheless 134 is already way too many. 149 is to cpp) version (that was not submitted for practical reasons) the prog.c.
much worse. Nonetheless 134 is already way too many. 149 is much worse. Even 116 which was
the original prog.c before cpp is too many; that's 7 more than the 1978 BASIC
game (!). But it's actually 131 which is 22 more.
Yes I might be mad. But then again I might just be the Devil. Who knows? What I Yes I might be mad. But then again I might just be the Devil. Who knows? What I
do know is code that is meant to be reached is reached! Yes I've played it many do know is code that is meant to be reached is reached! Yes I've played it many
@@ -2597,8 +2613,8 @@ It is **NOT** a bug when an ox kicks a bucket message that no oxen is decreased
as it's a joke and merely a possible foreshadowing of what is to come. The as it's a joke and merely a possible foreshadowing of what is to come. The
message that they shouldn't try telling the narrator they don't have one (if message that they shouldn't try telling the narrator they don't have one (if
they can even count) because it just kicked the bucket cleverly sidesteps (or they can even count) because it just kicked the bucket cleverly sidesteps (or
does it sidekick?) that issue - it's not even meant to eliminate one as it was does it sidekick?) that issue - it's not even meant to eliminate one as if it
kicking a bucket physically, not kicking the bucket figuratively (or in this was kicking a bucket physically, not kicking the bucket figuratively (or in this
case it might also be literally - although paradoxically also not). case it might also be literally - although paradoxically also not).
It is **NOT** a bug that when you get dysentery you jump past the mountains It is **NOT** a bug that when you get dysentery you jump past the mountains
@@ -2609,7 +2625,12 @@ turn. Also this does mean that they 'lose a turn' which seems plausible. Look at
it this way: those other events could also happen in the mountains, so it's not it this way: those other events could also happen in the mountains, so it's not
really an illogical choice anyway; the separation is there because they were not really an illogical choice anyway; the separation is there because they were not
at the mountains immediately (obviously). I believe (not sure but I think) you at the mountains immediately (obviously). I believe (not sure but I think) you
can survive with dysentery if you have enough hp. can survive with dysentery if you have enough hp and turns. Now one might say
that not going straight to the doctor might make more sense or rather one should
go to the doctor (at the mountains, if they were there), and then back to the
mountains. But this would cause other problems: for instance if one does not
have enough money to pay for the doctor: say for instance seeing the message
twice and also losing even more hp/mileage. That would be a broken design.
On occasion an event might not fire (or rather it fires but nothing seems to On occasion an event might not fire (or rather it fires but nothing seems to
happen). This is **NOT** a bug when it does. In fact it can be a lifesaver due happen). This is **NOT** a bug when it does. In fact it can be a lifesaver due
@@ -2627,7 +2648,7 @@ so that it directly assigns to `q` the value 11 (at least I think it was case 11
\- it appears so). There are other ways to trigger this though, if you were to \- it appears so). There are other ways to trigger this though, if you were to
modify the code. Note that this does **NOT** mean that no events would fire. It modify the code. Note that this does **NOT** mean that no events would fire. It
just means you'll see what I mean more easily. Some events are triggered just means you'll see what I mean more easily. Some events are triggered
indirectly and others happen once you reach the mountains, for example. indirectly and others happen once you reach the mountains, for examples.
Another one. In case you noticed the code: Another one. In case you noticed the code:
@@ -2688,10 +2709,11 @@ wanted so THERE SIMPLY IS NO FLOW CONTROL ERROR.
Of course not all the jokes are equal although they're almost all absurd in some Of course not all the jokes are equal although they're almost all absurd in some
way or another. Sometimes I manipulated the joke to fit into the code itself and way or another. Sometimes I manipulated the joke to fit into the code itself and
vice versa. This was done numerous times in fact. The fact though that the vice versa. This was done numerous times in fact. The fact that the narrator is
narrator is the devil means that some of that was not even necessary, given that the devil means that some of that was not even necessary, given that he (as I
he (as I have shown in this file) cannot be trusted and says things that are have shown in this file) cannot be trusted and says things that are totally
totally bogus and many that make absolutely no sense. bogus and many that make absolutely no sense...kind of like the entire theme of
the game, but that only makes it more fun.
The fact he refers to himself as if he's someone else is ludicrous on its own The fact he refers to himself as if he's someone else is ludicrous on its own
but there are so many other things. Those things I changed were good to change but there are so many other things. Those things I changed were good to change
@@ -3030,17 +3052,21 @@ what this is. And even then it shouldn't be easy to follow the code, for reasons
I mentioned in [obfuscation.html](obfuscation.html) (and some briefly below). I mentioned in [obfuscation.html](obfuscation.html) (and some briefly below).
In general I think it's extremely hard to follow the flow of this program due to In general I think it's extremely hard to follow the flow of this program due to
the abuse of 116 `goto`s, more than the BASIC game. 134 when pre-processed. But the abuse of <del>116</del> 131 `goto`s, more than the BASIC game.
let's be honest, or 134 for a small C program is too many but to be only six <del>134</del> 149 when pre-processed. But
fewer than a larger BASIC program? That is hard to fathom. Not that 116 is not let's be honest, or 131 for a small C program is too many but to be seven more
too many for larger programs...or one goto, for that matter. As noted elsewhere, than the larger BASIC program? That is hard to fathom. Not that <del>116</del>
an alt version has 131/149 gotos, before/after the cpp. I did not make it the 131/149 is not too many for larger programs...or one goto, for that matter.
main version when submitting because I did not want to make the judges weep and
curse any more than they already had to (besides, it can't be 4666 bytes with
the extra `goto`s) but now that it's in I have no qualms about providing it as
alt code: if I am going to ruin `goto`s I might as well do it properly.
Some things are clear about the program from visual inspection: As noted elsewhere, I originally submitted a slightly less goto complete
version, with 116/134 gotos, before/after the cpp, which was due to practical
reasons, and to make the judges weep (and probably curse the Devil - and author,
who might easily be mistaken for the Devil) a little bit less. But really, if I
am going to ruin `goto`s like I did: why should I not do it properly? So it's
now maxed out with all the other [obfuscation](obfuscation.html) and the many
events and fun gameplay.
Anyway, some things are clear about the program from visual inspection:
- it is clear the program does print SOME THINGS (but it is **NOT clear WHAT** - it is clear the program does print SOME THINGS (but it is **NOT clear WHAT**
is printed). is printed).
@@ -3157,23 +3183,24 @@ I probably wouldn't have written code that looks illegal like the
if not most contexts it IS illegal). The bastardised Duff's device I would not if not most contexts it IS illegal). The bastardised Duff's device I would not
do. I would not put the entire function in a switch. do. I would not put the entire function in a switch.
But above all I would not have used 116 (or 134) `goto`s. Or ten. Or five. Or But above all I would not have used <del>116</del> 131 (or <del>134</del> 149)
even one. Better to let code generators like flex/bison take the crown. I have `goto`s. Or ten. Or five. Or even one. Better to let code generators like
dethroned them though (at least from what I have seen before) - by a huge flex/bison take the crown. I have dethroned them though (at least from what I
amount. But perhaps [1987/hines](https://www.ioccc.org/1987/hines/index.html) have seen before) - by a huge amount. But perhaps
had the crown. It no longer does. I should be ashamed. I'm not. [1987/hines](https://www.ioccc.org/1987/hines/index.html) had the crown. It no
longer does. I should be ashamed. I'm not. Devils feel no shame.
But even if I were to abuse `goto` I would not normally use it in the ways I did, as But even if I were to abuse `goto` I would not normally use it in the ways I did, as
noted earlier and in [obfuscation.html](obfuscation.html)! noted earlier and in [obfuscation.html](obfuscation.html)!
If I am ever dethroned, assuming I now have the crown as I think I do (and I If I am ever dethroned, assuming I now have the crown as I think I do (and I
hope I do because if I do not there is something very wrong), I will be hope and guess I do, even outside the IOCCC, because if I do not there is
absolutely horrified. something very wrong), I will be absolutely horrified.
Okay I'll be kind of amused too but I would be horrified. Still I guess in the Okay I'll be kind of amused too but I would be horrified. Still I guess in the
context of the IOCCC I really have reached the logical conclusion of `goto`s context of the IOCCC I really have reached the logical conclusion of `goto`s
(which, as you'll see, the 1987/hines one, was thought to be by the judges the (which, as you'll see, the 1987/hines one, was thought to be by the judges the
logical conclusion - see below for more information on THAT and an exercise in 'logical conclusion' - see below for more information on THAT and an exercise in
absurdity), or at least I hope so. absurdity), or at least I hope so.
It's about time either way. Hopefully the judges will take `goto` and throw it It's about time either way. Hopefully the judges will take `goto` and throw it
@@ -3231,10 +3258,12 @@ mean many `goto`s.
There are so many `goto`s that to try and move code to add more `goto`s is There are so many `goto`s that to try and move code to add more `goto`s is
basically pointless, unless as a joke. In this program it would really not do basically pointless, unless as a joke. In this program it would really not do
anything. I essentially ran out of code to move. Even if I had more though, anything. I essentially ran out of code to move. Even if I had more though,
isn't 134 enough, especially in a program that, counting spaces, including isn't <del>134</del> 149 enough, especially in a program that, counting spaces,
unnecessary spaces to add to the size, is only 4666 bytes? It would be smaller including unnecessary spaces to add to the size, is only 4666 bytes? It would be
except to stay on theme. Doing more would no longer be funny. Enough is enough. smaller except to stay on theme. Doing more would no longer be funny. Enough is
Or at least I hope. enough. Or at least I hope. Okay...actually I take that back. More would be
funnier. But it would have sacrificed the rest of the game and that would be a
tragedy.
But it really is that extreme. But it really is that extreme.
@@ -3263,7 +3292,9 @@ ineffable.
Actually I wanted to see what it was like. It was VERY amusing - but only Actually I wanted to see what it was like. It was VERY amusing - but only
because I did not have to debug it. For the submission I included line changes because I did not have to debug it. For the submission I included line changes
for JUST the third prompt. Yes, what would only take a few seconds of play. It for JUST the third prompt (this means the prog.orig.c file: as noted I made the
prog.c the complete version instead, and made prog.c as submitted the
prog.alt2.c, after the win). Yes, what would only take a few seconds of play. It
looked like this (I only did the third prompt as I had mere hours left to looked like this (I only did the third prompt as I had mere hours left to
finish): finish):
@@ -3281,14 +3312,14 @@ full sequence. This is from start to finish and I include it for your amusement
(see [jumps.txt](jumps.txt) for the line changes including calls to prog.c (see [jumps.txt](jumps.txt) for the line changes including calls to prog.c
functions). Or horror. There are a few times where the line functions). Or horror. There are a few times where the line
is the same but that only shows how very often the line changes. It is a total is the same but that only shows how very often the line changes. It is a total
of **985** (!) changes, counting function calls, and **776** (!) excluding of **1416** (!) changes, counting function calls, and **1131** (!) excluding
function calls. Macros are not counted of course. function calls. Macros are not counted of course.
This program, if you remove blank lines and lines with just a brace, This program, if you remove blank lines and lines with just a brace,
`#include`s and only variables, has a mere 59 (!) lines. `#include`s and only variables, has a mere 58 (!) lines.
A program that has only 59 lines of code that jumps 985 (counting functions) or A program that has only 58 lines of code that jumps 1416 (counting functions) or
776 (just in main()) times is astonishing. Of course that's not the 1131 (just in main()) times is astonishing. Of course that's not the
only technique but the title of the award and the judges' remarks are rather only technique but the title of the award and the judges' remarks are rather
fitting as it is diabolical to follow this code (and the theme of the game fits fitting as it is diabolical to follow this code (and the theme of the game fits
as well); the [obfuscation.html](obfuscation.html) shows even more on this - and as well); the [obfuscation.html](obfuscation.html) shows even more on this - and
@@ -3308,14 +3339,14 @@ It is not about not trying. But even IF he WAS right, he
sure as hell is wrong NOW. Anyone who thinks otherwise needs to try and debug sure as hell is wrong NOW. Anyone who thinks otherwise needs to try and debug
my program - or maintain it. Or write it. my program - or maintain it. Or write it.
It would have been SO MUCH EASIER if I did not use 134 `goto`s (and I could have It would have been SO MUCH EASIER if I did not use <del>134</del> 149 `goto`s.
fit more in). Actually, even a Actually, even a tiny portion of that would make it harder. Nobody, whether
tiny portion of that would make it harder. Nobody, whether they're in their they're in their right mind or not, would WANT to MAINTAIN this, or something
right mind or not, would WANT to maintain this, or something even close to it. even close to it. Feel free to pass on judgement to me. I welcome it! You have
Feel free to pass on judgement to me. I welcome it! You have to be mad and to be mad and embrace it to do this. I went full out and I could have fit more
embrace it to do this. I went full out and I could have fit more `goto`s in: not `goto`s in: not only is the iocccsize not 2503 (although it's close now) but I
only is the iocccsize not 2503 but I could have removed some events if I really could have removed some events if I really wanted more `goto`s. That would be
wanted more `goto`s. less fun.
Even flex/bison code, which as far as I am aware uses FAR fewer `goto`s, is Even flex/bison code, which as far as I am aware uses FAR fewer `goto`s, is
notorious for `goto`s and is quite hard to follow. It would be a nightmare to notorious for `goto`s and is quite hard to follow. It would be a nightmare to
@@ -3352,7 +3383,7 @@ made even a few more commits. As it is it took a full two months and I BARELY
finished this. In fact I finished it within hours of the contest closing! It was finished this. In fact I finished it within hours of the contest closing! It was
not even 12 hours before closing time. I barely made it. Part of that is I added not even 12 hours before closing time. I barely made it. Part of that is I added
even more `goto`s, despite the fact I had reached 2503 in size, with careful even more `goto`s, despite the fact I had reached 2503 in size, with careful
size optimisation. size optimisation, though it got below that.
Countless times I came up with ways to do more, at least where it was possible, Countless times I came up with ways to do more, at least where it was possible,
such as freeing space so I could change some `break;`s to a `goto Z;` as `Z:` such as freeing space so I could change some `break;`s to a `goto Z;` as `Z:`
@@ -3360,23 +3391,15 @@ was already there. The only other times this happened is before I had changed
the code so much that you can no longer trust what a block of code is. Like I the code so much that you can no longer trust what a block of code is. Like I
said, I could not really move any more code if I wanted to, even if I had more said, I could not really move any more code if I wanted to, even if I had more
space free. Those very few places where the code could in theory be moved are space free. Those very few places where the code could in theory be moved are
already controlled by goto. already controlled by goto. The current `prog.c` has even more of this as it's
the goto complete version.
In fact I could have done more `goto`s in this version but I wanted to help the
judges out in judging - that and it was easier to verify things are correct.
`iocccsize` reports on prog.c 2457 and after I won this I kind of wish I did
take it even further just to mess with everyone even more.
But as I said elsewhere basically everything is in the wrong place so what even But as I said elsewhere basically everything is in the wrong place so what even
would be the point in doing that? It would probably not make it harder to follow would be the point if I had more space? It would probably not make it harder to follow
(well it would but still would there be a point in it?); it would just make it (well it would but still would there be a point in it?); it would just make it
even more absurd: the amount of spaghetti code makes it nigh impossible to even more absurd: the amount of spaghetti code makes it nigh impossible to
follow and I'm happy to have smashed the record of 24 by 110 `goto`s, even if I follow and I'm happy to have smashed the record of 24 by <del>110</del> 125
now wish I had gone even further. `goto`s.
Nonetheless the 134 is what won so that's what I'll live by (and I doubt it'll
be broken as this kind of trick will, as the general remarks about the entries
note, not be as worthy, even if `goto`s are alas, not banned outright).
Anyway, as I noted in [obfuscation.html](obfuscation.html), no initialisation is Anyway, as I noted in [obfuscation.html](obfuscation.html), no initialisation is
skipped in my jumps and that is what causes `goto` to invoke UB. skipped in my jumps and that is what causes `goto` to invoke UB.
@@ -3456,8 +3479,8 @@ Anyway, I am reminded of Apple's **SINGLE** misplaced `goto` that caused a
That's all it takes: **JUST ONE `goto` led to a CVE**! That's all it takes: **JUST ONE `goto` led to a CVE**!
It is ironic, perfect and hilarious that it was `goto fail;` as it was actually It is ironic, perfect and hilarious that it was `goto fail;` as it was actually
a failure in using `goto`! My code has 134 (with the cpp, 116 without). That is a failure in using `goto`! My code has <del>134</del> 149 (with the cpp,
obscene. I did not fail. At all. <del>116</del> 131 without). That is obscene. I did not fail. At all.
On the contrary I have made a point. Okay, that is not the only reason I did it On the contrary I have made a point. Okay, that is not the only reason I did it
but when I got started I couldn't help it...I thought it was (and still do think but when I got started I couldn't help it...I thought it was (and still do think
@@ -3501,12 +3524,12 @@ In BASIC and asm and some other languages jumps are a core part of the language.
And those languages can be harder to maintain partly because of jumps. C is not And those languages can be harder to maintain partly because of jumps. C is not
one of those languages. Or it wasn't until now. one of those languages. Or it wasn't until now.
Yes, yes...I know, I **KNOW** I put in 116 `goto`s with 134 when pre-processed Yes, yes...I know, I **KNOW** I put in <del>116</del> 131 `goto`s with
and that is probably more extreme than any other C program, especially in such a <del>134</del> 149 when pre-processed and that is probably more extreme than any
small program (and I REALLY hope I'm right there!). But **this does NOT matter**! other C program, especially in such a small program (and I REALLY hope I'm right
Even if one or two were not harmful (but they are) it's jumping down a rabbit there!). But **this does NOT matter**! Even if one or two were not harmful (but
hole that can very easily get deeper and deeper just like Alice found. When they are) it's jumping down a rabbit hole that can very easily get deeper and
there's no **NEED** for it it's much worse. deeper just like Alice found. When there's no **NEED** for it it's much worse.
`goto`s are harmful and destroy flow control. I have shown a fair few obscure `goto`s are harmful and destroy flow control. I have shown a fair few obscure
things about C, some which SEEM ILLEGAL but are not, but above all I have shown things about C, some which SEEM ILLEGAL but are not, but above all I have shown
@@ -3558,26 +3581,28 @@ recognise what I mean - and yes it's in the game).
On a lighter note (or maybe this is darker?): did you know that every time a On a lighter note (or maybe this is darker?): did you know that every time a
`goto` is used an angel (whatever you consider an angel) **DIES** and goes `goto` is used an angel (whatever you consider an angel) **DIES** and goes
straight to HELL? You don't really want that do you? I didn't think so. Yes I straight to HELL? You don't really want that do you? I didn't think so. Yes I
killed 134 angels. YES I condemned 134 angels to eternal torment. I **HAD** to. killed <del>134</del> 149 angels. YES I condemned <del>134</del> 149 angels to
I don't regret it - but you should, if you **ever** write something like this eternal torment. I **HAD** to. I don't regret it - but you should, if you
outside the IOCCC. In fact you should regret a single <del>goto</del> angel **ever** write something like this outside the IOCCC. In fact you should regret
dying. Even if they did not go straight to hell in a handcart, you should still a single <del>goto</del> angel dying. Even if they did not go straight to hell
regret it. But they do. Okay so I don't really believe that but there is no in a handcart, you should still regret it. But they do. Okay so I don't really
denying there is goto hell here. believe that but there is no denying there is goto hell here.
I found my abuse of `goto` hilarious. It was good intentions - the contest. But I <del>found</del> find my abuse of `goto` hilarious. It was good intentions -
sadly sometimes the worst things that happen start with good intentions; and the contest. But sadly sometimes the worst things that happen start with good
some of the best things strangely start with horrible intentions. It might be intentions; and some of the best things strangely start with horrible
that I did this with good intentions for the contest but it would not be good intentions. It might be that I did this with good intentions for the contest but
anywhere else. I would be beyond angry if I had to maintain this code. I would it would not be good anywhere else. I would be beyond angry if I had to maintain
not blame anyone if they cursed me. I probably would be too. Not cursing you. I this code. I would not blame anyone if they cursed me. I probably would be too.
mean cursing me. Not cursing you. I mean cursing me.
Don't write code like this. Except for the IOCCC. Unless of course the judges Don't write code like this. Except for the IOCCC. Unless of course the judges
decide they want no more `goto`s. I would not put that past them after what I decide they want no more `goto`s. I would not put that past them after what I
have done. I can imagine them screaming and crying. Hopefully they're laughing have done. I can imagine them screaming and crying. Hopefully they're laughing
at more than the jokes but I hope they laugh at this too. Well we'll see I at more than the jokes but I hope they laugh at this too. Well we'll see I
guess... guess... (it appears that, based on the general remarks by the judges, of the
winning entries, that `goto` will no longer hold nearly as much water, and that
makes me happy).
Frankly THIS PROGRAM SHOULD NOT WORK! But it does and it works well even if the Frankly THIS PROGRAM SHOULD NOT WORK! But it does and it works well even if the
flow-control is a horrible nightmare from hell. Perhaps the Devil truly has flow-control is a horrible nightmare from hell. Perhaps the Devil truly has
+11 -5
View File
@@ -7,11 +7,16 @@
* Please note that the order of events (the q = x(0,23)) might be in a * Please note that the order of events (the q = x(0,23)) might be in a
* different order than the prog.c as some were added quite late and I just * different order than the prog.c as some were added quite late and I just
* pushed them in in prog.c without much thinking (which actually caused some * pushed them in in prog.c without much thinking (which actually caused some
* problems that had to be fixed). I am not sure if that actually happened and * problems that had to be fixed). In prog.c the event numbers are 0,22 (a bug
* there might even be some missing events but just as a note. * in the submitted code was fixed - the switch was x(0,23) but there is no case
* 23 there) but here you see it's 0,23 and the order is different. The son
* mocking you if you eat his frozen body is not tied to an event in prog.c but
* it is here.
* *
* You might notice that the prog.alt.c has some additional events but those are * Actually this is closer to prog.alt.c in the sense that event 23 there also
* not here. * 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, * 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 * not just the events, and not just the gotos, but potentially other things
@@ -21,7 +26,8 @@
* *
* WARNING: this code and its comments are not up to date. I wrote 116 before * 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 * filtered through the cpp and 134 after the cpp and I didn't wish to
* repeatedly revisit this file trying to explain everything. * repeatedly revisit this file trying to explain everything. As it is I barely
* finished this in time.
*/ */
#include<stdio.h> #include<stdio.h>
#include<string.h> #include<string.h>
+120 -123
View File
@@ -1,134 +1,131 @@
goto hell; \
goto M; \
goto A; goto A;
goto f; goto f;
goto PP; goto PP;
goto hell; goto hell;
goto M; goto M;
goto hell; w(40) PP : goto G;
goto M; w(41) w(45) g : goto S;
goto G; goto CC;
goto hell; goto _;
goto M; goto L;
goto hell; goto i;
goto M; goto kk;
goto S; goto HA;
goto hell; goto at;
goto M; goto I;
goto OO; goto r;
goto L; goto II;
goto i; goto F;
goto kk; goto c;
goto HA; goto zz;
goto at; goto qq;
goto I; goto C;
goto r; goto N;
goto II; goto dd;
goto F; goto jj;
goto c; goto oo;
goto zz; goto ee;
goto qq; goto x;
goto C; goto heaven;
goto N; goto XT;
goto dd; goto ET;
goto jj; goto v;
goto oo; goto x;
goto ee; goto v;
goto x; goto ZZ;
goto heaven; goto bb;
goto XT; goto s;
goto ET; goto X;
goto v; goto v;
goto x; goto T;
goto v; goto y;
goto ZZ; goto E;
goto bb; goto d;
goto s; goto vv;
goto X; goto P;
goto v; goto to;
goto T; goto y;
goto y; goto TA;
goto E; goto BB;
goto d; goto LL;
goto P; goto uu;
goto to; goto JJ;
goto y; goto B;
goto TA; goto h;
goto BB; goto l;
goto LL; goto C;
goto uu; goto u;
goto JJ; goto e;
goto B; goto Y;
goto h; goto P;
goto l; goto K;
goto e; goto tt;
goto hell; goto Z;
goto M; goto Z;
goto Y; goto Z;
goto P; goto Z;
goto K; goto W;
goto tt; goto Z;
goto Z; goto ha;
goto W; goto D;
goto ha; goto OO;
goto D; goto m;
goto m; goto Z;
goto Z; goto H;
goto H; goto Z;
goto Z; goto Z;
goto g; goto Z;
goto Z; goto g;
goto Z; goto Z;
goto Z; goto Z;
goto Y; goto Z;
goto MM; goto Y;
goto hell; goto MM;
goto M; goto J;
goto J; N : goto Q;
goto Q;
goto k;
goto W;
goto hell;
goto M;
goto q;
goto TT;
goto P;
goto U;
goto hell;
goto M;
goto QQ;
goto KK;
goto z;
goto k; goto k;
goto W;
goto xx;
goto mm;
goto TT;
goto P;
goto U;
goto QQ;
goto KK;
goto z;
goto k;
goto k;
goto k; goto k;
goto k; w(99) goto M;
goto hell; goto yy;
goto M;
goto M;
goto yy;
goto Z;
goto rr;
goto hell;
goto M;
goto a;
goto Z;
goto Z; goto Z;
goto rr;
w(27) I : goto a;
goto Z; goto Z;
goto go; goto Z;
goto ii; goto Z;
goto o; goto Z;
goto V; goto go;
goto Z; goto ii;
goto Y; goto o;
goto O; goto V;
goto W; goto Z;
goto b; goto Y;
goto n; goto O;
goto p; goto q;
goto x; goto W;
goto j; goto b;
goto n; goto n;
goto R; goto p;
goto t; goto x;
goto n; goto j;
goto u; goto n;
goto w; goto R;
goto t;
goto n;
goto DD;
goto w;
goto yy;
goto _; goto _;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 KiB

After

Width:  |  Height:  |  Size: 220 KiB

+135 -110
View File
@@ -486,41 +486,51 @@ YouTube show for this entry:</p>
<h2 id="try">Try:</h2> <h2 id="try">Try:</h2>
<pre><code> ./try.sh</code></pre> <pre><code> ./try.sh</code></pre>
<h2 id="alternate-code">Alternate code:</h2> <h2 id="alternate-code">Alternate code:</h2>
<p>The author provided two alternate versions, one which has more events and far <p>The author provided two alt versions: one submitted with more events, though not
fewer <code>goto</code>s and the other which maxed out the <code>goto</code>s at 149 (up from 134)!</p> many more, along with a few other functional differences, and after winning, the
prog.c was made the prog.alt2.c code and the prog.c was made the complete
version (149 <code>goto</code>s up from 134) that was not made prog.c during submission for
practical reasons.</p>
<h3 id="alternate-build">Alternate build:</h3> <h3 id="alternate-build">Alternate build:</h3>
<pre><code> make alt</code></pre> <pre><code> make alt</code></pre>
<h3 id="alternate-use">Alternate use:</h3> <h3 id="alternate-use">Alternate use:</h3>
<pre><code> ./prog.alt</code></pre> <pre><code> ./prog.alt
./prog.alt2</code></pre>
<h2 id="judges-remarks">Judges’ remarks:</h2> <h2 id="judges-remarks">Judges’ remarks:</h2>
<p>You will have to go to “Fun-Damentals” to understand the logic flow of <p>You will have to go to “Fun-Damentals” to understand the logic flow of this
this game. While you jump as many as 134 times to travel from <code>main()</code> game. While you goto as many as 149 times and jump hundreds if not over one
to a successful <code>exit(666)</code> you may have a devil of a time trying to thousand times to travel from <code>main()</code> to a successful <code>exit(666)</code> you may have
figure out how this program actually does what it does.</p> a devil of a time trying to figure out how this program actually does what it
does.</p>
<p>Before you set off on your adventure to decode this program’s logic, make <p>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. sure you have enough food, ammo, clothes, oxen, and programming supplies.
You’ll be driving for 2170 miles through a wild wilderness inspired You’ll be driving for 2170 miles through a wild wilderness inspired
by <a href="https://en.wikipedia.org/wiki/The_Oregon_Trail_(series)">Oregon Trail</a>, so you’ll need to be prepared for anything! Regardless of by <a href="https://en.wikipedia.org/wiki/The_Oregon_Trail_(series)">Oregon
how well prepared you are, you will have a devil of a time jumping around Trail</a>, so
inside this C code. :-)</p> you’ll need to be prepared for anything! Regardless of how well prepared you
are, you will have a devil of a time jumping around inside this C code. :-)</p>
<h2 id="authors-remarks">Author’s remarks:</h2> <h2 id="authors-remarks">Author’s remarks:</h2>
<blockquote> <blockquote>
<p>Fun fact: after winning this, the author played the game in gdb from start to <p>Fun fact: after winning this, the author played the game in gdb from start to
finish and not counting macros but counting all function calls (not libc 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 <strong>985</strong> (!) functions just the few functions in prog.c), there were a total of <strong>1416</strong> (!)
line jumps. Skipping prog.c function calls and it was still <strong>776</strong> jumps! The line jumps. Skipping prog.c function calls and it was still <strong>1131</strong> jumps! The
prog.c, if you remove <code>#include</code>s, blank lines, lines with just a brace and prog.c, if you remove <code>#include</code>s, blank lines, lines with just a brace and
lines that have only variables, <strong>has just 59 (!) lines of code</strong>. A very tiny lines that have only variables, <strong>has just 58 (!) lines of code</strong>. A very tiny
fraction of the time a line might be repeated in a row ONCE but that does not fraction of the time a line might be repeated in a row ONCE but that does not
really matter. The <a href="https://github.com/ioccc-src/winner/blob/master/2024/ferguson1/prog.goto.max.c">maxed out goto really matter.</p>
version</a> is far worse.</p>
</blockquote> </blockquote>
<p><strong>NOTE</strong>: I actually submitted two versions. This one is not encrypted. The <p><strong>NOTE</strong>: I actually submitted two versions. This one is not encrypted. The
encrypted one even encrypted emojis without having to decrypt them in order to 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 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.</p> file even after publication. I do have a copy of it if anyone is interested.</p>
<p><strong>SUGGESTION</strong>: if you dare, try opening
<a href="https://github.com/ioccc-src/winner/blob/master/2024/ferguson1/prog.gotos.c">prog.gotos.c</a> in an editor with
syntax highlighting and then highlight <code>goto</code>. Alternatively, try it with <code>grep</code>
if your grep has colours enabled (probably easier).</p>
<div id="devil"> <div id="devil">
<h3 id="a-pact-with-the-devil-on-the-oregon-trail-and-his-134-regrets-of-goto">A Pact With the Devil On the Oregon Trail (…and his 134 regrets of goto)</h3> <h3 id="a-pact-with-the-devil-on-the-oregon-trail-and-his-134-149-regrets-of-goto">A Pact With the Devil On the Oregon Trail (…and his <del>134</del> 149 regrets of goto)</h3>
</div> </div>
<p>The <em>Go To Hell In A Handcart Travel Company</em> <strong>PROUDLY</strong> welcomes all sinners to <p>The <em>Go To Hell In A Handcart Travel Company</em> <strong>PROUDLY</strong> welcomes all sinners to
our <strong>GREATEST</strong> destination yet, with:</p> our <strong>GREATEST</strong> destination yet, with:</p>
@@ -2201,8 +2211,9 @@ features versus problems, though possibly more exist.</p>
</div> </div>
<p>Obviously since you can buy oxen at the forts (something not possible in the <p>Obviously since you can buy oxen at the forts (something not possible in the
original game for some reason) then even if you ran out (and perhaps you ate original game for some reason) then even if you ran out (and perhaps you ate
one) it could happen again. Remember you might end up eating an ox just because one, which of course is not in the original either) it could happen again.
he looks at you funny, not just because you are out of food.</p> Remember you might end up eating an ox just because he looks at you funny, not
just because you are out of food!</p>
<p>If you don’t have an ox and you are out of food you die from starvation. But <p>If you don’t have an ox and you are out of food you die from starvation. But
what happens when you die of starvation? Well it says:</p> what happens when you die of starvation? Well it says:</p>
<pre><code> 🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦 <pre><code> 🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦
@@ -2227,27 +2238,28 @@ trail) almost certainly eat it first; and not only that but bread is not going
to do much at all unless you had a great amount of it; which of course the to do much at all unless you had a great amount of it; which of course the
player character (PC) does not.</p> player character (PC) does not.</p>
<p>Actually the only reason: for the amusing rhyme that fits with the jokes, <p>Actually the only reason: for the amusing rhyme that fits with the jokes,
nothing else (it makes it more interesting and amusing than ‘You ran out of food nothing else (but it <em>does</em> make it more interesting and amusing than ‘You ran
and starved to death’, doesn’t it?).</p> out of food and starved to death’, doesn’t it?).</p>
<p>The fact the original game does not have you decide on drinking water (and see <p>The fact the original game does not have you decide on drinking water (and see
section on other differences for the subject of decision making) means I could section on other differences for the subject of decision making) means I could
take some liberty with it. Besides, didn’t I say you would learn by what did not take some liberty with it. Besides, didn’t I say you would learn by what did not
happen? They certainly did drink water and unsafe water (I’m sure) too, so my happen? They certainly did drink water and unsafe water (I’m sure) too, so my
joke is all the more appropriate (even if it’s inappropriate in some company joke is all the more appropriate (even if it’s inappropriate in some company
:-), perhaps your grandparents - although depending on your age now maybe not).</p> :-), perhaps your grandparents - although depending on your age now maybe not.
May my grandparents rest in peace, hopefully not with the devil).</p>
<p>Sometimes it is suggested an ox is lost/whatever (not lost as in it wanders off <p>Sometimes it is suggested an ox is lost/whatever (not lost as in it wanders off
but rather in the sense that you have fewer oxen) even if you don’t have one. It but rather in the sense that you have fewer oxen, for instance getting stuck in
does this in a number of ways like referring to the famous ‘spared no expense’ a river) even if you don’t have one. It does this in a number of ways like
from Jurassic Park. It also is a nod the IOCCC guidelines that talk about a fish referring to the famous ‘spared no expense’ from Jurassic Park. It also is a nod
Eric that might or might not exist.</p> the IOCCC guidelines that talk about a fish Eric that might or might not exist.</p>
<p>I decided to not call him Eric because there is potential for more than one ox <p>I decided to not call him Eric because there is potential for more than one ox
(you’ll note in other messages I got past this issue by making it like in real (you’ll note in other messages I got past this issue by making it like in real
life - wagon trains and large groups - though again some times wagon for the life - wagon trains and large groups - though again sometimes wagon for the
joke - plus being ambiguous). Of course the narrator as the Devil is telling all joke - plus being ambiguous). Of course the narrator as the Devil is telling all
sorts of lies too so that hardly matters.</p> sorts of lies too so that hardly matters.</p>
<p>As for whether this could happen: in theory it could but if you run out of oxen <p>As for whether this could happen: in theory it could but if you run out of oxen
you’re not going to get very far anyway. In other cases, like eating an oxen, you’re not going to get very far anyway. In other cases, like eating an ox, the
the check is in place, although in retrospect it would be very amusing if it did check is in place, although in retrospect it would be very amusing if it did
not. But that would still not be realistic and some of this has to be at least not. But that would still not be realistic and some of this has to be at least
somewhat realistic.</p> somewhat realistic.</p>
<p>Of course even if one runs out of oxen that would not mean they couldn’t make it <p>Of course even if one runs out of oxen that would not mean they couldn’t make it
@@ -2460,10 +2472,12 @@ might be one that the compiler does not trigger a dead code warning on. It
really does not seem to be dead (it’s quite sneaky).</p> really does not seem to be dead (it’s quite sneaky).</p>
<p>I could be wrong on whether this is one the compiler missed though: it’s hard to <p>I could be wrong on whether this is one the compiler missed though: it’s hard to
follow all the <code>goto</code>s. As you find out in <a href="obfuscation.html">obfuscation.html</a> it’s follow all the <code>goto</code>s. As you find out in <a href="obfuscation.html">obfuscation.html</a> it’s
134 after pre-processing! One of the alt versions I supplied is 131 before the 149 after pre-processing! The second alt code is what I originally submitted as
cpp and 149 after. I did not submit that for practical reasons but I kind of prog.c but after winning I made the more complete (149 gotos post cpp, 131 prior
wish I had, now that it won. Nonetheless 134 is already way too many. 149 is to cpp) version (that was not submitted for practical reasons) the prog.c.
much worse.</p> Nonetheless 134 is already way too many. 149 is much worse. Even 116 which was
the original prog.c before cpp is too many; that’s 7 more than the 1978 BASIC
game (!). But it’s actually 131 which is 22 more.</p>
<p>Yes I might be mad. But then again I might just be the Devil. Who knows? What I <p>Yes I might be mad. But then again I might just be the Devil. Who knows? What I
do know is code that is meant to be reached is reached! Yes I’ve played it many do know is code that is meant to be reached is reached! Yes I’ve played it many
times. Some code I made dead seemed totally useless but why not add to times. Some code I made dead seemed totally useless but why not add to
@@ -2570,8 +2584,8 @@ that much in one turn I think.</p>
as it’s a joke and merely a possible foreshadowing of what is to come. The as it’s a joke and merely a possible foreshadowing of what is to come. The
message that they shouldn’t try telling the narrator they don’t have one (if message that they shouldn’t try telling the narrator they don’t have one (if
they can even count) because it just kicked the bucket cleverly sidesteps (or they can even count) because it just kicked the bucket cleverly sidesteps (or
does it sidekick?) that issue - it’s not even meant to eliminate one as it was does it sidekick?) that issue - it’s not even meant to eliminate one as if it
kicking a bucket physically, not kicking the bucket figuratively (or in this was kicking a bucket physically, not kicking the bucket figuratively (or in this
case it might also be literally - although paradoxically also not).</p> case it might also be literally - although paradoxically also not).</p>
<p>It is <strong>NOT</strong> a bug that when you get dysentery you jump past the mountains <p>It is <strong>NOT</strong> a bug that when you get dysentery you jump past the mountains
event and go straight to the doctor. This not only plays in the theme (wait and event and go straight to the doctor. This not only plays in the theme (wait and
@@ -2581,7 +2595,12 @@ turn. Also this does mean that they ‘lose a turn’ which seems plausible. Loo
it this way: those other events could also happen in the mountains, so it’s not it this way: those other events could also happen in the mountains, so it’s not
really an illogical choice anyway; the separation is there because they were not really an illogical choice anyway; the separation is there because they were not
at the mountains immediately (obviously). I believe (not sure but I think) you at the mountains immediately (obviously). I believe (not sure but I think) you
can survive with dysentery if you have enough hp.</p> can survive with dysentery if you have enough hp and turns. Now one might say
that not going straight to the doctor might make more sense or rather one should
go to the doctor (at the mountains, if they were there), and then back to the
mountains. But this would cause other problems: for instance if one does not
have enough money to pay for the doctor: say for instance seeing the message
twice and also losing even more hp/mileage. That would be a broken design.</p>
<p>On occasion an event might not fire (or rather it fires but nothing seems to <p>On occasion an event might not fire (or rather it fires but nothing seems to
happen). This is <strong>NOT</strong> a bug when it does. In fact it can be a lifesaver due happen). This is <strong>NOT</strong> a bug when it does. In fact it can be a lifesaver due
to all the hazards and especially as this has primarily to do with case 11 which to all the hazards and especially as this has primarily to do with case 11 which
@@ -2594,7 +2613,7 @@ what I mean you can change the code:</p>
- it appears so). There are other ways to trigger this though, if you were to - it appears so). There are other ways to trigger this though, if you were to
modify the code. Note that this does <strong>NOT</strong> mean that no events would fire. It modify the code. Note that this does <strong>NOT</strong> mean that no events would fire. It
just means you’ll see what I mean more easily. Some events are triggered just means you’ll see what I mean more easily. Some events are triggered
indirectly and others happen once you reach the mountains, for example.</p> indirectly and others happen once you reach the mountains, for examples.</p>
<p>Another one. In case you noticed the code:</p> <p>Another one. In case you noticed the code:</p>
<pre><code> case 4:i=17; } } case 2: V(5); } goto k;</code></pre> <pre><code> case 4:i=17; } } case 2: V(5); } goto k;</code></pre>
<p>You might think this is a bug but this is actually hilarious. Here is what will <p>You might think this is a bug but this is actually hilarious. Here is what will
@@ -2643,10 +2662,11 @@ is ENTIRELY unclear how the author is not confused. All I know is
wanted so THERE SIMPLY IS NO FLOW CONTROL ERROR.</p> wanted so THERE SIMPLY IS NO FLOW CONTROL ERROR.</p>
<p>Of course not all the jokes are equal although they’re almost all absurd in some <p>Of course not all the jokes are equal although they’re almost all absurd in some
way or another. Sometimes I manipulated the joke to fit into the code itself and way or another. Sometimes I manipulated the joke to fit into the code itself and
vice versa. This was done numerous times in fact. The fact though that the vice versa. This was done numerous times in fact. The fact that the narrator is
narrator is the devil means that some of that was not even necessary, given that the devil means that some of that was not even necessary, given that he (as I
he (as I have shown in this file) cannot be trusted and says things that are have shown in this file) cannot be trusted and says things that are totally
totally bogus and many that make absolutely no sense.</p> bogus and many that make absolutely no sense…kind of like the entire theme of
the game, but that only makes it more fun.</p>
<p>The fact he refers to himself as if he’s someone else is ludicrous on its own <p>The fact he refers to himself as if he’s someone else is ludicrous on its own
but there are so many other things. Those things I changed were good to change but there are so many other things. Those things I changed were good to change
but the others did not have to change. Some did change anyway but some did not, but the others did not have to change. Some did change anyway but some did not,
@@ -2907,16 +2927,19 @@ reading the strings/data files they would have to run the program to confirm
what this is. And even then it shouldn’t be easy to follow the code, for reasons what this is. And even then it shouldn’t be easy to follow the code, for reasons
I mentioned in <a href="obfuscation.html">obfuscation.html</a> (and some briefly below).</p> I mentioned in <a href="obfuscation.html">obfuscation.html</a> (and some briefly below).</p>
<p>In general I think it’s extremely hard to follow the flow of this program due to <p>In general I think it’s extremely hard to follow the flow of this program due to
the abuse of 116 <code>goto</code>s, more than the BASIC game. 134 when pre-processed. But the abuse of <del>116</del> 131 <code>goto</code>s, more than the BASIC game.
let’s be honest, or 134 for a small C program is too many but to be only six <del>134</del> 149 when pre-processed. But
fewer than a larger BASIC program? That is hard to fathom. Not that 116 is not let’s be honest, or 131 for a small C program is too many but to be seven more
too many for larger programs…or one goto, for that matter. As noted elsewhere, than the larger BASIC program? That is hard to fathom. Not that <del>116</del>
an alt version has 131/149 gotos, before/after the cpp. I did not make it the 131/149 is not too many for larger programs…or one goto, for that matter.</p>
main version when submitting because I did not want to make the judges weep and <p>As noted elsewhere, I originally submitted a slightly less goto complete
curse any more than they already had to (besides, it can’t be 4666 bytes with version, with 116/134 gotos, before/after the cpp, which was due to practical
the extra <code>goto</code>s) but now that it’s in I have no qualms about providing it as reasons, and to make the judges weep (and probably curse the Devil - and author,
alt code: if I am going to ruin <code>goto</code>s I might as well do it properly.</p> who might easily be mistaken for the Devil) a little bit less. But really, if I
<p>Some things are clear about the program from visual inspection:</p> am going to ruin <code>goto</code>s like I did: why should I not do it properly? So it’s
now maxed out with all the other <a href="obfuscation.html">obfuscation</a> and the many
events and fun gameplay.</p>
<p>Anyway, some things are clear about the program from visual inspection:</p>
<ul> <ul>
<li>it is clear the program does print SOME THINGS (but it is <strong>NOT clear WHAT</strong> <li>it is clear the program does print SOME THINGS (but it is <strong>NOT clear WHAT</strong>
is printed).</li> is printed).</li>
@@ -3013,20 +3036,21 @@ a single flat <code>char *</code>, although I do think that’s pretty cool and
<code>+--</code> I talked about in <a href="obfuscation.html">obfuscation.html</a> (in fact in some <code>+--</code> I talked about in <a href="obfuscation.html">obfuscation.html</a> (in fact in some
if not most contexts it IS illegal). The bastardised Duff’s device I would not if not most contexts it IS illegal). The bastardised Duff’s device I would not
do. I would not put the entire function in a switch.</p> do. I would not put the entire function in a switch.</p>
<p>But above all I would not have used 116 (or 134) <code>goto</code>s. Or ten. Or five. Or <p>But above all I would not have used <del>116</del> 131 (or <del>134</del> 149)
even one. Better to let code generators like flex/bison take the crown. I have <code>goto</code>s. Or ten. Or five. Or even one. Better to let code generators like
dethroned them though (at least from what I have seen before) - by a huge flex/bison take the crown. I have dethroned them though (at least from what I
amount. But perhaps <a href="https://www.ioccc.org/1987/hines/index.html">1987/hines</a> have seen before) - by a huge amount. But perhaps
had the crown. It no longer does. I should be ashamed. I’m not.</p> <a href="https://www.ioccc.org/1987/hines/index.html">1987/hines</a> had the crown. It no
longer does. I should be ashamed. I’m not. Devils feel no shame.</p>
<p>But even if I were to abuse <code>goto</code> I would not normally use it in the ways I did, as <p>But even if I were to abuse <code>goto</code> I would not normally use it in the ways I did, as
noted earlier and in <a href="obfuscation.html">obfuscation.html</a>!</p> noted earlier and in <a href="obfuscation.html">obfuscation.html</a>!</p>
<p>If I am ever dethroned, assuming I now have the crown as I think I do (and I <p>If I am ever dethroned, assuming I now have the crown as I think I do (and I
hope I do because if I do not there is something very wrong), I will be hope and guess I do, even outside the IOCCC, because if I do not there is
absolutely horrified.</p> something very wrong), I will be absolutely horrified.</p>
<p>Okay I’ll be kind of amused too but I would be horrified. Still I guess in the <p>Okay I’ll be kind of amused too but I would be horrified. Still I guess in the
context of the IOCCC I really have reached the logical conclusion of <code>goto</code>s context of the IOCCC I really have reached the logical conclusion of <code>goto</code>s
(which, as you’ll see, the 1987/hines one, was thought to be by the judges the (which, as you’ll see, the 1987/hines one, was thought to be by the judges the
logical conclusion - see below for more information on THAT and an exercise in ‘logical conclusion’ - see below for more information on THAT and an exercise in
absurdity), or at least I hope so.</p> absurdity), or at least I hope so.</p>
<p>It’s about time either way. Hopefully the judges will take <code>goto</code> and throw it <p>It’s about time either way. Hopefully the judges will take <code>goto</code> and throw it
into the deepest bowels of the Earth.</p> into the deepest bowels of the Earth.</p>
@@ -3074,10 +3098,12 @@ mean many <code>goto</code>s.</p>
<p>There are so many <code>goto</code>s that to try and move code to add more <code>goto</code>s is <p>There are so many <code>goto</code>s that to try and move code to add more <code>goto</code>s is
basically pointless, unless as a joke. In this program it would really not do basically pointless, unless as a joke. In this program it would really not do
anything. I essentially ran out of code to move. Even if I had more though, anything. I essentially ran out of code to move. Even if I had more though,
isn’t 134 enough, especially in a program that, counting spaces, including isn’t <del>134</del> 149 enough, especially in a program that, counting spaces,
unnecessary spaces to add to the size, is only 4666 bytes? It would be smaller including unnecessary spaces to add to the size, is only 4666 bytes? It would be
except to stay on theme. Doing more would no longer be funny. Enough is enough. smaller except to stay on theme. Doing more would no longer be funny. Enough is
Or at least I hope.</p> enough. Or at least I hope. Okay…actually I take that back. More would be
funnier. But it would have sacrificed the rest of the game and that would be a
tragedy.</p>
<p>But it really is that extreme.</p> <p>But it really is that extreme.</p>
<p>Here are some things Frank wrote:</p> <p>Here are some things Frank wrote:</p>
<blockquote> <blockquote>
@@ -3099,7 +3125,9 @@ traits I do not even know how to describe. Perhaps they would be utterly
ineffable.</p> ineffable.</p>
<p>Actually I wanted to see what it was like. It was VERY amusing - but only <p>Actually I wanted to see what it was like. It was VERY amusing - but only
because I did not have to debug it. For the submission I included line changes because I did not have to debug it. For the submission I included line changes
for JUST the third prompt. Yes, what would only take a few seconds of play. It for JUST the third prompt (this means the prog.orig.c file: as noted I made the
prog.c the complete version instead, and made prog.c as submitted the
prog.alt2.c, after the win). Yes, what would only take a few seconds of play. It
looked like this (I only did the third prompt as I had mere hours left to looked like this (I only did the third prompt as I had mere hours left to
finish):</p> finish):</p>
<pre><code> 19 20 21 32 69 82 34 33 34 47 45 47 50 83 34 33 34 47 45 47 50 83 34 33 34</code></pre> <pre><code> 19 20 21 32 69 82 34 33 34 47 45 47 50 83 34 33 34 47 45 47 50 83 34 33 34</code></pre>
@@ -3112,12 +3140,12 @@ full sequence. This is from start to finish and I include it for your amusement
(see <a href="jumps.txt">jumps.txt</a> for the line changes including calls to prog.c (see <a href="jumps.txt">jumps.txt</a> for the line changes including calls to prog.c
functions). Or horror. There are a few times where the line functions). Or horror. There are a few times where the line
is the same but that only shows how very often the line changes. It is a total is the same but that only shows how very often the line changes. It is a total
of <strong>985</strong> (!) changes, counting function calls, and <strong>776</strong> (!) excluding of <strong>1416</strong> (!) changes, counting function calls, and <strong>1131</strong> (!) excluding
function calls. Macros are not counted of course.</p> function calls. Macros are not counted of course.</p>
<p>This program, if you remove blank lines and lines with just a brace, <p>This program, if you remove blank lines and lines with just a brace,
<code>#include</code>s and only variables, has a mere 59 (!) lines.</p> <code>#include</code>s and only variables, has a mere 58 (!) lines.</p>
<p>A program that has only 59 lines of code that jumps 985 (counting functions) or <p>A program that has only 58 lines of code that jumps 1416 (counting functions) or
776 (just in main()) times is astonishing. Of course that’s not the 1131 (just in main()) times is astonishing. Of course that’s not the
only technique but the title of the award and the judges’ remarks are rather only technique but the title of the award and the judges’ remarks are rather
fitting as it is diabolical to follow this code (and the theme of the game fits fitting as it is diabolical to follow this code (and the theme of the game fits
as well); the <a href="obfuscation.html">obfuscation.html</a> shows even more on this - and as well); the <a href="obfuscation.html">obfuscation.html</a> shows even more on this - and
@@ -3135,14 +3163,14 @@ he was wrong.</p>
<p>It is not about not trying. But even IF he WAS right, he <p>It is not about not trying. But even IF he WAS right, he
sure as hell is wrong NOW. Anyone who thinks otherwise needs to try and debug sure as hell is wrong NOW. Anyone who thinks otherwise needs to try and debug
my program - or maintain it. Or write it.</p> my program - or maintain it. Or write it.</p>
<p>It would have been SO MUCH EASIER if I did not use 134 <code>goto</code>s (and I could have <p>It would have been SO MUCH EASIER if I did not use <del>134</del> 149 <code>goto</code>s.
fit more in). Actually, even a Actually, even a tiny portion of that would make it harder. Nobody, whether
tiny portion of that would make it harder. Nobody, whether they’re in their they’re in their right mind or not, would WANT to MAINTAIN this, or something
right mind or not, would WANT to maintain this, or something even close to it. even close to it. Feel free to pass on judgement to me. I welcome it! You have
Feel free to pass on judgement to me. I welcome it! You have to be mad and to be mad and embrace it to do this. I went full out and I could have fit more
embrace it to do this. I went full out and I could have fit more <code>goto</code>s in: not <code>goto</code>s in: not only is the iocccsize not 2503 (although it’s close now) but I
only is the iocccsize not 2503 but I could have removed some events if I really could have removed some events if I really wanted more <code>goto</code>s. That would be
wanted more <code>goto</code>s.</p> less fun.</p>
<p>Even flex/bison code, which as far as I am aware uses FAR fewer <code>goto</code>s, is <p>Even flex/bison code, which as far as I am aware uses FAR fewer <code>goto</code>s, is
notorious for <code>goto</code>s and is quite hard to follow. It would be a nightmare to notorious for <code>goto</code>s and is quite hard to follow. It would be a nightmare to
try and maintain without the .l/.y source files.</p> try and maintain without the .l/.y source files.</p>
@@ -3172,27 +3200,21 @@ made even a few more commits. As it is it took a full two months and I BARELY
finished this. In fact I finished it within hours of the contest closing! It was finished this. In fact I finished it within hours of the contest closing! It was
not even 12 hours before closing time. I barely made it. Part of that is I added not even 12 hours before closing time. I barely made it. Part of that is I added
even more <code>goto</code>s, despite the fact I had reached 2503 in size, with careful even more <code>goto</code>s, despite the fact I had reached 2503 in size, with careful
size optimisation.</p> size optimisation, though it got below that.</p>
<p>Countless times I came up with ways to do more, at least where it was possible, <p>Countless times I came up with ways to do more, at least where it was possible,
such as freeing space so I could change some <code>break;</code>s to a <code>goto Z;</code> as <code>Z:</code> such as freeing space so I could change some <code>break;</code>s to a <code>goto Z;</code> as <code>Z:</code>
was already there. The only other times this happened is before I had changed was already there. The only other times this happened is before I had changed
the code so much that you can no longer trust what a block of code is. Like I the code so much that you can no longer trust what a block of code is. Like I
said, I could not really move any more code if I wanted to, even if I had more said, I could not really move any more code if I wanted to, even if I had more
space free. Those very few places where the code could in theory be moved are space free. Those very few places where the code could in theory be moved are
already controlled by goto.</p> already controlled by goto. The current <code>prog.c</code> has even more of this as it’s
<p>In fact I could have done more <code>goto</code>s in this version but I wanted to help the the goto complete version.</p>
judges out in judging - that and it was easier to verify things are correct.
<code>iocccsize</code> reports on prog.c 2457 and after I won this I kind of wish I did
take it even further just to mess with everyone even more.</p>
<p>But as I said elsewhere basically everything is in the wrong place so what even <p>But as I said elsewhere basically everything is in the wrong place so what even
would be the point in doing that? It would probably not make it harder to follow would be the point if I had more space? It would probably not make it harder to follow
(well it would but still would there be a point in it?); it would just make it (well it would but still would there be a point in it?); it would just make it
even more absurd: the amount of spaghetti code makes it nigh impossible to even more absurd: the amount of spaghetti code makes it nigh impossible to
follow and I’m happy to have smashed the record of 24 by 110 <code>goto</code>s, even if I follow and I’m happy to have smashed the record of 24 by <del>110</del> 125
now wish I had gone even further.</p> <code>goto</code>s.</p>
<p>Nonetheless the 134 is what won so that’s what I’ll live by (and I doubt it’ll
be broken as this kind of trick will, as the general remarks about the entries
note, not be as worthy, even if <code>goto</code>s are alas, not banned outright).</p>
<p>Anyway, as I noted in <a href="obfuscation.html">obfuscation.html</a>, no initialisation is <p>Anyway, as I noted in <a href="obfuscation.html">obfuscation.html</a>, no initialisation is
skipped in my jumps and that is what causes <code>goto</code> to invoke UB.</p> skipped in my jumps and that is what causes <code>goto</code> to invoke UB.</p>
<p>Everything is file scope. And in any case, when I do jump to a place, everything <p>Everything is file scope. And in any case, when I do jump to a place, everything
@@ -3257,8 +3279,8 @@ that they aren’t harmful, mostly to show just how extreme this program went.</
<a href="https://www.blackduck.com/blog/understanding-apple-goto-fail-vulnerability-2.html" class="uri">https://www.blackduck.com/blog/understanding-apple-goto-fail-vulnerability-2.html</a>. <a href="https://www.blackduck.com/blog/understanding-apple-goto-fail-vulnerability-2.html" class="uri">https://www.blackduck.com/blog/understanding-apple-goto-fail-vulnerability-2.html</a>.
That’s all it takes: <strong>JUST ONE <code>goto</code> led to a CVE</strong>!</p> That’s all it takes: <strong>JUST ONE <code>goto</code> led to a CVE</strong>!</p>
<p>It is ironic, perfect and hilarious that it was <code>goto fail;</code> as it was actually <p>It is ironic, perfect and hilarious that it was <code>goto fail;</code> as it was actually
a failure in using <code>goto</code>! My code has 134 (with the cpp, 116 without). That is a failure in using <code>goto</code>! My code has <del>134</del> 149 (with the cpp,
obscene. I did not fail. At all.</p> <del>116</del> 131 without). That is obscene. I did not fail. At all.</p>
<p>On the contrary I have made a point. Okay, that is not the only reason I did it <p>On the contrary I have made a point. Okay, that is not the only reason I did it
but when I got started I couldn’t help it…I thought it was (and still do think but when I got started I couldn’t help it…I thought it was (and still do think
it is) hilarious. But only for satirical programming like the contest. I would it is) hilarious. But only for satirical programming like the contest. I would
@@ -3294,12 +3316,12 @@ Yes, in the IOCCC, but outside that?</p>
<p>In BASIC and asm and some other languages jumps are a core part of the language. <p>In BASIC and asm and some other languages jumps are a core part of the language.
And those languages can be harder to maintain partly because of jumps. C is not And those languages can be harder to maintain partly because of jumps. C is not
one of those languages. Or it wasn’t until now.</p> one of those languages. Or it wasn’t until now.</p>
<p>Yes, yes…I know, I <strong>KNOW</strong> I put in 116 <code>goto</code>s with 134 when pre-processed <p>Yes, yes…I know, I <strong>KNOW</strong> I put in <del>116</del> 131 <code>goto</code>s with
and that is probably more extreme than any other C program, especially in such a <del>134</del> 149 when pre-processed and that is probably more extreme than any
small program (and I REALLY hope I’m right there!). But <strong>this does NOT matter</strong>! other C program, especially in such a small program (and I REALLY hope I’m right
Even if one or two were not harmful (but they are) it’s jumping down a rabbit there!). But <strong>this does NOT matter</strong>! Even if one or two were not harmful (but
hole that can very easily get deeper and deeper just like Alice found. When they are) it’s jumping down a rabbit hole that can very easily get deeper and
there’s no <strong>NEED</strong> for it it’s much worse.</p> deeper just like Alice found. When there’s no <strong>NEED</strong> for it it’s much worse.</p>
<p><code>goto</code>s are harmful and destroy flow control. I have shown a fair few obscure <p><code>goto</code>s are harmful and destroy flow control. I have shown a fair few obscure
things about C, some which SEEM ILLEGAL but are not, but above all I have shown things about C, some which SEEM ILLEGAL but are not, but above all I have shown
how much is lost with <code>goto</code>s (okay, I have shown this with other things too). how much is lost with <code>goto</code>s (okay, I have shown this with other things too).
@@ -3342,24 +3364,26 @@ recognise what I mean - and yes it’s in the game).</p>
<p>On a lighter note (or maybe this is darker?): did you know that every time a <p>On a lighter note (or maybe this is darker?): did you know that every time a
<code>goto</code> is used an angel (whatever you consider an angel) <strong>DIES</strong> and goes <code>goto</code> is used an angel (whatever you consider an angel) <strong>DIES</strong> and goes
straight to HELL? You don’t really want that do you? I didn’t think so. Yes I straight to HELL? You don’t really want that do you? I didn’t think so. Yes I
killed 134 angels. YES I condemned 134 angels to eternal torment. I <strong>HAD</strong> to. killed <del>134</del> 149 angels. YES I condemned <del>134</del> 149 angels to
I don’t regret it - but you should, if you <strong>ever</strong> write something like this eternal torment. I <strong>HAD</strong> to. I don’t regret it - but you should, if you
outside the IOCCC. In fact you should regret a single <del>goto</del> angel <strong>ever</strong> write something like this outside the IOCCC. In fact you should regret
dying. Even if they did not go straight to hell in a handcart, you should still a single <del>goto</del> angel dying. Even if they did not go straight to hell
regret it. But they do. Okay so I don’t really believe that but there is no in a handcart, you should still regret it. But they do. Okay so I don’t really
denying there is goto hell here.</p> believe that but there is no denying there is goto hell here.</p>
<p>I found my abuse of <code>goto</code> hilarious. It was good intentions - the contest. But <p>I <del>found</del> find my abuse of <code>goto</code> hilarious. It was good intentions -
sadly sometimes the worst things that happen start with good intentions; and the contest. But sadly sometimes the worst things that happen start with good
some of the best things strangely start with horrible intentions. It might be intentions; and some of the best things strangely start with horrible
that I did this with good intentions for the contest but it would not be good intentions. It might be that I did this with good intentions for the contest but
anywhere else. I would be beyond angry if I had to maintain this code. I would it would not be good anywhere else. I would be beyond angry if I had to maintain
not blame anyone if they cursed me. I probably would be too. Not cursing you. I this code. I would not blame anyone if they cursed me. I probably would be too.
mean cursing me.</p> Not cursing you. I mean cursing me.</p>
<p>Don’t write code like this. Except for the IOCCC. Unless of course the judges <p>Don’t write code like this. Except for the IOCCC. Unless of course the judges
decide they want no more <code>goto</code>s. I would not put that past them after what I decide they want no more <code>goto</code>s. I would not put that past them after what I
have done. I can imagine them screaming and crying. Hopefully they’re laughing have done. I can imagine them screaming and crying. Hopefully they’re laughing
at more than the jokes but I hope they laugh at this too. Well we’ll see I at more than the jokes but I hope they laugh at this too. Well we’ll see I
guess…</p> guess… (it appears that, based on the general remarks by the judges, of the
winning entries, that <code>goto</code> will no longer hold nearly as much water, and that
makes me happy).</p>
<p>Frankly THIS PROGRAM SHOULD NOT WORK! But it does and it works well even if the <p>Frankly THIS PROGRAM SHOULD NOT WORK! But it does and it works well even if the
flow-control is a horrible nightmare from hell. Perhaps the Devil truly has flow-control is a horrible nightmare from hell. Perhaps the Devil truly has
possessed it. Hell, he might have possessed me. Why else would I send C straight possessed it. Hell, he might have possessed me. Why else would I send C straight
@@ -3725,10 +3749,11 @@ helps you appreciate the careful design even more.<a href="#fnref2" class="footn
<ul> <ul>
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/ferguson1/prog.c">prog.c</a> - entry source code</li> <li><a href="https://github.com/ioccc-src/winner/blob/master/2024/ferguson1/prog.c">prog.c</a> - entry source code</li>
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/ferguson1/Makefile">Makefile</a> - entry Makefile</li> <li><a href="https://github.com/ioccc-src/winner/blob/master/2024/ferguson1/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/ferguson1/prog.alt2.c">prog.alt2.c</a> - original source code with minor bug fix</li>
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/ferguson1/prog.alt.c">prog.alt.c</a> - alternate source code</li> <li><a href="https://github.com/ioccc-src/winner/blob/master/2024/ferguson1/prog.alt.c">prog.alt.c</a> - alternate source code</li>
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/ferguson1/prog.goto.max.c">prog.goto.max.c</a> - entry source code with maxed out gotos</li>
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/ferguson1/prog.orig.c">prog.orig.c</a> - original source code</li> <li><a href="https://github.com/ioccc-src/winner/blob/master/2024/ferguson1/prog.orig.c">prog.orig.c</a> - original source code</li>
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/ferguson1/commented.c">commented.c</a> - commented version of the game</li> <li><a href="https://github.com/ioccc-src/winner/blob/master/2024/ferguson1/commented.c">commented.c</a> - commented version of the game</li>
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/ferguson1/prog.gotos.c">prog.gotos.c</a> - prog.c with merged lines to show mass of gotos</li>
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/ferguson1/addpadding.c">addpadding.c</a> - add padding from data source files</li> <li><a href="https://github.com/ioccc-src/winner/blob/master/2024/ferguson1/addpadding.c">addpadding.c</a> - add padding from data source files</li>
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/ferguson1/bytecheck.c">bytecheck.c</a> - read data.src and print out single-byte chars</li> <li><a href="https://github.com/ioccc-src/winner/blob/master/2024/ferguson1/bytecheck.c">bytecheck.c</a> - read data.src and print out single-byte chars</li>
<li><a href="https://github.com/ioccc-src/winner/blob/master/2024/ferguson1/bytecount.c">bytecount.c</a> - print each string with locations</li> <li><a href="https://github.com/ioccc-src/winner/blob/master/2024/ferguson1/bytecount.c">bytecount.c</a> - print each string with locations</li>
+57 -40
View File
@@ -1,40 +1,57 @@
19 20 21 32 15 13 15 68 81 34 33 15 13 15 34 13 49 47 49 52 82 34 33 15 13 19 20 21 29 15 13 15 5 55 65 31 30 15 13 15 31 13 37 36 37 39 66 31 30 15
15 34 13 49 47 49 52 82 34 33 15 13 15 34 13 49 47 49 52 82 34 33 15 13 15 13 15 31 13 37 36 37 39 66 31 30 15 13 15 31 13 37 36 37 39 66 31 30 15 13
34 13 49 47 49 52 82 34 33 15 13 15 34 13 49 47 49 52 82 18 19 13 19 21 78 15 31 13 37 36 37 39 66 31 30 15 13 15 31 13 37 36 37 39 66 18 19 13 19 21
27 54 29 55 52 55 52 55 52 55 52 55 52 30 13 30 78 63 82 15 13 15 13 53 56 62 26 41 58 41 27 42 39 42 39 42 39 42 39 42 39 28 13 28 62 50 66 15 13 15
30 16 32 27 15 13 15 27 32 57 59 57 58 57 59 81 15 13 15 81 71 74 72 74 76 13 55 65 31 30 15 13 15 31 13 33 34 33 33 34 33 34 33 34 33 34 33 34 33 34
27 54 29 55 52 55 52 55 52 55 52 55 52 30 13 30 78 63 82 15 13 15 13 52 57 35 39 66 31 30 15 13 15 31 13 33 34 33 33 34 33 34 33 34 33 34 33 34 33 34
59 57 58 57 59 64 15 13 15 19 64 81 71 74 72 74 76 27 54 29 55 52 55 52 55 35 39 66 31 30 15 13 15 31 13 33 34 33 33 34 33 34 33 34 33 34 33 34 33 34
52 55 52 55 52 30 13 30 15 13 15 13 52 57 59 57 58 57 59 64 15 13 15 19 64 35 39 66 31 30 15 13 15 31 13 33 34 33 33 34 33 34 33 34 33 34 33 34 33 34
81 71 74 72 74 76 27 54 29 55 52 55 52 55 52 55 52 55 52 30 13 30 15 13 15 35 39 66 31 30 15 13 15 31 13 33 34 33 33 34 33 34 33 34 33 34 33 34 33 34
13 68 81 34 33 15 13 15 34 13 36 39 41 39 39 41 39 41 39 41 39 41 39 41 39 35 39 66 18 42 27 42 27 27 42 27 27 42 27 27 42 27 27 42 27 19 13 19 44 46
41 43 52 82 34 33 15 13 15 34 13 36 39 41 39 39 41 39 41 39 41 39 41 39 41 44 45 44 46 51 15 13 15 51 65 58 60 59 60 61 26 41 58 41 27 42 39 42 39 42
39 41 43 52 82 34 33 15 13 15 34 13 36 39 41 39 39 41 39 41 39 41 39 41 39 39 42 39 42 39 28 13 28 62 50 66 15 13 15 13 55 65 31 30 15 13 15 31 13 33
41 39 41 43 52 82 34 33 15 13 15 34 13 36 39 41 39 39 41 39 41 39 41 39 41 34 33 33 34 33 34 33 34 33 34 33 34 33 34 35 15 13 15 55 65 31 30 15 13 15
39 41 39 41 43 52 82 34 33 15 13 15 34 13 36 39 41 39 39 41 39 41 39 41 39 31 13 33 34 33 33 34 33 34 33 34 33 34 33 34 33 34 35 39 66 31 30 15 13 15
41 39 41 39 41 43 52 82 18 55 29 55 29 29 55 29 29 55 29 29 55 29 29 55 29 31 13 33 34 33 33 34 33 34 33 34 33 34 33 34 33 34 35 39 66 31 30 15 13 15
19 13 19 57 59 57 58 57 59 81 71 74 72 74 76 27 54 29 55 52 55 52 55 52 55 31 13 33 34 33 33 34 33 34 33 34 33 34 33 34 33 34 35 39 66 31 30 15 13 15
52 55 52 30 13 30 15 13 15 13 52 57 59 57 58 57 59 60 15 13 15 60 81 71 74 31 13 33 34 33 33 34 33 34 33 34 33 34 33 34 33 34 35 39 66 31 30 15 13 15
72 74 76 27 54 29 55 52 55 52 55 52 55 52 55 52 30 13 30 15 13 15 13 52 57 31 13 33 34 33 33 34 33 34 33 34 33 34 33 34 33 34 35 39 66 18 42 27 42 27
59 57 58 57 59 64 15 13 15 19 64 81 71 74 72 74 76 27 54 29 55 52 55 52 55 27 42 27 27 42 27 27 42 27 27 42 27 19 13 19 44 46 44 45 44 46 51 15 13 15
52 55 52 55 52 30 13 30 78 63 82 15 13 15 13 52 57 59 57 58 57 59 64 15 13 51 65 41 15 13 15 41 58 15 13 15 60 59 60 61 26 41 58 41 27 42 39 42 39 42
15 19 64 81 54 15 13 15 54 15 13 15 15 13 15 83 15 13 15 27 54 29 55 52 55 39 42 39 42 39 28 13 28 15 13 15 13 40 43 28 16 15 13 15 10 43 44 46 44 45
52 55 52 55 52 55 52 30 13 30 78 63 82 15 13 15 13 52 57 59 57 58 57 59 64 44 46 64 53 62 58 15 13 15 60 59 60 61 26 41 58 41 27 42 39 42 39 42 39 42
15 13 15 64 81 83 68 71 15 13 15 74 72 74 76 27 54 29 55 52 55 52 55 52 55 39 42 39 28 13 28 15 13 15 13 39 44 46 44 45 44 46 47 15 13 15 47 65 58 60
52 55 52 30 13 30 78 63 82 15 13 15 13 52 57 59 57 58 57 59 64 15 13 15 64 59 60 61 26 41 58 41 27 42 39 42 39 42 39 42 39 42 39 28 13 28 15 13 15 13
81 83 68 71 74 72 74 76 27 54 29 55 52 55 52 55 52 55 52 55 52 30 13 30 78 39 44 46 44 45 44 46 48 15 13 15 48 65 58 15 13 15 60 59 60 61 26 41 58 41
63 82 15 13 15 13 52 57 59 57 58 57 59 61 15 13 15 61 81 83 68 71 15 13 15 27 42 39 42 39 42 39 42 39 42 39 28 13 28 62 50 66 15 13 15 13 55 65 31 30
74 72 74 76 27 54 29 55 52 55 52 55 52 55 52 55 52 30 13 30 15 13 15 13 68 15 13 15 31 13 33 34 33 33 34 33 34 33 34 33 34 33 34 33 34 35 39 66 31 30
81 34 33 15 13 15 34 13 36 39 41 39 39 41 39 41 39 41 39 41 39 41 39 41 43 15 13 15 31 13 33 34 33 33 34 33 34 33 34 33 34 33 34 33 34 35 39 66 31 30
52 82 34 33 15 13 15 34 13 36 39 41 39 39 41 39 41 39 41 39 41 39 41 39 41 15 13 15 31 13 33 34 33 33 34 33 34 33 34 33 34 33 34 33 34 35 39 66 31 30
43 52 82 34 33 15 13 15 34 13 36 39 41 39 39 41 39 41 39 41 39 41 39 41 39 15 13 15 31 13 33 34 33 33 34 33 34 33 34 33 34 33 34 33 34 35 39 66 31 30
41 43 52 82 34 33 15 13 15 34 13 36 39 41 39 39 41 39 41 39 41 39 41 39 41 15 13 15 31 13 33 34 33 33 34 33 34 33 34 33 34 33 34 33 34 35 39 66 18 42
39 41 43 52 82 34 33 15 13 15 34 13 36 39 41 39 39 41 39 41 39 41 39 41 39 27 42 27 27 42 27 27 42 27 27 42 27 27 42 27 19 13 19 44 46 44 45 44 46 64
41 39 41 43 52 82 18 55 29 55 29 29 55 29 29 55 29 29 55 29 29 55 29 19 13 53 62 58 15 13 15 60 59 60 61 26 41 58 41 27 42 39 42 39 42 39 42 39 42 39
19 57 59 57 58 57 59 81 15 13 15 81 83 68 71 74 72 74 76 27 54 29 55 52 55 28 13 28 62 50 66 15 13 15 13 39 44 46 44 45 44 46 48 15 13 15 48 65 15 13
52 55 52 55 52 55 52 30 13 30 15 13 15 13 52 57 59 57 58 57 59 65 15 13 15 15 15 13 15 67 15 13 15 26 41 58 41 27 42 39 42 39 42 39 42 39 42 39 28 13
65 81 83 68 71 74 72 74 76 27 54 29 55 52 55 52 55 52 55 52 55 52 30 13 30 28 62 50 66 15 13 15 13 55 65 31 30 15 13 15 31 13 33 34 33 33 34 33 34 33
15 13 15 13 52 57 59 57 58 57 59 60 15 13 15 60 81 83 68 69 70 71 15 13 15 34 33 34 33 34 33 34 35 39 66 31 30 15 13 15 31 13 33 34 33 33 34 33 34 33
74 72 74 76 27 54 29 55 52 55 52 55 52 55 52 55 52 30 13 30 15 13 15 13 52 34 33 34 33 34 33 34 35 39 66 31 30 15 13 15 31 13 33 34 33 33 34 33 34 33
57 59 57 58 57 59 64 15 13 15 19 64 81 83 68 71 15 13 15 74 72 74 76 27 83 34 33 34 33 34 33 34 35 39 66 31 30 15 13 15 31 13 33 34 33 33 34 33 34 33
26 21 15 13 15 15 13 15 24 85 34 33 34 33 34 33 34 35 39 66 31 30 15 13 15 31 13 33 34 33 33 34 33 34 33
34 33 34 33 34 33 34 35 39 66 18 42 27 42 27 27 42 27 27 42 27 27 42 27 27
42 27 19 13 19 44 46 44 45 44 46 49 50 49 15 13 15 49 30 16 30 50 15 13 15
50 65 58 59 42 15 13 15 42 60 59 60 61 26 41 58 41 27 42 39 42 39 42 39 42
39 42 39 28 13 28 62 50 66 15 13 15 13 39 44 46 44 45 44 46 48 15 13 15 48
65 15 13 15 67 15 13 15 67 43 55 58 60 59 60 61 26 41 58 41 27 42 39 42 39
42 39 42 39 42 39 28 13 28 15 13 15 13 39 44 46 44 45 44 46 63 15 13 15 63
65 67 43 55 58 60 59 60 61 26 41 58 41 27 42 39 42 39 42 39 42 39 42 39 28
13 28 62 50 66 15 13 15 13 39 44 46 44 45 44 46 64 53 55 61 15 13 15 61 58
60 59 60 61 26 41 58 41 27 42 39 42 39 42 39 42 39 42 39 28 13 28 62 50 66
15 13 15 13 39 44 46 44 45 44 46 52 15 13 15 52 53 62 15 13 15 65 67 43 55
58 60 59 60 61 26 41 58 41 27 42 39 42 39 42 39 42 39 42 39 28 13 28 62 50
66 15 13 15 13 39 44 46 44 45 44 46 51 15 13 15 51 65 67 43 55 58 15 13 15
60 59 60 61 26 41 58 41 27 42 39 42 39 42 39 42 39 42 39 28 13 28 62 50 66
15 13 15 13 39 44 46 44 45 44 46 52 15 13 15 52 53 62 15 13 15 65 67 43 55
58 60 59 60 61 26 41 58 41 27 42 39 42 39 42 39 42 39 42 39 28 13 28 62 50
66 15 13 15 13 39 44 46 44 45 44 46 51 15 13 15 51 65 67 43 55 56 57 58 60
59 60 61 26 62 25 49 21 15 13 15 15 13 15 24 68
+1 -1
View File
@@ -9,7 +9,7 @@
* data.src to see which strings have emojis. * data.src to see which strings have emojis.
* *
* It reads one 'string' at a time; it does not read in the whole file at once. * It reads one 'string' at a time; it does not read in the whole file at once.
* option it allows for another file. * The -i option allows for another file.
*/ */
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
+129 -69
View File
@@ -494,42 +494,45 @@ counter-example for that letter but oh is everyone in for a HUGE SHOCK!</p>
<p>24 is peanuts compared to what I did. And let’s be honest - 24 is ALREADY WAY <p>24 is peanuts compared to what I did. And let’s be honest - 24 is ALREADY WAY
too many, even in a large program, let alone a small one. Even one <code>goto</code> is too too many, even in a large program, let alone a small one. Even one <code>goto</code> is too
many. Unless I am very much mistaken, I have broken the record by a huge margin.</p> many. Unless I am very much mistaken, I have broken the record by a huge margin.</p>
<p>Here’s the horrifying and hilarious truth: I beat it out by 92 MORE, <strong>BEFORE</strong> the <p>Here’s the horrifying and hilarious truth: I beat it out by <del>92</del> 107
cpp at 116 and after the cpp is through I beat it by <strong>110</strong> MORE (!!), <strong>AT MORE, <strong>BEFORE</strong> the cpp at <del>116</del> 131 and after the cpp is through I
134!</strong> Yes, you read that right. 134 <code>goto</code>s! I even went further in an alt beat it by <strong>125</strong> MORE (!!), <strong>AT 149!</strong> Yes, you read that right.
version, where before the cpp it was 131 <code>goto</code>s and after the cpp 149 (!!) <del>134</del> 149 <code>goto</code>s! The originally submitted prog.c, submitted for
<code>goto</code>s. I didn’t do this in the main entry for practical reasons but I wish I practical reasons only, had it at, as might be guessed, 116/134 before and after
had.</p> the cpp.</p>
<p>Even removing what I think are the only dead <code>goto</code>s, two of them, including one <p>Even removing what I think were the only dead <code>goto</code>s in the incomplete version,
that is in the <code>w()</code> macro that would be translated into more, I beat it by 90 two of them, including one that is in the <code>w()</code> macro that would be translated
more, at 114 before the cpp, and 99 more after the cpp, at 123!</p> into more, I beat it by 90 more, at 114 before the cpp, and 99 more after the
cpp, at 123! But of course it’s more now…</p>
<p>Did I forget to mention the original Oregon Trail in <strong>BASIC</strong> from 1978 HAS A <p>Did I forget to mention the original Oregon Trail in <strong>BASIC</strong> from 1978 HAS A
MEASLY 109? THIS SHOULD NOT HAPPEN. Well it did happen and this HAS to be a MEASLY 109? THIS SHOULD NOT HAPPEN. Well it did happen and this HAS to be a
joke, right? I’m sorry but it is NOT a joke. I am for real. There REALLY are joke, right? I’m sorry but it is NOT a joke. I am for real. There REALLY are
that many and that is ridiculous.</p> that many and that is ridiculous.</p>
<p>Okay so it’s a joke in another way but nonetheless YES I <strong>REALLY DID</strong> put in <p>Okay so it’s a joke in another way but nonetheless YES I <strong>REALLY DID</strong> put in
116/134 <code>goto</code>s, depending on if you pre-process it or not! YES I might be mad. <del>116/134</del> 131/149 <code>goto</code>s, depending on if you pre-process it or not!
YES I think it’s HILARIOUS. But if it was not for the IOCCC… Well, as I YES I might be mad. YES I think it’s HILARIOUS. But if it was not for the
mention in my <a href="#devil">remarks above</a>, EVEN ONE IS TOO MANY IOCCC… Well, as I mention in my <a href="#devil">remarks above</a>, EVEN ONE IS TOO MANY
in real code.</p> in real code.</p>
<p>I dare you to run the program in a debugger from start to finish to see how many <p>I dare you to run the program in a debugger from start to finish to see how many
line jumps there truly are. After I won I did it once: removing the <code>#include</code>s, line jumps there truly are. After I won I did it once: removing the <code>#include</code>s,
blank lines, lines with only variables and lines with just braces (i.e. only blank lines, lines with only variables and lines with just braces (i.e. only
lines of code) the program has just 59 lines and in a single run there were a lines of code) the program has just 58 lines and in a single run there were a
total of <strong>985</strong> (!) line changes, counting function calls. In <code>main()</code> itself total of <strong>1416</strong> (!) line changes, counting function calls. In <code>main()</code> itself
the line changed a total of <strong>776</strong> (!) times!</p> the line changed a total of <strong>1131</strong> (!) times!</p>
<p>The best (or worst, depending on how you look at it :-) ) part is this works. As <p>The best (or worst, depending on how you look at it :-) ) part is this works. As
I note in those concluding remarks, a <a href="https://www.apple.com">famous company</a> I note in those concluding remarks, a <a href="https://www.apple.com">nameless company</a>
actually introduced a security hole from ONE <code>goto</code>. Yet I have 116/134 and it actually introduced a security hole from ONE <code>goto</code>. Yet I have
actually works? That is surely obscene. And beautiful.</p> <del>116/134</del> 131/149 and it actually works? That is surely obscene. And
<p>Oh and BTW: it appears that <code>hines</code> is a bit confused about my entry, beautiful. But wrong.</p>
though I’m not really sure why. In any case, I not only have dethroned <code>hines</code> <p>Oh and BTW: it appears that <code>hines</code> is a bit confused about my entry, though I’m
(sorry …but also not sorry!) but I have, as noted already, beaten the original not really sure why. In any case, I not only have dethroned <code>hines</code> (sorry
BASIC game by <strong>7</strong> more <code>goto</code>s at 116 before the cpp and <strong>25 MORE</strong> after the …but also not sorry!) but I have, as noted already, beaten the original BASIC
cpp, at 134!</p> game by <del>7</del> 22 more <code>goto</code>s at <del>116</del> 131 before the cpp
<p>It’s almost impossible to add more <code>goto</code>s. You’ll see why soon. But even if and <del><strong>18 MORE</strong></del> <strong>40 MORE</strong> after the cpp, at 149!</p>
that was not the case I wanted room for the other things I did, some of which <p>It’s almost impossible to add more <code>goto</code>s. With the iocccsize it is impossible,
are quite cool and I believe unique as well.</p> if I don’t want to sacrifice the rest of the program. You’ll see why soon. But
even if that was not the case I wanted room for the other things I did, some of
which are quite cool and I believe unique as well.</p>
<p>And yes, I agree: the idea of <code>goto</code>s considered harmful considered harmful is <p>And yes, I agree: the idea of <code>goto</code>s considered harmful considered harmful is
ludicrous, and as you just found out (probably in horror), I have taken it far ludicrous, and as you just found out (probably in horror), I have taken it far
further.</p> further.</p>
@@ -537,10 +540,11 @@ further.</p>
know about C when it comes to things like: loops, if/else, switch/case, blocks know about C when it comes to things like: loops, if/else, switch/case, blocks
in general, where code can be, where labels can be, really everything: the code in general, where code can be, where labels can be, really everything: the code
is in all the wrong places.</p> is in all the wrong places.</p>
<p>This is not counting other cool things like a single <code>char *</code> holding near <p>This is not counting other cool things like a single <code>char *</code> holding near 200
200 <code>char *</code>s. No. I do not mean an array of <code>char *</code>s! I mean a single flat <code>char *</code>s. No. I do not mean an array of <code>char *</code>s! I mean a single flat <code>char *</code>! Yet in the code I index it AS IF it’s a <code>char *[]</code>, just to add to the
<code>char *</code>! Yet in the code I index it AS IF it’s a <code>char *[]</code>, just to add to confusion (as if the <del>134</del> 149 <code>goto</code>s are not bad enough). But it’s
the confusion (as if the 134 <code>goto</code>s are not bad enough). But it’s not a <code>char *[]</code>. It’s a single <code>char *</code>, which is the contents of the data file.</p> not a <code>char *[]</code>. It’s a single <code>char *</code>, which is the contents of the data
file.</p>
<p>There are other things I have done, of course.</p> <p>There are other things I have done, of course.</p>
<p>This program took two months, to the day, to develop and it was totally worth <p>This program took two months, to the day, to develop and it was totally worth
it. But I was almost strangled by the spaghetti, kind of like the Devil, which it. But I was almost strangled by the spaghetti, kind of like the Devil, which
@@ -590,17 +594,19 @@ have lost my mind this program sure as hell lost its mind! And it’s my fault.
Hilarious.</p> Hilarious.</p>
<p>Counting whitespace this program is only 4666 bytes according to <code>wc -c</code> (macOS <p>Counting whitespace this program is only 4666 bytes according to <code>wc -c</code> (macOS
at the least, maybe others): quite intentionally to be on theme. That’s a at the least, maybe others): quite intentionally to be on theme. That’s a
relatively short program to have 116 <code>goto</code>s or more when filtered through <code>cc -E</code> (134!), wouldn’t you say? If that’s NOT too many, then I ask you WHAT IS?</p> relatively short program to have <del>116</del> 131 <code>goto</code>s or more when
filtered through <code>cc -E</code> (<del>134</del> 149!), wouldn’t you say? If that’s NOT
too many, then I ask you WHAT IS?</p>
<p>As said in numerous places, IT IS MUCH SMALLER than the BASIC file I included <p>As said in numerous places, IT IS MUCH SMALLER than the BASIC file I included
even after stripping it of much of it. My program also has more events. I think even after stripping it of much of it. My program also has more events. I think
the BASIC one has 16 not counting the mountains code and mine is 23 not counting the BASIC one has 16 not counting the mountains code and mine is 23 not counting
the mountains code, which obviously I also include.</p> the mountains code, which obviously I also include and has more events (if we
<p>I discuss this some in my concluding <a href="#devil">remarks above</a>, count the doctor visits an event then even more).</p>
as well as mentioning that there are other events <p>I discuss this some in my concluding <a href="#devil">remarks above</a>, as well as
besides those 23. I certainly will not reveal all though. The humour and jokes mentioning that there are other events besides those 23. I certainly will not
sections of that file says more but the concluding remarks are for a summary and reveal all though. The humour and jokes sections of that file says more but the
why I think that this code is worthy of the contest AND also pointing out the concluding remarks are for a summary and why I think that this code is worthy of
folly of <code>goto</code>.</p> the contest AND also pointing out the folly of <code>goto</code>.</p>
<p>In this file I will discuss how some events actually are polymorphic, in a <p>In this file I will discuss how some events actually are polymorphic, in a
sense, having at least two different events.</p> sense, having at least two different events.</p>
<p>THIS IS ALL OBSCENE.</p> <p>THIS IS ALL OBSCENE.</p>
@@ -634,7 +640,58 @@ been mad enough to do what I have done.</p>
<p>Here are some fun statistics from a somewhat rudimentary program on both the <p>Here are some fun statistics from a somewhat rudimentary program on both the
prog.c and after filtered through <code>cc -E</code>. First prog.c. Prepare to be prog.c and after filtered through <code>cc -E</code>. First prog.c. Prepare to be
horrified, if you’re not already:</p> horrified, if you’re not already:</p>
<pre><code> 131 goto
301 semicolon
143 colons
51 if
11 else
3 while
4 for
0 do
6 switch
32 case
2 sizeof
0 break
0 continue
2 default
8 long
3 unsigned
4 return
1 void
1 int
1 char
1 size_t
Ratio: 1.01 gotos per keyword</code></pre>
<p>1.01 goto per keyword? But then there’s the cpp filtered code…</p>
<pre><code> 149 goto
339 semicolon
143 colons
51 if
11 else
7 while
4 for
0 do
6 switch
32 case
2 sizeof
0 break
0 continue
2 default
8 long
3 unsigned
4 return
1 void
1 int
1 char
1 size_t
Ratio: 1.11 gotos per keyword</code></pre>
<p>1.11!</p>
<p>For comparison, here is the original version:</p>
<pre><code> 116 goto <pre><code> 116 goto
294 semicolon
138 colons
50 if 50 if
11 else 11 else
4 while 4 while
@@ -653,11 +710,12 @@ horrified, if you’re not already:</p>
1 int 1 int
1 char 1 char
1 size_t 1 size_t
1 FILE
Ratio: 0.83 gotos per keyword</code></pre> Ratio: 0.83 gotos per keyword</code></pre>
<p>And the pre-processed one:</p> <p>And the pre-processed one:</p>
<pre><code> 134 goto <pre><code> 134 goto
332 semicolon
138 colons
50 if 50 if
11 else 11 else
8 while 8 while
@@ -676,13 +734,9 @@ horrified, if you’re not already:</p>
1 int 1 int
1 char 1 char
1 size_t 1 size_t
1 FILE
Ratio: 0.93 gotos per keyword</code></pre> Ratio: 0.94 gotos per keyword</code></pre>
<p>LOOK AT THAT RATIO! And we could even suggest that <code>FILE</code> might not be a <p>Look at those ratios. This is not right.</p>
keyword, but rather a struct.</p>
<p>Whether data types are keywords for this is also something to consider but we’ll
include them as keywords anyway. I don’t believe I use any others in any case.</p>
<p>This program is as cursed as the PC (player character) if not much more cursed. <p>This program is as cursed as the PC (player character) if not much more cursed.
It is totally bonkers and it was really hard to find places for labels even It is totally bonkers and it was really hard to find places for labels even
after I put them in bizarre and unusual places. But I get into that in more after I put them in bizarre and unusual places. But I get into that in more
@@ -783,7 +837,8 @@ it.</p>
<p>There are a lot of ways to obscure code and I don’t believe anyone has taken <p>There are a lot of ways to obscure code and I don’t believe anyone has taken
<code>goto</code> to this obscenity in C. I believe the one with the most <code>goto</code>s is <code>goto</code> to this obscenity in C. I believe the one with the most <code>goto</code>s is
1987/hines and, as noted earlier, it reports on itself as having only 24 1987/hines and, as noted earlier, it reports on itself as having only 24
<code>goto</code>s. Yet I have 116 before the cpp and 134 (!!) after the cpp.</p> <code>goto</code>s. Yet I have <del>116</del> 131 before the cpp and <del>134</del> 149
(!!) after the cpp.</p>
<p>And unfortunately for you dear reader I have done other things that also are <p>And unfortunately for you dear reader I have done other things that also are
quite different and totally unrelated to <code>goto</code>s. Even so the <code>goto</code> madness by quite different and totally unrelated to <code>goto</code>s. Even so the <code>goto</code> madness by
itself is worth something or some things - including curses.</p> itself is worth something or some things - including curses.</p>
@@ -940,6 +995,8 @@ one question their sanity even more. Yes I’m probably a sociopath.</p>
* WARNING: this code and its comments are not up to date. I wrote 116 before * 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&#39;t wish to * filtered through the cpp and 134 after the cpp and I didn&#39;t wish to
* repeatedly revisit this file trying to explain everything.</code></pre> * repeatedly revisit this file trying to explain everything.</code></pre>
<p>…and of course now the count, prog.c being the full version and prog.alt2.c
being the practical version, have the count at 131/149.</p>
<p>I hope you understand but I do believe it’s a gain not a loss. It is good enough <p>I hope you understand but I do believe it’s a gain not a loss. It is good enough
especially as it’s only for educational value - or to examine my head (though especially as it’s only for educational value - or to examine my head (though
prog.c might be better for that?). As noted the code (and jokes) took a couple prog.c might be better for that?). As noted the code (and jokes) took a couple
@@ -1716,30 +1773,33 @@ padding?</p>
<h3 id="conclusions">Conclusions</h3> <h3 id="conclusions">Conclusions</h3>
<p>A question: is this well-rounded in obfuscation as the judges like? Definitely.</p> <p>A question: is this well-rounded in obfuscation as the judges like? Definitely.</p>
<p>The fact that close to 200 NUL terminated strings are in a single <code>char *</code> (!!), <p>The fact that close to 200 NUL terminated strings are in a single <code>char *</code> (!!),
the odd looking compound literal, the maze of <code>goto</code>s (116 or 1134 depending on the odd looking compound literal, the maze of <code>goto</code>s (<del>116</del> 131 or
if you pre-process the code), the bastardised Duff’s device, the strange labels <del>134</del> 149 depending on if you pre-process the code), the bastardised
inside <code>switch()</code>s, the jumping into and out of <code>switch()</code>s only to jump back in Duff’s device, the strange labels inside <code>switch()</code>s, the jumping into and out
(or out), the for loops split across several parts of the code (one making it of <code>switch()</code>s only to jump back in (or out), the for loops split across several
look like variables are uninitialised), if/else code being swapped in location parts of the code (one making it look like variables are uninitialised), if/else
(or moved to other parts of the code, even in what would otherwise be dead code, code being swapped in location (or moved to other parts of the code, even in
including possibly this for for loops), the fall through of a label to a goto what would otherwise be dead code, including possibly this for for loops), the
that jumps back to right before that fall through just to exit the game (isn’t fall through of a label to a goto that jumps back to right before that fall
that so cute?), the fact I had to write all those tools to verify things are through just to exit the game (isn’t that so cute?), the fact I had to write all
okay (showing how messed up it is), different blocks that have code that simply those tools to verify things are okay (showing how messed up it is), different
should not be there, the nested ternary operators…</p> blocks that have code that simply should not be there, the nested ternary
<p>As for the <code>goto</code>s: yes I technically have more space. But it became almost operators…</p>
impossible to add more spaghetti to the pot without it overflowing, and I do not <p>As for the <code>goto</code>s: yes I technically had more space. But it became almost
impossible to add more spaghetti to the pot without it overflowing, and I didn’t
want to waste perfectly good spaghetti. There comes a point when there’s just so want to waste perfectly good spaghetti. There comes a point when there’s just so
much spaghetti that it’s wasted, if it can even be cooked. I believe I have much spaghetti that it’s wasted, if it can even be cooked. I believed I reached
reached the latter.</p> the latter. But of course that was a practical choice - and not my complete
<p>Do you REALLY expect me to add more spaghetti? There isn’t anything that could version. It was just easier to test as I had another version to contend to.</p>
be done, even if it was possible to maintain this huge platter of delicious <p>But let’s say I had more space with iocccsize: do you REALLY expect me to add
spaghetti without gaining fifty kilograms. Besides, I don’t want to see more spaghetti? There isn’t anything that could be done, even if it was possible
spaghetti EVER AGAIN!! I’ve had enough of it for a lifetime! Okay, that’s not to maintain this huge platter of delicious spaghetti without gaining fifty
really true…it DOES sound good but I won’t likely be having it for a while. kilograms. Besides, I don’t want to see spaghetti EVER AGAIN!! I’ve had enough
Can you actually blame me though? This spaghetti almost strangled me to death, of it for a lifetime! Okay, that’s not really true…it DOES sound good but I
like it did the Devil (I provided photographic proof of this earlier if you won’t likely be having it for a while. Can you actually blame me though? This
missed that).</p> spaghetti almost strangled me to death, like it did the Devil (I provided
photographic proof of this earlier if you missed that). Still…now that things
have settled a bit, I rather desire very much a platter of spaghetti.</p>
<p>I have already demonstrated several other subtle and unique things but the <p>I have already demonstrated several other subtle and unique things but the
<code>goto</code>s are what really makes it hard to parse; the other things are REALLY cool <code>goto</code>s are what really makes it hard to parse; the other things are REALLY cool
(unlike the spaghetti, at least hopefully) and interesting, and unique (or so I (unlike the spaghetti, at least hopefully) and interesting, and unique (or so I
+140 -72
View File
@@ -48,16 +48,17 @@ counter-example for that letter but oh is everyone in for a HUGE SHOCK!
too many, even in a large program, let alone a small one. Even one `goto` is too too many, even in a large program, let alone a small one. Even one `goto` is too
many. Unless I am very much mistaken, I have broken the record by a huge margin. many. Unless I am very much mistaken, I have broken the record by a huge margin.
Here's the horrifying and hilarious truth: I beat it out by 92 MORE, **BEFORE** the Here's the horrifying and hilarious truth: I beat it out by <del>92</del> 107
cpp at 116 and after the cpp is through I beat it by **110** MORE (!!), **AT MORE, **BEFORE** the cpp at <del>116</del> 131 and after the cpp is through I
134!** Yes, you read that right. 134 `goto`s! I even went further in an alt beat it by **125** MORE (!!), **AT 149!** Yes, you read that right.
version, where before the cpp it was 131 `goto`s and after the cpp 149 (!!) <del>134</del> 149 `goto`s! The originally submitted prog.c, submitted for
`goto`s. I didn't do this in the main entry for practical reasons but I wish I practical reasons only, had it at, as might be guessed, 116/134 before and after
had. the cpp.
Even removing what I think are the only dead `goto`s, two of them, including one Even removing what I think were the only dead `goto`s in the incomplete version,
that is in the `w()` macro that would be translated into more, I beat it by 90 two of them, including one that is in the `w()` macro that would be translated
more, at 114 before the cpp, and 99 more after the cpp, at 123! into more, I beat it by 90 more, at 114 before the cpp, and 99 more after the
cpp, at 123! But of course it's more now...
Did I forget to mention the original Oregon Trail in **BASIC** from 1978 HAS A Did I forget to mention the original Oregon Trail in **BASIC** from 1978 HAS A
MEASLY 109? THIS SHOULD NOT HAPPEN. Well it did happen and this HAS to be a MEASLY 109? THIS SHOULD NOT HAPPEN. Well it did happen and this HAS to be a
@@ -65,32 +66,34 @@ joke, right? I'm sorry but it is NOT a joke. I am for real. There REALLY are
that many and that is ridiculous. that many and that is ridiculous.
Okay so it's a joke in another way but nonetheless YES I **REALLY DID** put in Okay so it's a joke in another way but nonetheless YES I **REALLY DID** put in
116/134 `goto`s, depending on if you pre-process it or not! YES I might be mad. <del>116/134</del> 131/149 `goto`s, depending on if you pre-process it or not!
YES I think it's HILARIOUS. But if it was not for the IOCCC... Well, as I YES I might be mad. YES I think it's HILARIOUS. But if it was not for the
mention in my [remarks above](#devil), EVEN ONE IS TOO MANY IOCCC... Well, as I mention in my [remarks above](#devil), EVEN ONE IS TOO MANY
in real code. in real code.
I dare you to run the program in a debugger from start to finish to see how many I dare you to run the program in a debugger from start to finish to see how many
line jumps there truly are. After I won I did it once: removing the `#include`s, line jumps there truly are. After I won I did it once: removing the `#include`s,
blank lines, lines with only variables and lines with just braces (i.e. only blank lines, lines with only variables and lines with just braces (i.e. only
lines of code) the program has just 59 lines and in a single run there were a lines of code) the program has just 58 lines and in a single run there were a
total of **985** (!) line changes, counting function calls. In `main()` itself total of **1416** (!) line changes, counting function calls. In `main()` itself
the line changed a total of **776** (!) times! the line changed a total of **1131** (!) times!
The best (or worst, depending on how you look at it :-) ) part is this works. As The best (or worst, depending on how you look at it :-) ) part is this works. As
I note in those concluding remarks, a [famous company](https://www.apple.com) I note in those concluding remarks, a [nameless company](https://www.apple.com)
actually introduced a security hole from ONE `goto`. Yet I have 116/134 and it actually introduced a security hole from ONE `goto`. Yet I have
actually works? That is surely obscene. And beautiful. <del>116/134</del> 131/149 and it actually works? That is surely obscene. And
beautiful. But wrong.
Oh and BTW: it appears that `hines` is a bit confused about my entry, Oh and BTW: it appears that `hines` is a bit confused about my entry, though I'm
though I'm not really sure why. In any case, I not only have dethroned `hines` not really sure why. In any case, I not only have dethroned `hines` (sorry
(sorry ...but also not sorry!) but I have, as noted already, beaten the original ...but also not sorry!) but I have, as noted already, beaten the original BASIC
BASIC game by **7** more `goto`s at 116 before the cpp and **25 MORE** after the game by <del>7</del> 22 more `goto`s at <del>116</del> 131 before the cpp
cpp, at 134! and <del>**18 MORE**</del> **40 MORE** after the cpp, at 149!
It's almost impossible to add more `goto`s. You'll see why soon. But even if It's almost impossible to add more `goto`s. With the iocccsize it is impossible,
that was not the case I wanted room for the other things I did, some of which if I don't want to sacrifice the rest of the program. You'll see why soon. But
are quite cool and I believe unique as well. even if that was not the case I wanted room for the other things I did, some of
which are quite cool and I believe unique as well.
And yes, I agree: the idea of `goto`s considered harmful considered harmful is And yes, I agree: the idea of `goto`s considered harmful considered harmful is
ludicrous, and as you just found out (probably in horror), I have taken it far ludicrous, and as you just found out (probably in horror), I have taken it far
@@ -101,11 +104,12 @@ know about C when it comes to things like: loops, if/else, switch/case, blocks
in general, where code can be, where labels can be, really everything: the code in general, where code can be, where labels can be, really everything: the code
is in all the wrong places. is in all the wrong places.
This is not counting other cool things like a single `char *` holding near This is not counting other cool things like a single `char *` holding near 200
200 `char *`s. No. I do not mean an array of `char *`s! I mean a single flat `char *`s. No. I do not mean an array of `char *`s! I mean a single flat `char
`char *`! Yet in the code I index it AS IF it's a `char *[]`, just to add to *`! Yet in the code I index it AS IF it's a `char *[]`, just to add to the
the confusion (as if the 134 `goto`s are not bad enough). But it's not a `char confusion (as if the <del>134</del> 149 `goto`s are not bad enough). But it's
*[]`. It's a single `char *`, which is the contents of the data file. not a `char *[]`. It's a single `char *`, which is the contents of the data
file.
There are other things I have done, of course. There are other things I have done, of course.
@@ -167,20 +171,21 @@ Hilarious.
Counting whitespace this program is only 4666 bytes according to `wc -c` (macOS Counting whitespace this program is only 4666 bytes according to `wc -c` (macOS
at the least, maybe others): quite intentionally to be on theme. That's a at the least, maybe others): quite intentionally to be on theme. That's a
relatively short program to have 116 `goto`s or more when filtered through `cc relatively short program to have <del>116</del> 131 `goto`s or more when
-E` (134!), wouldn't you say? If that's NOT too many, then I ask you WHAT IS? filtered through `cc -E` (<del>134</del> 149!), wouldn't you say? If that's NOT
too many, then I ask you WHAT IS?
As said in numerous places, IT IS MUCH SMALLER than the BASIC file I included As said in numerous places, IT IS MUCH SMALLER than the BASIC file I included
even after stripping it of much of it. My program also has more events. I think even after stripping it of much of it. My program also has more events. I think
the BASIC one has 16 not counting the mountains code and mine is 23 not counting the BASIC one has 16 not counting the mountains code and mine is 23 not counting
the mountains code, which obviously I also include. the mountains code, which obviously I also include and has more events (if we
count the doctor visits an event then even more).
I discuss this some in my concluding [remarks above](#devil), I discuss this some in my concluding [remarks above](#devil), as well as
as well as mentioning that there are other events mentioning that there are other events besides those 23. I certainly will not
besides those 23. I certainly will not reveal all though. The humour and jokes reveal all though. The humour and jokes sections of that file says more but the
sections of that file says more but the concluding remarks are for a summary and concluding remarks are for a summary and why I think that this code is worthy of
why I think that this code is worthy of the contest AND also pointing out the the contest AND also pointing out the folly of `goto`.
folly of `goto`.
In this file I will discuss how some events actually are polymorphic, in a In this file I will discuss how some events actually are polymorphic, in a
sense, having at least two different events. sense, having at least two different events.
@@ -223,8 +228,68 @@ Here are some fun statistics from a somewhat rudimentary program on both the
prog.c and after filtered through `cc -E`. First prog.c. Prepare to be prog.c and after filtered through `cc -E`. First prog.c. Prepare to be
horrified, if you're not already: horrified, if you're not already:
```
131 goto
301 semicolon
143 colons
51 if
11 else
3 while
4 for
0 do
6 switch
32 case
2 sizeof
0 break
0 continue
2 default
8 long
3 unsigned
4 return
1 void
1 int
1 char
1 size_t
Ratio: 1.01 gotos per keyword
```
1.01 goto per keyword? But then there's the cpp filtered code...
```
149 goto
339 semicolon
143 colons
51 if
11 else
7 while
4 for
0 do
6 switch
32 case
2 sizeof
0 break
0 continue
2 default
8 long
3 unsigned
4 return
1 void
1 int
1 char
1 size_t
Ratio: 1.11 gotos per keyword
```
1.11!
For comparison, here is the original version:
``` ```
116 goto 116 goto
294 semicolon
138 colons
50 if 50 if
11 else 11 else
4 while 4 while
@@ -243,7 +308,6 @@ horrified, if you're not already:
1 int 1 int
1 char 1 char
1 size_t 1 size_t
1 FILE
Ratio: 0.83 gotos per keyword Ratio: 0.83 gotos per keyword
``` ```
@@ -252,6 +316,8 @@ And the pre-processed one:
``` ```
134 goto 134 goto
332 semicolon
138 colons
50 if 50 if
11 else 11 else
8 while 8 while
@@ -270,16 +336,11 @@ And the pre-processed one:
1 int 1 int
1 char 1 char
1 size_t 1 size_t
1 FILE
Ratio: 0.93 gotos per keyword Ratio: 0.94 gotos per keyword
``` ```
LOOK AT THAT RATIO! And we could even suggest that `FILE` might not be a Look at those ratios. This is not right.
keyword, but rather a struct.
Whether data types are keywords for this is also something to consider but we'll
include them as keywords anyway. I don't believe I use any others in any case.
This program is as cursed as the PC (player character) if not much more cursed. This program is as cursed as the PC (player character) if not much more cursed.
It is totally bonkers and it was really hard to find places for labels even It is totally bonkers and it was really hard to find places for labels even
@@ -414,7 +475,8 @@ it.
There are a lot of ways to obscure code and I don't believe anyone has taken There are a lot of ways to obscure code and I don't believe anyone has taken
`goto` to this obscenity in C. I believe the one with the most `goto`s is `goto` to this obscenity in C. I believe the one with the most `goto`s is
1987/hines and, as noted earlier, it reports on itself as having only 24 1987/hines and, as noted earlier, it reports on itself as having only 24
`goto`s. Yet I have 116 before the cpp and 134 (!!) after the cpp. `goto`s. Yet I have <del>116</del> 131 before the cpp and <del>134</del> 149
(!!) after the cpp.
And unfortunately for you dear reader I have done other things that also are And unfortunately for you dear reader I have done other things that also are
quite different and totally unrelated to `goto`s. Even so the `goto` madness by quite different and totally unrelated to `goto`s. Even so the `goto` madness by
@@ -600,6 +662,9 @@ As I commented in the commented.c:
* repeatedly revisit this file trying to explain everything. * repeatedly revisit this file trying to explain everything.
``` ```
...and of course now the count, prog.c being the full version and prog.alt2.c
being the practical version, have the count at 131/149.
I hope you understand but I do believe it's a gain not a loss. It is good enough I hope you understand but I do believe it's a gain not a loss. It is good enough
especially as it's only for educational value - or to examine my head (though especially as it's only for educational value - or to examine my head (though
prog.c might be better for that?). As noted the code (and jokes) took a couple prog.c might be better for that?). As noted the code (and jokes) took a couple
@@ -1620,32 +1685,35 @@ padding?
A question: is this well-rounded in obfuscation as the judges like? Definitely. A question: is this well-rounded in obfuscation as the judges like? Definitely.
The fact that close to 200 NUL terminated strings are in a single `char *` (!!), The fact that close to 200 NUL terminated strings are in a single `char *` (!!),
the odd looking compound literal, the maze of `goto`s (116 or 1134 depending on the odd looking compound literal, the maze of `goto`s (<del>116</del> 131 or
if you pre-process the code), the bastardised Duff's device, the strange labels <del>134</del> 149 depending on if you pre-process the code), the bastardised
inside `switch()`s, the jumping into and out of `switch()`s only to jump back in Duff's device, the strange labels inside `switch()`s, the jumping into and out
(or out), the for loops split across several parts of the code (one making it of `switch()`s only to jump back in (or out), the for loops split across several
look like variables are uninitialised), if/else code being swapped in location parts of the code (one making it look like variables are uninitialised), if/else
(or moved to other parts of the code, even in what would otherwise be dead code, code being swapped in location (or moved to other parts of the code, even in
including possibly this for for loops), the fall through of a label to a goto what would otherwise be dead code, including possibly this for for loops), the
that jumps back to right before that fall through just to exit the game (isn't fall through of a label to a goto that jumps back to right before that fall
that so cute?), the fact I had to write all those tools to verify things are through just to exit the game (isn't that so cute?), the fact I had to write all
okay (showing how messed up it is), different blocks that have code that simply those tools to verify things are okay (showing how messed up it is), different
should not be there, the nested ternary operators... blocks that have code that simply should not be there, the nested ternary
operators...
As for the `goto`s: yes I technically have more space. But it became almost As for the `goto`s: yes I technically had more space. But it became almost
impossible to add more spaghetti to the pot without it overflowing, and I do not impossible to add more spaghetti to the pot without it overflowing, and I didn't
want to waste perfectly good spaghetti. There comes a point when there's just so want to waste perfectly good spaghetti. There comes a point when there's just so
much spaghetti that it's wasted, if it can even be cooked. I believe I have much spaghetti that it's wasted, if it can even be cooked. I believed I reached
reached the latter. the latter. But of course that was a practical choice - and not my complete
version. It was just easier to test as I had another version to contend to.
Do you REALLY expect me to add more spaghetti? There isn't anything that could But let's say I had more space with iocccsize: do you REALLY expect me to add
be done, even if it was possible to maintain this huge platter of delicious more spaghetti? There isn't anything that could be done, even if it was possible
spaghetti without gaining fifty kilograms. Besides, I don't want to see to maintain this huge platter of delicious spaghetti without gaining fifty
spaghetti EVER AGAIN!! I've had enough of it for a lifetime! Okay, that's not kilograms. Besides, I don't want to see spaghetti EVER AGAIN!! I've had enough
really true...it DOES sound good but I won't likely be having it for a while. of it for a lifetime! Okay, that's not really true...it DOES sound good but I
Can you actually blame me though? This spaghetti almost strangled me to death, won't likely be having it for a while. Can you actually blame me though? This
like it did the Devil (I provided photographic proof of this earlier if you spaghetti almost strangled me to death, like it did the Devil (I provided
missed that). photographic proof of this earlier if you missed that). Still...now that things
have settled a bit, I rather desire very much a platter of spaghetti.
I have already demonstrated several other subtle and unique things but the I have already demonstrated several other subtle and unique things but the
`goto`s are what really makes it hard to parse; the other things are REALLY cool `goto`s are what really makes it hard to parse; the other things are REALLY cool
-11
View File
@@ -9,16 +9,6 @@
* Using the macro (identical except it uses puts() on some of the strings that * Using the macro (identical except it uses puts() on some of the strings that
* are unencrypted) from prog.c we will print out every string * are unencrypted) from prog.c we will print out every string
* at every location in the order it occurs. * at every location in the order it occurs.
*
* IMPORTANT NOTE: as some strings have a marker that indicates to not be
* encrypted but the marker is not in the data file itself, the bytecount.c
* might be better in that it uses the data source file. However for my own
* purposes I have this tool too. This tool, to prevent display problems, checks
* for specific known locations where it should not decrypt anything due to not
* being encrypted (the '%' ones notwithstanding), and if it is that number it
* will print it out with puts() instead (can't be printf() as it has %
* conversions). A BEL byte also is unencrypted (if it's the first character of
* the string it's skipped and printed without encrypting it).
*/ */
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
@@ -32,7 +22,6 @@
*/ */
#define Z(x) (x)*BLOCKSIZE #define Z(x) (x)*BLOCKSIZE
#define V(x) puts(&y[Z(x)]); #define V(x) puts(&y[Z(x)]);
static char *p;
static char *y; static char *y;
static char *filename = "data"; static char *filename = "data";
static size_t len; static size_t len;
@@ -18,13 +18,13 @@ switch(1)
{ j:if(z)goto A; E*=5; B: { j:if(z)goto A; E*=5; B:
printf(&y[Z(12)],T); if(z) { goto f; } goto PP; default: srand(time(0)); printf(&y[Z(12)],T); if(z) { goto f; } goto PP; default: srand(time(0));
K=fopen(DATA,"r"); if(!K||getdelim(&y,&J,EOF,K)<0) K=fopen(DATA,"r"); if(!K||getdelim(&y,&J,EOF,K)<0)
goto hell; goto M; OO: if(b<1) { if(a){ w(40) PP: goto G; } if(f) w(41) w(45) g:goto S; } w(M>2169?47:45) goto hell; goto M; OO: if(b<1) { if(a){ w(40) PP: goto G; } if(f)w(41) w(45) g:goto S; } w(M>2169?47:45)
hell: hell:
return return
666; rr:; 666; rr:;
goto CC; yy: goto OO; yy:
{ if(b<1||M<0||M>2169){ goto _; F:V(51); R+=18; goto L; } goto i; do{ if(b<1||M<0||M>2169){ break; F:V(51); R+=18; goto L; } goto i;
P:for(X=1; X<--(unsigned){ 7 } ; ){ goto kk; BB:*o[X]+=(X==2?t[X]*5:t[X]); goto HA; TA:++X; goto at; ZZ:; } P:for(X=1; X<--(unsigned){ 7 } ; ){ goto kk; BB:*o[X]+=(X==2?t[X]*5:t[X]); goto HA; TA:++X; goto at; ZZ:; }
printf(&y[Z(11)],R,E,G,O,N,T,b,M); if(x(0,1))goto I; R:if(R<14)V(37); if(z) { z=0; l: { if (k()) { if (x(0,9) > 4) { V(52); printf(&y[Z(11)],R,E,G,O,N,T,b,M); if(x(0,1))goto I; R:if(R<14)V(37); if(z) { z=0; l: { if (k()) { if (x(0,9) > 4) { V(52);
@@ -49,37 +49,37 @@ t[X])if(t[X]<0||t[X]>
*o[X]<0||*o[X] > *o[X]<0||*o[X] >
666) { V(14); 666) { V(14);
goto x; } T=1666-O-R-E-G-0-N; if(T<0){ V(46); O=R=E=G=N=0; goto v; LL:*o[X]=0; uu:++X; goto ZZ; } } goto bb; } } goto s; case 3: goto X; case 1:z=1; M-=45; goto v; goto x; } T=1666-O-R-E-G-0-N; if(T<0){ V(46); O=R=E=G=N=0; goto v; LL:*o[X]=0; uu:++X; goto ZZ; } } goto bb; } } goto s; case 3: goto X; case 1:z=1; M-=45; goto v;
case 2:goto T; } goto y; case 2:goto T; } goto y;
O:{ V(e = 19); O -= 40; R+=40; } goto E; i:if(O<1){ goto d; } else { goto vv; mm:; } goto P; go: V(81); R+=9; N+=3; goto to; O:{ V(e = 19); O -= 40; R+=40; } goto E; i:if(O<1){ goto d; } else { v=0; } goto P; go: V(81); R+=9; N+=3; goto to;
} else{ goto y; HA:T-=X[t]; goto TA; A:for(X=1; X < 6; ){ goto BB; kk:if (*o[X]<0) goto LL; goto uu; QQ:V(B=38); goto JJ; at:; } goto B; } else{ goto y; HA:T-=X[t]; goto TA; A:for(X=1; X < 6; ){ goto BB; kk:if (*o[X]<0) goto LL; goto uu; QQ:V(B=38); goto JJ; at:; } goto B;
} T:l=1; if (E<9){ goto h; } else { goto l; h: V(16); goto C; DD: goto u; } C: l=0; f:z=0; } T:l=1; if (E<9){ goto h; } else { goto l; h: V(16); } C: l=0; f:z=0;
X:if(R<1){ goto e; U: w(24) K:R-=R X:if(R<1){ goto e; U: w(24) K:R-=R
>23?23:R>18? 18 : R > 13 ? 13 : >23?23:R>18? 18 : R > 13 ? 13 :
R; goto Y; TT:V(v=15); O=0; goto P; } else { goto K; } goto tt; Y:switch(q=x(0,23)) R; goto Y; TT:V(v=15); O=0; goto P; } else { goto K; } goto tt; Y:switch(q=x(0,22))
{ case 1:V(95); R+=5; goto Z; case 18:V(26); goto Z; case 13:V(28); goto Z; { case 1:V(95); R+=5; break; case 18:V(26); goto Z; case 13:V(28); break;
case 2:O-=40; V(71); goto Z; case 3:V(a=76); b-=70; goto W; case 4:V(77); N-=7; M-=7; goto Z; case 5:case case 2:O-=40; V(71); break; case 3:V(a=76); b-=70; goto W; case 4:V(77); N-=7; M-=7; break; case 5:case
10:if(q<6) { goto ha; m: V(56); goto D; CC: goto OO; o:; } else 10:if(q<6) { goto ha; m: V(56); goto D; o:; } else
{ goto m; oo:V(f=62); M-=50; b-=35; s:; } goto Z; a:goto H; { goto m; oo:V(f=62); M-=50; b-=35; s:; } goto Z; a:goto H;
case 9:case 19:V(30); goto Z; case 20:V(32); goto Z; case 21 :V(31); goto Z; case 6:goto g; case 16: case 22:V(49); goto Z; case 17:V(72); goto Z; case 9:case 19:V(30); goto Z; case 20:V(32); break; case 21 :V(31); break; case 6:goto g; case 16: case 22:V(49); goto Z; case 17:V(72); goto Z;
case 7:V(83); M-=10; goto Z; case 8:V(86); R-=30; G-=20; O-=40; V case 7:V(83); M-=10; goto Z; case 8:V(86); R-=30; G-=20; O-=40; V
:switch(x(1,9)){ case 2:if(q>9){ switch(x(1,2)){ q:R+=40; goto Y; case 1:{ switch (x(2,5)) { case 2:V(a=54); goto :switch(x(1,9)){ case 2:if(q>9){ switch(x(1,2)){ q:R+=40; goto Y; case 1:{ switch (x(2,5)) { case 2:V(a=54); goto
MM; b:w(48) MM; b:w(48)
case 3:goto J; N:goto Q; case 4:i=17; } } case 2: V(5); } goto k; u: if(M<1951||W){ goto case 3:goto J; N:goto Q; case 4:i=17; } } case 2: V(5); } goto k; u: if(M<1951||W){ goto
W; } W=1; W; } W=1;
if(!d&&!x(0,4)){ V(75); d=1; R+= 50; } if(!d&&!x(0,4)){ V(75); d=1; R+= 50; }
if(!x(0,3)){ w(x(0,4)?84:x(0,4)?33:34) e:if(O>39){ goto xx; vv:v=0; goto mm; d:{ if(!v)goto TT; goto P; } } goto U; } if (x(0,9) < 5) w:V(35); c=1; M-=101; ++E; k: M-=10; W: if(x(0,1)){ if (d) V(39); if(e)V(25); } while(i)heaven:{ w(i) } if (!B&&(f|| if(!x(0,3)){ w(x(0,4)?84:x(0,4)?33:34) e:if(O>39){ V(e=x(0,1)?18:19); O -= 40; goto q; d:{ if(!v)goto TT; goto P; } } goto U; } if (x(0,9) < 5) w:V(35); c=1; M-=101; ++E; k: M-=10; W: if(x(0,1)){ if (d) V(39); if(e)V(25); } while(i)heaven:{ w(i) } if (!B&&(f||
a)){ if(d&&a) V(91); if(T<666){ goto QQ; KK:Q=a?1:Q; h=f?1:h; f=a=0; V(93); T-=666; } else{ goto KK; } JJ:; } b-=f?15 a)){ if(d&&a) V(91); if(T<666){ goto QQ; KK:Q=a?1:Q; h=f?1:h; f=a=0; V(93); T-=666; } else{ goto KK; } JJ:; } b-=f?15
:h?5:0; b-=a?5:Q?15:0; M+=170; M+=O> 99 ? 30:- 99; :h?5:0; b-=a?5:Q?15:0; M+=170; M+=O> 99 ? 30:- 99;
b-=10; goto z; J: V(a=54); } goto k; MM b-=10; goto z; J: V(a=54); } goto k; MM
:goto k; default: if(q>10) { goto k; } if(q>7) { if(N<5) { w(99) goto M; G:goto yy; } V(13); N-=5; } goto Z; _:goto rr; S:if (E>1999){ w(27) I:goto a; } V(82); M-=9; N-=5; R-=20; goto Z; :goto k; default: if(q>10) { goto k; } if(q>7) { if(N<5) { w(99) goto M; G:goto yy; } V(13); N-=5; } goto Z; _:goto rr; S:if (E>1999){ w(27) I:goto a; } V(82); M-=9; N-=5; R-=20; goto Z;
} M-=17; goto Z; case 14: V(74); goto Z; case 15: V(x(0,1)?69:68); } M-=17; goto Z; case 14: V(74); break; case 15: V(x(0,1)?69:68);
goto Z; ha:V(78); if(k()){ goto go; to:; } else { goto ii; jj:; } goto o; case 11: goto V; case goto Z; ha:V(78); if(k()){ goto go; to:; } else { goto ii; jj:; } goto o; case 11: goto V; case
12:V(94); M-=5; b-=19; N -= 5; goto Z; tt: goto Y; case 0:V(20); Z:; } if(O>39&&!x(0,9)){goto O; xx: V(e=x(0,1)?18:19); O -= 40; goto q; } E: if(M<951) goto W; if (G < 36){ goto b; } if (x(0,9) > 2) goto n; V(96); if (x(0,1)) { goto p; Q: for (X= 12:V(94); M-=5; b-=19; N -= 5; goto Z; tt: goto Y; case 0:V(20); Z:; } if(O>39&&!x(0,9))goto O; E: if(M<951) goto W; if (G < 36) goto b; if (x(0,9) > 2) goto n; V(96); if (x(0,1)) { goto p; Q: for (X=
1; X < 6; ++X) { goto x; bb:; } goto j; } V(97); M-= 60; goto n; H:goto R; p: if (x(0,9)<3) goto t; V(21); M -=99; 1; X < 6; ++X) { goto x; bb:; } goto j; } V(97); M-= 60; goto n; H: goto R; p: if (x(0,9)<3) goto t; V(21); M -=99;
goto n; t: V(22); M -= 85; n:if(m){ goto DD; } m=1; if (x(0,9) > 5) goto w; V(23); z:; } if (A++<21) goto yy; goto _; goto n; t: V(22); M -= 85; n:if(m){ goto u; } m=1; if (x(0,9) > 5) goto w; V(23); z:; } while (A++<21); goto _;
} }
} }
+30 -47
View File
@@ -18,68 +18,51 @@ switch(1)
{ j:if(z)goto A; E*=5; B: { j:if(z)goto A; E*=5; B:
printf(&y[Z(12)],T); if(z) { goto f; } goto PP; default: srand(time(0)); printf(&y[Z(12)],T); if(z) { goto f; } goto PP; default: srand(time(0));
K=fopen(DATA,"r"); if(!K||getdelim(&y,&J,EOF,K)<0) K=fopen(DATA,"r"); if(!K||getdelim(&y,&J,EOF,K)<0)
goto hell; goto M; OO: if(b<1) { if(a){ w(40) PP: goto G; } if(f)w(41) w(45) g:goto S; } w(M>2169?47:45) goto hell; goto M; OO:if(b<1) { if(a){ w(40) PP:goto G; } if(f) w(41) w(45) g:goto S; } w(M>2169?47:45)
hell: hell:
return return
666; rr:; 666; rr:;
goto CC; yy:
goto OO; yy: { if(b<1||M<0||M>2169){ goto _; F:V(51); R+=18; goto L; } goto i;
do{ if(b<1||M<0||M>2169){ break; F:V(51); R+=18; goto L; } goto i;
P:for(X=1; X<--(unsigned){ 7 } ; ){ goto kk; BB:*o[X]+=(X==2?t[X]*5:t[X]); goto HA; TA:++X; goto at; ZZ:; } P:for(X=1; X<--(unsigned){ 7 } ; ){ goto kk; BB:*o[X]+=(X==2?t[X]*5:t[X]); goto HA; TA:++X; goto at; ZZ:; }
printf(&y[Z(11)],R,E,G,O,N,T,b,M); if(x(0,1))goto I; R:if(R<14)V(37); if(z) { z=0; l: { if (k()) { if (x(0,9) > 4) { V(52); printf(&y[Z(11)],R,E,G,O,N,T,b,M); if(x(0,1))goto I; R:if(R<14)V(37); if(z) { z=0; l:{ if (k()) { if (x(0,9) > 4) { V(52);
R+=23; if(!x(0,9)){ goto r; L:goto II; } c:; } else{ goto F; r:goto c; qq:{ V(53); goto zz; } II:; } } else { goto qq; } zz:E-=9; M-=45; } goto C; y:V(42); S(2,r) switch(r) { M:V(1); v:memset(&t,0,sizeof t); goto
R+=23; if(!x(0,9)){ goto r; L: goto II; } c:; } else{ goto F; r: goto c; qq: { V(53); goto zz; } II:; } } else { goto qq; } zz: E-=9; M-=45; } goto C; y:V(42); S(2,r) switch(r) { M:V(1); v:memset(&t,0,sizeof t); goto
N; D:{ if (k()) { goto dd; ii:V(f=79); b -= 80; T/=4; goto jj; ee:; } else { goto oo; dd:V(a=29); T+=70; goto ee; x:V(X+--( N; D:{ if (k()) { goto dd; ii:V(f=79); b -= 80; T/=4; goto jj; ee:; } else { goto oo; dd:V(a=29); T+=70; goto ee; x:V(X+--(
unsigned){ 6 } ); if(z){ S(3, unsigned){ 6 } ); if(z){ S(3,t[X])if(t[X]<0||t[X]>
666 ){ V(14); goto x; goto
t[X])if(t[X]<0||t[X]>
666 ){ V(14); goto x; goto
heaven ; ET:L-=t[u]; goto XT; } L=T; for(u heaven ; ET:L-=t[u]; goto XT; } L=T; for(u
=0; u < 6; ++u){ goto ET; XT:; }
=0; u < 6; ++u){ goto ET; XT:; } if(L<0){ V(46); memset(&t,0, sizeof t); goto v; } }
else{ S(3 ,*(o[X])) if(
if(L<0){ V(46); memset(&t,0,
sizeof t); goto v; } }
else{ S(3 ,*(o[X])) if(
*o[X]<0||*o[X] > *o[X]<0||*o[X] >
666) { V(14); 666) { V(14);
goto x; } T=1666-O-R-E-G-0-N; if(T<0){ V(46); O=R=E=G=N=0; goto v; LL:*o[X]=0; uu:++X; goto ZZ; } } goto bb; } } goto s; case 3:goto X; case 1:z=1; M-=45; goto v;
goto x; } T=1666-O-R-E-G-0-N; if(T<0){ V(46); O=R=E=G=N=0; goto v; LL:*o[X]=0; uu:++X; goto ZZ; } } goto bb; } } goto s; case 3: goto X; case 1:z=1; M-=45; goto v;
case 2:goto T; } goto y; case 2:goto T; } goto y;
O:{ V(e = 19); O -= 40; R+=40; } goto E; i:if(O<1){ goto d; } else { v=0; } goto P; go: V(81); R+=9; N+=3; goto to; O:{ V(e = 19); O -= 40; R+=40; } goto E; i:if(O<1){ goto d; } else { goto vv; mm:; } goto P; go:V(81); R+=9; N+=3; goto to;
} else{ goto y; HA:T-=X[t]; goto TA; A:for(X=1; X < 6; ){ goto BB; kk:if (*o[X]<0) goto LL; goto uu; QQ:V(B=38); goto JJ; at:; } goto B; } else{ goto y; HA:T-=X[t]; goto TA; A:for(X=1; X < 6; ){ goto BB; kk:if (*o[X]<0) goto LL; goto uu; QQ:V(B=38); goto JJ; at:; } goto B;
} T:l=1; if (E<9){ goto h; } else { goto l; h: V(16); } C: l=0; f:z=0; } T:l=1; if (E<9){ goto h; } else { goto l; h:V(16); goto C; DD:goto u; } C:l=0; f:z=0;
X:if(R<1){ goto e; U: w(24) K:R-=R X:if(R<1){ goto e; U:w(24) K:R-=R
>23?23:R>18? 18 : R > 13 ? 13 : >23?23:R>18? 18 : R > 13 ? 13 :
R; goto Y; TT:V(v=15); O=0; goto P; } else { goto K; } goto tt; Y:switch(q=x(0,23)) R; goto Y; TT:V(v=15); O=0; goto P; } else { goto K; } goto tt; Y:switch(q=x(0,22))
{ case 1:V(95); R+=5; break; case 18:V(26); goto Z; case 13:V(28); break; { case 1:V(95); R+=5; goto Z; case 18:V(26); goto Z; case 13:V(28); goto Z;
case 2:O-=40; V(71); break; case 3:V(a=76); b-=70; goto W; case 4:V(77); N-=7; M-=7; break; case 5:case case 2:O-=40; V(71); goto Z; case 3:V(a=76); b-=70; goto W; case 4:V(77); N-=7; M-=7; goto Z; case 5:case
10:if(q<6) { goto ha; m: V(56); goto D; o:; } else 10:if(q<6) { goto ha; m:V(56); goto D; CC:goto OO; o:; } else
{ goto m; oo:V(f=62); M-=50; b-=35; s:; } goto Z; a:goto H; { goto m; oo:V(f=62); M-=50; b-=35; s:; } goto Z; a:goto H;
case 9:case 19:V(30); goto Z; case 20:V(32); break; case 21 :V(31); break; case 6:goto g; case 16: case 22:V(49); goto Z; case 17:V(72); goto Z; case 9:case 19:V(30); goto Z; case 20:V(32); goto Z; case 21 :V(31); goto Z; case 6:goto g; case 16:case 22:V(49); goto Z; case 17:V(72); goto Z;
case 7:V(83); M-=10; goto Z; case 8:V(86); R-=30; G-=20; O-=40; V case 7:V(83); M-=10; goto Z; case 8:V(86); R-=30; G-=20; O-=40; V
:switch(x(1,9)){ case 2:if(q>9){ switch(x(1,2)){ q:R+=40; goto Y; case 1:{ switch (x(2,5)) { case 2:V(a=54); goto :switch(x(1,9)){ case 2:if(q>9){ switch(x(1,2)){ q:R+=40; goto Y; case 1:{ switch (x(2,5)) { case 2:V(a=54); goto
MM; b:w(48) MM; b:w(48)
case 3:goto J; N:goto Q; case 4:i=17; } } case 2: V(5); } goto k; u: if(M<1951||W){ goto case 3:goto J; N:goto Q; case 4:i=17; } } case 2:V(5); } goto k; u:if(M<1951||W){ goto
W; } W=1; W; } W=1;
if(!d&&!x(0,4)){ V(75); d=1; R+= 50; } if(!d&&!x(0,4)){ V(75); d=1; R+= 50; }
if(!x(0,3)){ w(x(0,4)?84:x(0,4)?33:34) e:if(O>39){ V(e=x(0,1)?18:19); O -= 40; goto q; d:{ if(!v)goto TT; goto P; } } goto U; } if (x(0,9) < 5) w:V(35); c=1; M-=101; ++E; k: M-=10; W: if(x(0,1)){ if (d) V(39); if(e)V(25); } while(i)heaven:{ w(i) } if (!B&&(f|| if(!x(0,3)){ w(x(0,4)?84:x(0,4)?33:34) e:if(O>39){ goto xx; vv:v=0; goto mm; d:{ if(!v)goto TT; goto P; } } goto U; } if (x(0,9) < 5) w:V(35); c=1; M-=101; ++E; k:M-=10; W:if(x(0,1)){ if (d) V(39); if(e)V(25); } while(i)heaven:{ w(i) } if (!B&&(f||
a)){ if(d&&a) V(91); if(T<666){ goto QQ; KK:Q=a?1:Q; h=f?1:h; f=a=0; V(93); T-=666; } else{ goto KK; } JJ:; } b-=f?15 a)){ if(d&&a) V(91); if(T<666){ goto QQ; KK:Q=a?1:Q; h=f?1:h; f=a=0; V(93); T-=666; } else{ goto KK; } JJ:; } b-=f?15
:h?5:0; b-=a?5:Q?15:0; M+=170; M+=O> 99 ? 30:- 99; :h?5:0; b-=a?5:Q?15:0; M+=170; M+=O> 99 ? 30:- 99;
b-=10; goto z; J:V(a=54); } goto k; MM
b-=10; goto z; J: V(a=54); } goto k; MM
:goto k; default: if(q>10) { goto k; } if(q>7) { if(N<5) { w(99) goto M; G:goto yy; } V(13); N-=5; } goto Z; _:goto rr; S:if (E>1999){ w(27) I:goto a; } V(82); M-=9; N-=5; R-=20; goto Z; :goto k; default: if(q>10) { goto k; } if(q>7) { if(N<5) { w(99) goto M; G:goto yy; } V(13); N-=5; } goto Z; _:goto rr; S:if (E>1999){ w(27) I:goto a; } V(82); M-=9; N-=5; R-=20; goto Z;
} M-=17; goto Z; case 14: V(74); break; case 15: V(x(0,1)?69:68); } M-=17; goto Z; case 14:V(74); goto Z; case 15:V(x(0,1)?69:68);
goto Z; ha:V(78); if(k()){ goto go; to:; } else { goto ii; jj:; } goto o; case 11: goto V; case goto Z; ha:V(78); if(k()){ goto go; to:; } else { goto ii; jj:; } goto o; case 11:goto V; case
12:V(94); M-=5; b-=19; N -= 5; goto Z; tt: goto Y; case 0:V(20); Z:; } if(O>39&&!x(0,9))goto O; E: if(M<951) goto W; if (G < 36) goto b; if (x(0,9) > 2) goto n; V(96); if (x(0,1)) { goto p; Q: for (X= 12:V(94); M-=5; b-=19; N -= 5; goto Z; tt:goto Y; case 0:V(20); Z:; } if(O>39&&!x(0,9)){goto O; xx:V(e=x(0,1)?18:19); O -= 40; goto q; } E:if(M<951) goto W; if (G < 36){ goto b; } if (x(0,9) > 2) goto n; V(96); if (x(0,1)) { goto p; Q:for (X=
1; X < 6; ++X) { goto x; bb:; } goto j; } V(97); M-= 60; goto n; H: goto R; p: if (x(0,9)<3) goto t; V(21); M -=99; 1; X < 6; ++X) { goto x; bb:; } goto j; } V(97); M-= 60; goto n; H:goto R; p:if (x(0,9)<3) goto t; V(21); M -=99;
goto n; t: V(22); M -= 85; n:if(m){ goto u; } m=1; if (x(0,9) > 5) goto w; V(23); z:; } while (A++<21); goto _; goto n; t:V(22); M -= 85; n:if(m){ goto DD; } m=1; if (x(0,9) > 5) goto w; V(23); z:; } if (A++<21) goto yy; goto _;
} } }
}
+42
View File
@@ -0,0 +1,42 @@
#include<stdio.h>
#include<string.h>
#include<time.h>
#include<stdlib.h>
#include<unistd.h>
long x(long y, long z){ return rand()%(z-y+1)+y; }
unsigned m,D,Q,v,l,f,X,z,B,i,h,
r,u,d,e; long
O,R,E,G,O,N, T,R,A,I,L,*o[]={ &O,&R,&E,&G,&O,&N} ,a,t[7],q,M, b=666,c,W; char *y,*p; FILE*K; size_t J;
#define w(i) { V(i); V(4); goto hell; goto M; }
long Z(long x){ return x * 1663; }
#define S(x,z) while(scanf(&y[Z(x)],&z)!=1)while(getchar()!='\n');
void V(long x){printf("%s",&y[Z(x)]);}long k(){return E>0?x(0,99)>49:0;}int main(){switch(1){j:if(z)goto A;E*=5;B:
printf(&y[Z(12)],T);if(z){goto f;}goto PP;default:srand(time(0));K=fopen(DATA,"r");if(!K||getdelim(&y,&J,EOF,K)<0)goto
hell; goto M;OO:if(b<1){if(a){w(40)PP:goto G;}if(f)w(41)w(45)g:goto S;}w(M>2169?47:45)
hell:return
666;rr:;goto CC;yy:{if(b<1||M<0||M>2169){goto _;F:V(51);R+=18;goto L;}goto i;P:for(X=1;X<--(unsigned){7};){goto kk;
BB:*o[X]+=(X==2?t[X]*5:t[X]);goto HA;TA:++X;goto at;ZZ:;}printf(&y[Z(11)],R,E,G,O,N,T,b,M);if(x(0,1))goto I;R:if(R<14)V(37);
if(z){z=0;l:{if(k()){if(x(0,9)>4){V(52);R+=23;if(!x(0,9)){goto r;L:goto II;}c:;}else{goto F;r:goto c;qq:{V(53);goto zz;}II:;}}
else{goto qq;}zz:E-=9;M-=45;}goto C;y:V(42);S(2,r)switch(r){M:V(1);v:memset(&t,0,sizeof t);goto N;D:{if(k()){goto dd;ii:V(f=79);
b-=80;T/=4;goto jj;ee:;}else{goto oo;dd:V(a=29);T+=70;goto ee;x:V(X+--(unsigned){6});if(z){S(3,t[X])if(t[X]<0||t[X]>
666 ){V(14); goto x; goto
heaven ;ET:L-=t[u]; goto XT;}L=T;for(u=0;u<6;++u){goto ET;XT:;}if(L<0){V(46);memset(&t,0,sizeof t);goto v;}}
else{S(3,*(o[X]))if(*o[X]<0||*o[X]>
666) {V(14);goto x;}
T=1666-O-R-E-G-0-N;if(T<0){V(46);O=R=E=G=N=0;goto v;LL:*o[X]=0;uu:++X;goto ZZ;}}goto bb;}}goto s;case 3:goto X;case 1:z=1;M-=45;
goto v;case 2:goto T;}goto y;O:{V(e=19);O-=40;R+=40;}goto E;i:if(O<1){goto d;}else{goto vv;mm:;}goto P;go:V(81);R+=9;N+=3;goto
to;}else{goto y;HA:T-=X[t];goto TA;A:for(X=1;X<6;){goto BB;kk:if(*o[X]<0)goto LL;goto uu;QQ:V(B=38);goto JJ;at:;}goto B;}T:l=1;
if(E<9){goto h;}else{goto l;h:V(16);goto C;DD:goto u;}C:l=0;f:z=0;X:if(R<1){goto e;U:w(24)K:R-=R>23?23:R>18?18:R>13?13:R;goto Y;
TT:V(v=15);O=0;goto P;}else{goto K;}goto tt;Y:switch(q=x(0,22)){case 1:V(95);R+=5;goto Z;case 18:V(26);goto Z;case 13:V(28);goto Z;
case 2:O-=40;V(71);goto Z;case 3:V(a=76);b-=70;goto W;case 4:V(77);N-=7;M-=7;goto Z;case 5:case 10:if(q<6){goto ha;m:V(56);goto D;
CC:goto OO;o:;}else{goto m;oo:V(f=62);M-=50;b-=35;s:;}goto Z;a:goto H;case 9:case 19:V(30);goto Z;case 20:V(32);goto Z;case 21:V(31);goto Z;case 6:goto g;case 16:case 22:V(49);goto Z;case 17:V(72);goto Z;case 7:V(83);M-=10;goto Z;case 8:V(86);R-=30;G-=20;O-=40;V
:switch(x(1,9)){case 2:if(q>9){switch(x(1,2)){q:R+=40;goto Y;case 1:{switch(x(2,5)){case 2:V(a=54);goto MM;b:w(48)case 3:goto J;N:
goto Q;case 4:i=17;}}case 2:V(5);}goto k;u:if(M<1951||W){goto W;}W=1;if(!d&&!x(0,4)){V(75);d=1;R+= 50;}if(!x(0,3)){w(x(0,4)?84:x(0,4)?33:34)e:if(O>39){goto xx;vv:v=0;goto mm;d:{if(!v)goto TT;goto P;}}goto U;}if(x(0,9)<5)w:V(35);c=1;M-=101;++E;k:M-=10;W:if(x(0,1)){
if(d)V(39);if(e)V(25);}while(i)heaven:{w(i)}if(!B&&(f||a)){if(d&&a)V(91);if(T<666){goto QQ;KK:Q=a?1:Q;h=f?1:h;f=a=0;V(93);T-=666;}
else{goto KK;}JJ:;}b-=f?15:h?5:0;b-=a?5:Q?15:0;M+=170;M+=O>99?30:-99;b-=10;goto z;J:V(a=54);}goto k;MM:goto k;default:if(q>10){
goto k;}if(q>7){if(N<5){w(99)goto M;G:goto yy;}V(13);N-=5;}goto Z;_:goto rr;S:if(E>1999){w(27)I:goto a;}V(82);M-=9;N-=5;R-=20;goto Z;
}M-=17;goto Z;case 14:V(74);goto Z;case 15:V(x(0,1)?69:68);goto Z;ha:V(78);if(k()){goto go;to:;}else{goto ii;jj:;}goto o;case 11:
goto V;case 12:V(94);M-=5;b-=19;N-=5;goto Z;tt:goto Y;case 0:V(20);Z:;}if(O>39&&!x(0,9)){goto O;xx:V(e=x(0,1)?18:19);O-=40;goto q;}
E:if(M<951)goto W;if(G<36){goto b;}if(x(0,9)>2)goto n;V(96);if(x(0,1)){goto p;Q:for(X=1;X<6;++X){goto x;bb:;}goto j;}V(97);M-=60;
goto n;H:goto R;p:if(x(0,9)<3)goto t;V(21);M-=99;goto n;t:V(22);M-=85;n:if(m){goto DD;}m=1;if(x(0,9)>5)goto w;V(23);z:;}if(A++<21)
goto yy;goto _;}}