diff --git a/2024/ferguson1/.entry.json b/2024/ferguson1/.entry.json index ca541a256..8957547e4 100644 --- a/2024/ferguson1/.entry.json +++ b/2024/ferguson1/.entry.json @@ -37,6 +37,14 @@ "display_via_github" : true, "entry_text" : "alternate source code" }, + { + "file_path" : "prog.goto.max.c", + "inventory_order" : 40, + "OK_to_edit" : true, + "display_as" : "c", + "display_via_github" : true, + "entry_text" : "entry source code with maxed out gotos" + }, { "file_path" : "prog.orig.c", "inventory_order" : 50, @@ -102,12 +110,20 @@ "entry_text" : "hints on how to deobfuscate" }, { - "file_path" : "gotos.txt", + "file_path" : "gotos.c.txt", "inventory_order" : 100, "OK_to_edit" : true, "display_as" : "text", "display_via_github" : true, - "entry_text" : "text file showing all the line changes in a run" + "entry_text" : "text file showing only the gotos in the entry code" + }, + { + "file_path" : "jumps.txt", + "inventory_order" : 100, + "OK_to_edit" : true, + "display_as" : "text", + "display_via_github" : true, + "entry_text" : "text file showing all the line changes in a single run" }, { "file_path" : "lencount.c", diff --git a/2024/ferguson1/.gitignore b/2024/ferguson1/.gitignore index e04469a91..551096ebd 100644 --- a/2024/ferguson1/.gitignore +++ b/2024/ferguson1/.gitignore @@ -20,4 +20,7 @@ printer 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 234d2d9ae..1528d00f3 100644 --- a/2024/ferguson1/Makefile +++ b/2024/ferguson1/Makefile @@ -154,8 +154,10 @@ 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 -ALT_TARGET= ${PROG}.alt ${PROG}.alt.asc ${PROG}.alt.scrnshot +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 # list any data files supplied with the submission # @@ -350,12 +352,30 @@ ${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 # ${PROG}.alt.scrnshot: ${PROG}.alt.c ${MAKE} padding ${CC} ${CFLAGS} -DDATA='"data.scrnshot"' ${PROG}.alt.c -o $@ ${LDFLAGS} +# goto maxed out - screenshot friendly version +# +${PROG}.goto.max.scrnshot: ${PROG}.goto.max.c + ${MAKE} padding + ${CC} ${CFLAGS} -DDATA='"data.scrnshot"' ${PROG}.goto.max.c -o $@ ${LDFLAGS} + # data files # data: ${DATA} diff --git a/2024/ferguson1/README.md b/2024/ferguson1/README.md index eaa28b6b1..c8622d77f 100644 --- a/2024/ferguson1/README.md +++ b/2024/ferguson1/README.md @@ -2455,11 +2455,15 @@ 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 `goto`s. As you find out in [obfuscation.html](obfuscation.html) it's -134 after pre-processing! 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 confusion? If that includes one that the compiler -misses that's even better! +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 +confusion? If that includes one that the compiler misses that's even better! It is **NOT** a bug where in the inner switch there is a missing case. That is done because I do not want it to always trigger. That is the one that is in a @@ -3017,7 +3021,12 @@ 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 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. +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 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: @@ -3257,7 +3266,7 @@ Except on the Oregon Trail. I was right too: the entire game is worse, far far worse. After this won I did a full sequence. This is from start to finish and I include it for your amusement -(see [gotos.txt](gotos.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 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 diff --git a/2024/ferguson1/gotos.c.txt b/2024/ferguson1/gotos.c.txt new file mode 100644 index 000000000..3d2b13bc4 --- /dev/null +++ b/2024/ferguson1/gotos.c.txt @@ -0,0 +1,134 @@ + goto A; + goto f; + goto PP; + goto hell; + goto M; + goto hell; + goto M; + goto G; + goto hell; + goto M; + goto hell; + goto M; + goto S; + goto hell; + goto M; + goto OO; + goto L; + goto i; + goto kk; + goto HA; + goto at; + goto I; + goto r; + goto II; + goto F; + goto c; + goto zz; + goto qq; + goto C; + goto N; + goto dd; + goto jj; + goto oo; + goto ee; + goto x; + goto heaven; + goto XT; + goto ET; + goto v; + goto x; + goto v; + goto ZZ; + goto bb; + goto s; + goto X; + goto v; + goto T; + goto y; + goto E; + goto d; + goto P; + goto to; + goto y; + goto TA; + goto BB; + goto LL; + goto uu; + goto JJ; + goto B; + goto h; + goto l; + goto e; + goto hell; + goto M; + goto Y; + goto P; + goto K; + goto tt; + goto Z; + goto W; + goto ha; + goto D; + goto m; + goto Z; + goto H; + goto Z; + goto g; + goto Z; + goto Z; + goto Z; + goto Y; + goto MM; + goto hell; + goto M; + goto J; + 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 k; + goto hell; + goto M; + goto M; + goto yy; + goto Z; + goto rr; + goto hell; + goto M; + goto a; + goto Z; + goto Z; + goto Z; + goto go; + goto ii; + goto o; + goto V; + goto Z; + goto Y; + goto O; + goto W; + goto b; + goto n; + goto p; + goto x; + goto j; + goto n; + goto R; + goto t; + goto n; + goto u; + goto w; + goto _; diff --git a/2024/ferguson1/index.html b/2024/ferguson1/index.html index 24da10042..008d95bf5 100644 --- a/2024/ferguson1/index.html +++ b/2024/ferguson1/index.html @@ -2450,11 +2450,14 @@ 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 gotos. As you find out in obfuscation.html it’s -134 after pre-processing! 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 confusion? If that includes one that the compiler -misses that’s even better!

+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 +confusion? If that includes one that the compiler misses that’s even better!

It is NOT a bug where in the inner switch there is a missing case. That is done because I do not want it to always trigger. That is the one that is in a sense polymorphic. One of the events is actually immediate death, in particular @@ -2897,7 +2900,12 @@ I mentioned in obfuscation.html (and some briefly 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.

+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 extra gotos) but now that it’s in I have no qualms about providing it as +alt code: if I am going to ruin gotos I might as well do it properly.

Some things are clear about the program from visual inspection: