diff --git a/2024/ferguson1/.entry.json b/2024/ferguson1/.entry.json index 8957547e4..e97cc81f7 100644 --- a/2024/ferguson1/.entry.json +++ b/2024/ferguson1/.entry.json @@ -38,12 +38,12 @@ "entry_text" : "alternate source code" }, { - "file_path" : "prog.goto.max.c", + "file_path" : "prog.alt2.c", "inventory_order" : 40, "OK_to_edit" : true, "display_as" : "c", "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.orig.c", diff --git a/2024/ferguson1/.gitignore b/2024/ferguson1/.gitignore index 551096ebd..8248f81ee 100644 --- a/2024/ferguson1/.gitignore +++ b/2024/ferguson1/.gitignore @@ -17,10 +17,11 @@ data.scrnshot lencount mbcheck printer +prog.alt +prog.alt2 +prog.alt2.asc +prog.alt2.scrnshot prog.alt.asc prog.alt.scrnshot prog.asc -prog.goto.max -prog.goto.max.asc -prog.goto.max.scrnshot prog.scrnshot diff --git a/2024/ferguson1/Makefile b/2024/ferguson1/Makefile index 1528d00f3..8ad66d0f0 100644 --- a/2024/ferguson1/Makefile +++ b/2024/ferguson1/Makefile @@ -154,12 +154,12 @@ TARGET= ${PROG} ${PROG}.asc ${PROG}.scrnshot # .alt is as above more events # -ALT_OBJ= ${PROG}.alt.o ${PROG}.alt.asc.o ${PROG}.alt.scrnshot.o ${PROG}.goto.max.o \ - ${PROG}.goto.max.asc.o ${PROG}.goto.max.scrnshot.o -ALT_TARGET= ${PROG}.alt ${PROG}.alt.asc ${PROG}.alt.scrnshot ${PROG}.goto.max \ - ${PROG}.goto.max.asc ${PROG}.goto.max.scrnshot +ALT_OBJ= ${PROG}.alt.o ${PROG}.alt.asc.o ${PROG}.alt.scrnshot.o \ + ${PROG}.alt2.o ${PROG}.alt2.asc.o ${PROG}.alt2.scrnshot.o +ALT_TARGET= ${PROG}.alt ${PROG}.alt.asc ${PROG}.alt.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. # 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 @./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. # ${PROG}.asc: ${PROG}.c @@ -246,7 +246,7 @@ addpadding: addpadding.c bytecount: bytecount.c ${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. # bytetest: bytetest.c @@ -258,17 +258,18 @@ bytetest: bytetest.c byteread: byteread.c ${CC} ${CFLAGS} byteread.c -o $@ ${LDFLAGS} -# this tool was helpful to help identify if any emojis in the ASCII only version -# slipped through (however, mbcheck is a better one: this tool is still -# useful however). Probably only the judges will find this interesting just like -# most of the tools I have provided. +# this tool was earlier used to help in identifying any emojis in the ASCII only +# version that might have slipped through (however, mbcheck is a better one: this tool is still +# useful however). Mostly provided for the judges but I, the author, included +# most of the tools (most of which are meant only for the judges as well). # bytecheck: bytecheck.c ${CC} ${CFLAGS} -Wno-unreachable-code-break bytecheck.c -o $@ ${LDFLAGS} # 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 -# 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 ${CC} ${CFLAGS} -Wno-unreachable-code-break mbcheck.c -o $@ ${LDFLAGS} @@ -290,7 +291,8 @@ printer: printer.c lencount: lencount.c ${CC} ${CFLAGS} -Wno-unreachable-code-break lencount.c -o $@ ${LDFLAGS} - +# The author provided these notes in his Makefile: +# # IMPORTANT NOTES FOR THE JUDGES. # # The makedata.sh script will generate files that are needed by some of the @@ -320,9 +322,13 @@ padding: addpadding test ./addpadding @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 -# the other tools but it can be used for prog.c and prog.alt.c indirectly as it -# also does build the data files from the source files. +# the other tools but it can be used for prog.c and prog.alt.c (and prog.alt2.c +# 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 # 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 ${CC} ${CFLAGS} -DDATA='"data"' ${PROG}.alt.c -o $@ ${LDFLAGS} + # 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. # @@ -352,17 +359,6 @@ ${PROG}.alt.asc: ${PROG}.alt.c ${MAKE} padding ${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 # @@ -370,11 +366,30 @@ ${PROG}.alt.scrnshot: ${PROG}.alt.c ${MAKE} padding ${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 - ${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 # diff --git a/2024/ferguson1/README.md b/2024/ferguson1/README.md index 674f90c16..47823cf7a 100644 --- a/2024/ferguson1/README.md +++ b/2024/ferguson1/README.md @@ -29,8 +29,11 @@ YouTube show for this entry: ## Alternate code: -The author provided two alternate versions, one which has more events and far -fewer `goto`s and the other which maxed out the `goto`s at 149 (up from 134)! +The author provided two alt versions: one submitted with more events, though not +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: @@ -44,32 +47,36 @@ fewer `goto`s and the other which maxed out the `goto`s at 149 (up from 134)! ``` ./prog.alt + + ./prog.alt2 ``` ## Judges' remarks: -You will have to go to "Fun-Damentals" to understand the logic flow of -this game. While you jump as many as 134 times to travel from `main()` -to a successful `exit(666)` you may have a devil of a time trying to -figure out how this program actually does what it does. +You will have to go to "Fun-Damentals" to understand the logic flow of this +game. While you goto as many as 149 times and jump hundreds or even over a +thousand times to travel from `main()` to a successful `exit(666)` you may have +a devil of a time trying to figure out how this program actually does what it +does. Before you set off on your adventure to decode this program's logic, make sure you have enough food, ammo, clothes, oxen, and programming supplies. You’ll be driving for 2170 miles through a wild wilderness inspired -by [Oregon Trail](https://en.wikipedia.org/wiki/The_Oregon_Trail_(series)), so 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. :-) +by [Oregon +Trail](https://en.wikipedia.org/wiki/The_Oregon_Trail_(series)), so +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: > 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 -functions just the few functions in prog.c), there were a total of **985** (!) -line jumps. Skipping prog.c function calls and it was still **776** jumps! The +functions just the few functions in prog.c), there were a total of **1416** (!) +line jumps. Skipping prog.c function calls and it was still **1131** jumps! The prog.c, if you remove `#include`s, blank lines, lines with just a brace and -lines that have only variables, **has just 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 really matter. The [maxed out goto version](%%REPO_URL%%/2024/ferguson1/prog.goto.max.c) is far worse. @@ -80,7 +87,7 @@ 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.
./try.sh
The author provided two alternate versions, one which has more events and far
-fewer gotos and the other which maxed out the gotos at 149 (up from 134)!
The author provided two alt versions: one submitted with more events, though not
+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 gotos up from 134) that was not made prog.c during submission for
+practical reasons.
make alt
./prog.alt
+ ./prog.alt
+
+ ./prog.alt2
You will have to go to “Fun-Damentals” to understand the logic flow of
-this game. While you jump as many as 134 times to travel from main()
-to a successful exit(666) you may have a devil of a time trying to
-figure out how this program actually does what it does.
You will have to go to “Fun-Damentals” to understand the logic flow of this
+game. While you goto as many as 149 times and jump hundreds or even over a
+thousand times to travel from main() to a successful exit(666) you may have
+a devil of a time trying to figure out how this program actually does what it
+does.
Before you set off on your adventure to decode this program’s logic, make sure you have enough food, ammo, clothes, oxen, and programming supplies. You’ll be driving for 2170 miles through a wild wilderness inspired -by Oregon Trail, so 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. :-)
+by Oregon +Trail, so +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. :-)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 -functions just the few functions in prog.c), there were a total of 985 (!) -line jumps. Skipping prog.c function calls and it was still 776 jumps! The +functions just the few functions in prog.c), there were a total of 1416 (!) +line jumps. Skipping prog.c function calls and it was still 1131 jumps! The prog.c, if you remove
@@ -520,7 +527,7 @@ encrypted one even encrypted emojis without having to decrypt them in order to print them (and everything else). I have kept references to encryption in this file even after publication. I do have a copy of it if anyone is interested.#includes, 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 really matter. The maxed out goto version is far worse.-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 149 regrets of goto)
The Go To Hell In A Handcart Travel Company PROUDLY welcomes all sinners to our GREATEST destination yet, with:
@@ -2201,8 +2208,9 @@ features versus problems, though possibly more exist.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 -one) it could happen again. Remember you might end up eating an ox just because -he looks at you funny, not just because you are out of food.
+one, which of course is not in the original either) it could happen again. +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 what happens when you die of starvation? Well it says:
+🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦🪦 @@ -2227,27 +2235,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 player character (PC) does not.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 -and starved to death’, doesn’t it?).
+nothing else (but it does make it more interesting and amusing than ‘You ran +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 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 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 -:-), 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 -but rather in the sense that you have fewer oxen) even if you don’t have one. It -does this in a number of ways like referring to the famous ‘spared no expense’ -from Jurassic Park. It also is a nod the IOCCC guidelines that talk about a fish -Eric that might or might not exist.
+but rather in the sense that you have fewer oxen, for instance getting stuck in +a river) even if you don’t have one. It does this in a number of ways like +referring to the famous ‘spared no expense’ from Jurassic Park. It also is a nod +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 (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 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 -you’re not going to get very far anyway. In other cases, like eating an oxen, -the check is in place, although in retrospect it would be very amusing if it did +you’re not going to get very far anyway. In other cases, like eating an ox, the +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 somewhat realistic.
Of course even if one runs out of oxen that would not mean they couldn’t make it @@ -2460,10 +2469,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).
I could be wrong on whether this is one the compiler missed though: it’s hard to follow all the
+149 after pre-processing! The second alt code is what I originally submitted as +prog.c but after winning I made the more complete (149 gotos post cpp, 131 prior +to cpp) version (that was not submitted for practical reasons) the prog.c. +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.gotos. As you find out in obfuscation.html it’s -134 after pre-processing! One of the alt versions I supplied is 131 before the -cpp and 149 after. I did not submit that for practical reasons but I kind of -wish I had, now that it won. Nonetheless 134 is already way too many. 149 is -much worse.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 times. Some code I made dead seemed totally useless but why not add to @@ -2570,8 +2581,8 @@ that much in one turn I think.
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 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 -kicking a bucket physically, not kicking the bucket figuratively (or in this +does it sidekick?) that issue - it’s not even meant to eliminate one as if it +was kicking a bucket physically, not kicking the bucket figuratively (or in this 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 event and go straight to the doctor. This not only plays in the theme (wait and @@ -2581,7 +2592,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 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 -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 happen). This is NOT 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 @@ -2594,7 +2610,7 @@ what I mean you can change the code:
- 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 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:
case 4:i=17; } } case 2: V(5); } goto k;You might think this is a bug but this is actually hilarious. Here is what will @@ -2643,10 +2659,11 @@ is ENTIRELY unclear how the author is not confused. All I know is 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 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 -narrator is the devil means that some of that was not even necessary, given that -he (as I have shown in this file) cannot be trusted and says things that are -totally bogus and many that make absolutely no sense.
+vice versa. This was done numerous times in fact. The fact that the narrator is +the devil means that some of that was not even necessary, given that he (as I +have shown in this file) cannot be trusted and says things that are totally +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 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, @@ -2907,16 +2924,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 I mentioned in obfuscation.html (and some briefly below).
In general I think it’s extremely hard to follow the flow of this program due to -the abuse of 116
-gotos, more than the BASIC game. 134 when pre-processed. But -let’s be honest, or 134 for a small C program is too many but to be only six -fewer than a larger BASIC program? That is hard to fathom. Not that 116 is not -too many for larger programs…or one goto, for that matter. As noted elsewhere, -an alt version has 131/149 gotos, before/after the cpp. I did not make it the -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 extragotos) but now that it’s in I have no qualms about providing it as -alt code: if I am going to ruingotos I might as well do it properly.Some things are clear about the program from visual inspection:
+the abuse of116131gotos, more than the BASIC game. +134149 when pre-processed. But +let’s be honest, or 131 for a small C program is too many but to be seven more +than the larger BASIC program? That is hard to fathom. Not that116+131/149 is not too many for larger programs…or one goto, for that matter. +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
+gotos like I did: why should I not do it properly? So it’s +now maxed out with all the other obfuscation 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 is printed).
@@ -3013,20 +3033,21 @@ a single flatchar *, although I do think that’s pretty cool and+--I talked about in obfuscation.html (in fact in some 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. -But above all I would not have used 116 (or 134)
+gotos. Or ten. Or five. Or -even one. Better to let code generators like flex/bison take the crown. I have -dethroned them though (at least from what I have seen before) - by a huge -amount. But perhaps 1987/hines -had the crown. It no longer does. I should be ashamed. I’m not.But above all I would not have used
116131 (or134149) +gotos. Or ten. Or five. Or even one. Better to let code generators like +flex/bison take the crown. I have dethroned them though (at least from what I +have seen before) - by a huge amount. But perhaps +1987/hines 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
gotoI would not normally use it in the ways I did, as noted earlier and in obfuscation.html!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 -absolutely horrified.
+hope and guess I do, even outside the IOCCC, because if I do not there is +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 context of the IOCCC I really have reached the logical conclusion of
gotos (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.It’s about time either way. Hopefully the judges will take
@@ -3074,10 +3095,12 @@ mean manygotoand throw it into the deepest bowels of the Earth.gotos.There are so many
+isn’tgotos that to try and move code to add moregotos is 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, -isn’t 134 enough, especially in a program that, counting spaces, including -unnecessary spaces to add to the size, is only 4666 bytes? It would be smaller -except to stay on theme. Doing more would no longer be funny. Enough is enough. -Or at least I hope.134149 enough, especially in a program that, counting spaces, +including unnecessary spaces to add to the size, is only 4666 bytes? It would be +smaller except to stay on theme. Doing more would no longer be funny. Enough is +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.
Here are some things Frank wrote:
@@ -3099,7 +3122,9 @@ traits I do not even know how to describe. Perhaps they would be utterly ineffable.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 -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 finish):
@@ -3112,12 +3137,12 @@ full sequence. This is from start to finish and I include it for your amusement (see jumps.txt for the line changes including calls to prog.c 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 -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.19 20 21 32 69 82 34 33 34 47 45 47 50 83 34 33 34 47 45 47 50 83 34 33 34This program, if you remove blank lines and lines with just a brace, -
-#includes and only variables, has a mere 59 (!) lines.A program that has only 59 lines of code that jumps 985 (counting functions) or -776 (just in main()) times is astonishing. Of course that’s not the +
+#includes and only variables, has a mere 58 (!) lines.A program that has only 58 lines of code that jumps 1416 (counting functions) or +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 fitting as it is diabolical to follow this code (and the theme of the game fits as well); the obfuscation.html shows even more on this - and @@ -3135,14 +3160,14 @@ he was wrong.
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 my program - or maintain it. Or write it.
-It would have been SO MUCH EASIER if I did not use 134
+gotos (and I could have -fit more in). Actually, even a -tiny portion of that would make it harder. Nobody, whether they’re in their -right mind or not, would WANT to maintain this, or something even close to it. -Feel free to pass on judgement to me. I welcome it! You have to be mad and -embrace it to do this. I went full out and I could have fit moregotos in: not -only is the iocccsize not 2503 but I could have removed some events if I really -wanted moregotos.It would have been SO MUCH EASIER if I did not use
134149gotos. +Actually, even a tiny portion of that would make it harder. Nobody, whether +they’re in their right mind or not, would WANT to MAINTAIN this, or something +even close to it. Feel free to pass on judgement to me. I welcome it! You have +to be mad and embrace it to do this. I went full out and I could have fit more +gotos in: not only is the iocccsize not 2503 (although it’s close now) but I +could have removed some events if I really wanted moregotos. That would be +less fun.Even flex/bison code, which as far as I am aware uses FAR fewer
@@ -3172,27 +3197,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 not even 12 hours before closing time. I barely made it. Part of that is I added even moregotos, is notorious forgotos and is quite hard to follow. It would be a nightmare to try and maintain without the .l/.y source files.gotos, 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, such as freeing space so I could change some
-break;s to agoto Z;asZ: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 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 -already controlled by goto.In fact I could have done more
+already controlled by goto. The currentgotos in this version but I wanted to help the -judges out in judging - that and it was easier to verify things are correct. -iocccsizereports 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.prog.chas even more of this as it’s +the goto complete version.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 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
-gotos, even if I -now wish I had gone even further.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
+follow and I’m happy to have smashed the record of 24 bygotos are alas, not banned outright).110125 +gotos.Anyway, as I noted in obfuscation.html, no initialisation is skipped in my jumps and that is what causes
gototo invoke UB.Everything is file scope. And in any case, when I do jump to a place, everything @@ -3257,8 +3276,8 @@ that they aren’t harmful, mostly to show just how extreme this program went. https://www.blackduck.com/blog/understanding-apple-goto-fail-vulnerability-2.html. That’s all it takes: JUST ONE
gotoled to a CVE!It is ironic, perfect and hilarious that it was
+a failure in usinggoto fail;as it was actually -a failure in usinggoto! My code has 134 (with the cpp, 116 without). That is -obscene. I did not fail. At all.goto! My code has134149 (with the cpp, +116131 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 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 @@ -3294,12 +3313,12 @@ Yes, in the IOCCC, but outside that?
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 one of those languages. Or it wasn’t until now.
-Yes, yes…I know, I KNOW I put in 116
+gotos with 134 when pre-processed -and that is probably more extreme than any other C program, especially in such a -small program (and I REALLY hope I’m right there!). But this does NOT matter! -Even if one or two were not harmful (but they are) it’s jumping down a rabbit -hole that can very easily get deeper and deeper just like Alice found. When -there’s no NEED for it it’s much worse.Yes, yes…I know, I KNOW I put in
116131gotos with +134149 when pre-processed and that is probably more extreme than any +other C program, especially in such a small program (and I REALLY hope I’m right +there!). But this does NOT matter! Even if one or two were not harmful (but +they are) it’s jumping down a rabbit hole that can very easily get deeper and +deeper just like Alice found. When there’s no NEED for it it’s much worse.
gotos 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 how much is lost withgotos (okay, I have shown this with other things too). @@ -3342,24 +3361,26 @@ 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
-gotois 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 -killed 134 angels. YES I condemned 134 angels to eternal torment. I HAD to. -I don’t regret it - but you should, if you ever write something like this -outside the IOCCC. In fact you should regret a singlegotoangel -dying. Even if they did not go straight to hell in a handcart, you should still -regret it. But they do. Okay so I don’t really believe that but there is no -denying there is goto hell here.I found my abuse of
+killedgotohilarious. It was good intentions - the contest. But -sadly sometimes the worst things that happen start with good intentions; and -some of the best things strangely start with horrible intentions. It might be -that I did this with good intentions for the contest but it would not be good -anywhere else. I would be beyond angry if I had to maintain this code. I would -not blame anyone if they cursed me. I probably would be too. Not cursing you. I -mean cursing me.134149 angels. YES I condemned134149 angels to +eternal torment. I HAD to. I don’t regret it - but you should, if you +ever write something like this outside the IOCCC. In fact you should regret +a singlegotoangel dying. Even if they did not go straight to hell +in a handcart, you should still regret it. But they do. Okay so I don’t really +believe that but there is no denying there is goto hell here. +I
foundfind my abuse ofgotohilarious. It was good intentions - +the contest. But sadly sometimes the worst things that happen start with good +intentions; and some of the best things strangely start with horrible +intentions. It might be that I did this with good intentions for the contest but +it would not be good anywhere else. I would be beyond angry if I had to maintain +this code. I would not blame anyone if they cursed me. I probably would be too. +Not cursing you. I mean cursing me.Don’t write code like this. Except for the IOCCC. Unless of course the judges decide they want no more
+guess… (it appears that, based on the general remarks by the judges, of the +winning entries, thatgotos. I would not put that past them after what I 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 -guess…gotowill 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 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 @@ -3725,8 +3746,8 @@ helps you appreciate the careful design even more.prog.c - entry source code
- Makefile - entry Makefile
+- prog.alt2.c - original source code with minor bug fix
- prog.alt.c - alternate source code
-- prog.goto.max.c - entry source code with maxed out gotos
- prog.orig.c - original source code
- commented.c - commented version of the game
- addpadding.c - add padding from data source files
diff --git a/2024/ferguson1/jumps.txt b/2024/ferguson1/jumps.txt index 84d5f4efd..669e06a6d 100644 --- a/2024/ferguson1/jumps.txt +++ b/2024/ferguson1/jumps.txt @@ -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -26 21 15 13 15 15 13 15 24 85 +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 +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 +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 +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 +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 +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 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 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 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 51 15 13 15 51 65 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 55 65 31 30 15 13 15 31 13 33 +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 +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 +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 +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 +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 +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 51 15 13 15 +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 +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 +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 +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 +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 48 15 13 15 48 65 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 55 65 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 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 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 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 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 64 +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 +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 15 13 15 67 15 13 15 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 55 65 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 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 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 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 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 diff --git a/2024/ferguson1/mbcheck.c b/2024/ferguson1/mbcheck.c index 8213e67d1..64db9d736 100644 --- a/2024/ferguson1/mbcheck.c +++ b/2024/ferguson1/mbcheck.c @@ -9,7 +9,7 @@ * 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. - * option it allows for another file. + * The -i option allows for another file. */ #include#include diff --git a/2024/ferguson1/obfuscation.html b/2024/ferguson1/obfuscation.html index 489265fea..63dc9aeb4 100644 --- a/2024/ferguson1/obfuscation.html +++ b/2024/ferguson1/obfuscation.html @@ -494,42 +494,45 @@ counter-example for that letter but oh is everyone in for a HUGE SHOCK! 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
-gotois too 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 -cpp at 116 and after the cpp is through I beat it by 110 MORE (!!), AT -134! Yes, you read that right. 134
-gotos! I even went further in an alt -version, where before the cpp it was 131gotos and after the cpp 149 (!!) -gotos. I didn’t do this in the main entry for practical reasons but I wish I -had.Even removing what I think are the only dead
+gotos, two of them, including one -that is in thew()macro that would be translated into more, I beat it by 90 -more, at 114 before the cpp, and 99 more after the cpp, at 123!Here’s the horrifying and hilarious truth: I beat it out by
+92107 +MORE, BEFORE the cpp at116131 and after the cpp is through I +beat it by 125 MORE (!!), AT 149! Yes, you read that right. +134149gotos! The originally submitted prog.c, submitted for +practical reasons only, had it at, as might be guessed, 116/134 before and after +the cpp.Even removing what I think were the only dead
gotos in the incomplete version, +two of them, including one that is in thew()macro that would be translated +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 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 that many and that is ridiculous.
Okay so it’s a joke in another way but nonetheless YES I REALLY DID put in -116/134
gotos, depending on if you pre-process it or not! YES I might be mad. -YES I think it’s HILARIOUS. But if it was not for the IOCCC… Well, as I -mention in my remarks above, EVEN ONE IS TOO MANY +116/134131/149gotos, depending on if you pre-process it or not! +YES I might be mad. YES I think it’s HILARIOUS. But if it was not for the +IOCCC… Well, as I mention in my remarks above, EVEN ONE IS TOO MANY in real code.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
+lines of code) the program has just 58 lines and in a single run there were a +total of 1416 (!) line changes, counting function calls. In#includes, 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 -total of 985 (!) line changes, counting function calls. Inmain()itself -the line changed a total of 776 (!) times!main()itself +the line changed a total of 1131 (!) times!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 -actually introduced a security hole from ONE
-goto. Yet I have 116/134 and it -actually works? That is surely obscene. And beautiful.Oh and BTW: it appears that
-hinesis a bit confused about my entry, -though I’m not really sure why. In any case, I not only have dethronedhines-(sorry …but also not sorry!) but I have, as noted already, beaten the original -BASIC game by 7 moregotos at 116 before the cpp and 25 MORE after the -cpp, at 134!It’s almost impossible to add more
+I note in those concluding remarks, a nameless company +actually introduced a security hole from ONEgotos. 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.goto. Yet I have +116/134131/149 and it actually works? That is surely obscene. And +beautiful. But wrong. +Oh and BTW: it appears that
+hinesis a bit confused about my entry, though I’m +not really sure why. In any case, I not only have dethronedhines(sorry +…but also not sorry!) but I have, as noted already, beaten the original BASIC +game by722 moregotos at116131 before the cpp +and18 MORE40 MORE after the cpp, at 149!It’s almost impossible to add more
gotos. With the iocccsize it is impossible, +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.And yes, I agree: the idea of
@@ -537,10 +540,11 @@ further. 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 is in all the wrong places. -gotos considered harmful considered harmful is ludicrous, and as you just found out (probably in horror), I have taken it far further.This is not counting other cool things like a single
+char *holding near -200char *s. No. I do not mean an array ofchar *s! I mean a single flat -char *! Yet in the code I index it AS IF it’s achar *[], just to add to -the confusion (as if the 134gotos are not bad enough). But it’s not achar *[]. It’s a singlechar *, which is the contents of the data file.This is not counting other cool things like a single
char *holding near 200 +char *s. No. I do not mean an array ofchar *s! I mean a single flatchar *! Yet in the code I index it AS IF it’s achar *[], just to add to the +confusion (as if the134149gotos are not bad enough). But it’s +not achar *[]. It’s a singlechar *, which is the contents of the data +file.There are other things I have done, of course.
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 @@ -590,17 +594,19 @@ have lost my mind this program sure as hell lost its mind! And it’s my fault. Hilarious.
Counting whitespace this program is only 4666 bytes according to
+relatively short program to havewc -c(macOS at the least, maybe others): quite intentionally to be on theme. That’s a -relatively short program to have 116gotos or more when filtered throughcc -E(134!), wouldn’t you say? If that’s NOT too many, then I ask you WHAT IS?116131gotos or more when +filtered throughcc -E(134149!), 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 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 mountains code, which obviously I also include.
-I discuss this some in my concluding remarks above, -as well as mentioning that there are other events -besides those 23. I certainly will not reveal all though. The humour and jokes -sections of that file says more but the concluding remarks are for a summary and -why I think that this code is worthy of the contest AND also pointing out the -folly of
+the mountains code, which obviously I also include and has more events (if we +count the doctor visits an event then even more). +goto.I discuss this some in my concluding remarks above, as well as +mentioning that there are other events besides those 23. I certainly will not +reveal all though. The humour and jokes sections of that file says more but the +concluding remarks are for a summary and why I think that this code is worthy of +the contest AND also pointing out the folly of
goto.In this file I will discuss how some events actually are polymorphic, in a sense, having at least two different events.
THIS IS ALL OBSCENE.
@@ -634,7 +640,58 @@ been mad enough to do what I have done.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 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 keyword1.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 keyword1.11!
+For comparison, here is the original version:
116 goto + 294 semicolon + 138 colons 50 if 11 else 4 while @@ -653,11 +710,12 @@ horrified, if you’re not already: 1 int 1 char 1 size_t - 1 FILE Ratio: 0.83 gotos per keywordAnd the pre-processed one:
-134 goto + 332 semicolon + 138 colons 50 if 11 else 8 while @@ -676,13 +734,9 @@ horrified, if you’re not already: 1 int 1 char 1 size_t - 1 FILE - Ratio: 0.93 gotos per keywordLOOK AT THAT RATIO! And we could even suggest that
-FILEmight not be a -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.
+ Ratio: 0.94 gotos per keywordLook at those ratios. This is not right.
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 after I put them in bizarre and unusual places. But I get into that in more @@ -783,7 +837,8 @@ it.
There are a lot of ways to obscure code and I don’t believe anyone has taken
+gototo this obscenity in C. I believe the one with the mostgotos is 1987/hines and, as noted earlier, it reports on itself as having only 24 -gotos. Yet I have 116 before the cpp and 134 (!!) after the cpp.gotos. Yet I have116131 before the cpp and134149 +(!!) after the cpp.And unfortunately for you dear reader I have done other things that also are quite different and totally unrelated to
@@ -940,6 +995,8 @@ one question their sanity even more. Yes I’m probably a sociopath. * WARNING: this code and its comments are not up to date. I wrote 116 before * filtered through the cpp and 134 after the cpp and I didn't wish to * repeatedly revisit this file trying to explain everything. +gotos. Even so thegotomadness by itself is worth something or some things - including curses.…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 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 @@ -1716,30 +1773,33 @@ padding?
Conclusions
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 odd looking compound literal, the maze ofgotos (116 or 1134 depending on -if you pre-process the code), the bastardised Duff’s device, the strange labels -insideswitch()s, the jumping into and out ofswitch()s only to jump back in -(or out), the for loops split across several parts of the code (one making it -look like variables are uninitialised), if/else code being swapped in location -(or moved to other parts of the code, even in what would otherwise be dead code, -including possibly this for for loops), the fall through of a label to a goto -that jumps back to right before that fall through just to exit the game (isn’t -that so cute?), the fact I had to write all those tools to verify things are -okay (showing how messed up it is), different blocks that have code that simply -should not be there, the nested ternary operators…As for the
+gotos: yes I technically have more space. But it became almost -impossible to add more spaghetti to the pot without it overflowing, and I do not +the odd looking compound literal, the maze ofgotos (116131 or +134149 depending on if you pre-process the code), the bastardised +Duff’s device, the strange labels insideswitch()s, the jumping into and out +ofswitch()s only to jump back in (or out), the for loops split across several +parts of the code (one making it look like variables are uninitialised), if/else +code being swapped in location (or moved to other parts of the code, even in +what would otherwise be dead code, including possibly this for for loops), the +fall through of a label to a goto that jumps back to right before that fall +through just to exit the game (isn’t that so cute?), the fact I had to write all +those tools to verify things are okay (showing how messed up it is), different +blocks that have code that simply should not be there, the nested ternary +operators…As for the
-gotos: 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 -much spaghetti that it’s wasted, if it can even be cooked. I believe I have -reached the latter.Do you REALLY expect me to add more spaghetti? There isn’t anything that could -be done, even if it was possible to maintain this huge platter of delicious -spaghetti without gaining fifty kilograms. Besides, I don’t want to see -spaghetti EVER AGAIN!! I’ve had enough of it for a lifetime! Okay, that’s not -really true…it DOES sound good but I won’t likely be having it for a while. -Can you actually blame me though? This spaghetti almost strangled me to death, -like it did the Devil (I provided photographic proof of this earlier if you -missed that).
+much spaghetti that it’s wasted, if it can even be cooked. I believed I reached +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. +But let’s say I had more space with iocccsize: do you REALLY expect me to add +more spaghetti? There isn’t anything that could be done, even if it was possible +to maintain this huge platter of delicious spaghetti without gaining fifty +kilograms. Besides, I don’t want to see spaghetti EVER AGAIN!! I’ve had enough +of it for a lifetime! Okay, that’s not really true…it DOES sound good but I +won’t likely be having it for a while. Can you actually blame me though? This +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.
I have already demonstrated several other subtle and unique things but the
gotos 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 diff --git a/2024/ferguson1/obfuscation.md b/2024/ferguson1/obfuscation.md index 2663455cf..47e73c308 100644 --- a/2024/ferguson1/obfuscation.md +++ b/2024/ferguson1/obfuscation.md @@ -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 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 -cpp at 116 and after the cpp is through I beat it by **110** MORE (!!), **AT -134!** Yes, you read that right. 134 `goto`s! I even went further in an alt -version, where before the cpp it was 131 `goto`s and after the cpp 149 (!!) -`goto`s. I didn't do this in the main entry for practical reasons but I wish I -had. +Here's the horrifying and hilarious truth: I beat it out by92107 +MORE, **BEFORE** the cpp at116131 and after the cpp is through I +beat it by **125** MORE (!!), **AT 149!** Yes, you read that right. +134149 `goto`s! The originally submitted prog.c, submitted for +practical reasons only, had it at, as might be guessed, 116/134 before and after +the cpp. -Even removing what I think are the only dead `goto`s, two of them, including one -that is in the `w()` macro that would be translated into more, I beat it by 90 -more, at 114 before the cpp, and 99 more after the cpp, at 123! +Even removing what I think were the only dead `goto`s in the incomplete version, +two of them, including one that is in the `w()` macro that would be translated +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 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. 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. -YES I think it's HILARIOUS. But if it was not for the IOCCC... Well, as I -mention in my [remarks above](#devil), EVEN ONE IS TOO MANY +116/134131/149 `goto`s, depending on if you pre-process it or not! +YES I might be mad. YES I think it's HILARIOUS. But if it was not for the +IOCCC... Well, as I mention in my [remarks above](#devil), EVEN ONE IS TOO MANY in real code. 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, 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 -total of **985** (!) line changes, counting function calls. In `main()` itself -the line changed a total of **776** (!) times! +lines of code) the program has just 58 lines and in a single run there were a +total of **1416** (!) line changes, counting function calls. In `main()` itself +the line changed a total of **1131** (!) times! 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) -actually introduced a security hole from ONE `goto`. Yet I have 116/134 and it -actually works? That is surely obscene. And beautiful. +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/134131/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, -though I'm not really sure why. In any case, I not only have dethroned `hines` -(sorry ...but also not sorry!) but I have, as noted already, beaten the original -BASIC game by **7** more `goto`s at 116 before the cpp and **25 MORE** after the -cpp, at 134! +Oh and BTW: it appears that `hines` is a bit confused about my entry, though I'm +not really sure why. In any case, I not only have dethroned `hines` (sorry +...but also not sorry!) but I have, as noted already, beaten the original BASIC +game by722 more `goto`s at116131 before the cpp +and**18 MORE****40 MORE** after the cpp, at 149! -It's almost impossible to add more `goto`s. 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. +It's almost impossible to add more `goto`s. With the iocccsize it is impossible, +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. 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 @@ -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 is in all the wrong places. -This is not counting other cool things like a single `char *` holding near -200 `char *`s. No. I do not mean an array of `char *`s! I mean a single flat -`char *`! Yet in the code I index it AS IF it's a `char *[]`, just to add to -the confusion (as if the 134 `goto`s are not bad enough). But it's not a `char -*[]`. It's a single `char *`, which is the contents of the data file. +This is not counting other cool things like a single `char *` holding near 200 +`char *`s. No. I do not mean an array of `char *`s! I mean a single flat `char +*`! Yet in the code I index it AS IF it's a `char *[]`, just to add to the +confusion (as if the134149 `goto`s are not bad enough). But it's +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. @@ -167,20 +171,21 @@ Hilarious. 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 -relatively short program to have 116 `goto`s or more when filtered through `cc --E` (134!), wouldn't you say? If that's NOT too many, then I ask you WHAT IS? +relatively short program to have116131 `goto`s or more when +filtered through `cc -E` (134149!), 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 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 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), -as well as mentioning that there are other events -besides those 23. I certainly will not reveal all though. The humour and jokes -sections of that file says more but the concluding remarks are for a summary and -why I think that this code is worthy of the contest AND also pointing out the -folly of `goto`. +I discuss this some in my concluding [remarks above](#devil), as well as +mentioning that there are other events besides those 23. I certainly will not +reveal all though. The humour and jokes sections of that file says more but the +concluding remarks are for a summary and why I think that this code is worthy of +the contest AND also pointing out the folly of `goto`. In this file I will discuss how some events actually are polymorphic, in a 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 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 + 294 semicolon + 138 colons 50 if 11 else 4 while @@ -243,7 +308,6 @@ horrified, if you're not already: 1 int 1 char 1 size_t - 1 FILE Ratio: 0.83 gotos per keyword ``` @@ -252,6 +316,8 @@ And the pre-processed one: ``` 134 goto + 332 semicolon + 138 colons 50 if 11 else 8 while @@ -270,16 +336,11 @@ And the pre-processed one: 1 int 1 char 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 -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. +Look at those ratios. This is not right. 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 @@ -414,7 +475,8 @@ it. 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 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 have116131 before the cpp and134149 +(!!) after the cpp. 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 @@ -600,6 +662,9 @@ As I commented in the commented.c: * 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 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 @@ -1620,32 +1685,35 @@ padding? 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 odd looking compound literal, the maze of `goto`s (116 or 1134 depending on -if you pre-process the code), the bastardised Duff's device, the strange labels -inside `switch()`s, the jumping into and out of `switch()`s only to jump back in -(or out), the for loops split across several parts of the code (one making it -look like variables are uninitialised), if/else code being swapped in location -(or moved to other parts of the code, even in what would otherwise be dead code, -including possibly this for for loops), the fall through of a label to a goto -that jumps back to right before that fall through just to exit the game (isn't -that so cute?), the fact I had to write all those tools to verify things are -okay (showing how messed up it is), different blocks that have code that simply -should not be there, the nested ternary operators... +the odd looking compound literal, the maze of `goto`s (116131 or +134149 depending on if you pre-process the code), the bastardised +Duff's device, the strange labels inside `switch()`s, the jumping into and out +of `switch()`s only to jump back in (or out), the for loops split across several +parts of the code (one making it look like variables are uninitialised), if/else +code being swapped in location (or moved to other parts of the code, even in +what would otherwise be dead code, including possibly this for for loops), the +fall through of a label to a goto that jumps back to right before that fall +through just to exit the game (isn't that so cute?), the fact I had to write all +those tools to verify things are okay (showing how messed up it is), different +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 -impossible to add more spaghetti to the pot without it overflowing, and I do not +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 didn't 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 -reached the latter. +much spaghetti that it's wasted, if it can even be cooked. I believed I reached +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 -be done, even if it was possible to maintain this huge platter of delicious -spaghetti without gaining fifty kilograms. Besides, I don't want to see -spaghetti EVER AGAIN!! I've had enough of it for a lifetime! Okay, that's not -really true...it DOES sound good but I won't likely be having it for a while. -Can you actually blame me though? This spaghetti almost strangled me to death, -like it did the Devil (I provided photographic proof of this earlier if you -missed that). +But let's say I had more space with iocccsize: do you REALLY expect me to add +more spaghetti? There isn't anything that could be done, even if it was possible +to maintain this huge platter of delicious spaghetti without gaining fifty +kilograms. Besides, I don't want to see spaghetti EVER AGAIN!! I've had enough +of it for a lifetime! Okay, that's not really true...it DOES sound good but I +won't likely be having it for a while. Can you actually blame me though? This +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. 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 diff --git a/2024/ferguson1/printer.c b/2024/ferguson1/printer.c index 6e947d13b..926451dad 100644 --- a/2024/ferguson1/printer.c +++ b/2024/ferguson1/printer.c @@ -9,16 +9,6 @@ * 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 * 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#include @@ -32,7 +22,6 @@ */ #define Z(x) (x)*BLOCKSIZE #define V(x) puts(&y[Z(x)]); -static char *p; static char *y; static char *filename = "data"; static size_t len; diff --git a/2024/ferguson1/prog.goto.max.c b/2024/ferguson1/prog.alt2.c similarity index 66% rename from 2024/ferguson1/prog.goto.max.c rename to 2024/ferguson1/prog.alt2.c index 28edc5aa5..2f70abddf 100644 --- a/2024/ferguson1/prog.goto.max.c +++ b/2024/ferguson1/prog.alt2.c @@ -18,13 +18,13 @@ 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) + 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; + goto OO; yy: +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:; } 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] > 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; -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; +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; +} 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 >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)) -{ 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 + 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 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; 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 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 :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 +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 :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); + } 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 - 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 _; + 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; +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 _; } } diff --git a/2024/ferguson1/prog.c b/2024/ferguson1/prog.c index f2b5d7363..d310f86ed 100644 --- a/2024/ferguson1/prog.c +++ b/2024/ferguson1/prog.c @@ -18,68 +18,51 @@ 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) + 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 OO; yy: -do{ if(b<1||M<0||M>2169){ break; F:V(51); R+=18; goto L; } goto i; - + 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 +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 +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( - + =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; + 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 { 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; -} 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 +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,23)) -{ case 1:V(95); R+=5; break; case 18:V(26); goto Z; case 13:V(28); break; -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; o:; } else + 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); 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 :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 +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){ 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 - +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 - +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); 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 - 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; -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 _; -} -} + } 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 _; +} }