This is my second of two winning entries in 2024 IOCCC (28th). This
one took much less time than the other one. What was most special to me
is that Landon said the IOCCC is honoured to present this entry! It's
also noted that this entry in turns honours the Navajo Code Talkers -
who deserve a great deal of respect.
The judges did something really cool this time - a video showing all
the entries. Although I think YouTube ads ruin things I'll link to it
anyway as I know Landon will appreciate it. One could always download it
if they wished to not be interrupted:
IOCCC Prize in yil-tas - Navajo Code Talkers translator.
A few comments of interest, fewer than the Oregon Trail parody one.
This code is also quite twisted. All (or if not all then almost all)
the functions take a single parameter: a struct a *. They
also return a char *. These facts might not seem very
significant but they're quite significant.
The reason the functions are the same signature is so they can be in
a function pointer array (and as I recall that is inside the same
struct). The char * return also acts as an int in some
cases. I don't think I need to explain how this would work. But what is
really sneaky is that each function is called by an anonymous struct.
This means that I can have a different order of the array in each
function, so that in one function the first element of the function
pointer array might be one function but in the others it is something
else entirely! There are a lot of other extremely twisted things. There
is even code I cannot myself untangle.
Did you know you can do maths on strings? It's kind of cheating but
it's possible. For instance, what does:
c = calloc(1**"0"-47, sizeof *c) do? Or what about:
F((c=((~~!!~!9u|2**"9"-15u/
*"0"-2u)<<~~!~!~9u),c&=9u,&(struct a){ .l=1, .s=a[c],.v= { &w, &w } } ));
?
Okay so there is more to that line but I refer to the arithmetic
parts. There is code that looks wrong but is not. It looks like it will
go out of bounds but if you 'fix' it it will actually then go out of
bounds. Here's another fun one: s=z+-*"1"-*"1"-
-97,L=putchar(!s&&isupper(a->x[0**"z"])?a->a->c[s]:tolower(a->a->c[s]));.
One more and then you'll have to see for yourself: for (z = 2/
*"z", s=1+0**"1"; z[a->x]; ++z). The hilarious thing about
this one is if you remove one of the spaces it turns the code into a
comment! That means a beautifier has to be very careful lest it destroy
the code!
I did try explaining the code but a lot of it I could not do very
easily. Some code I tried to decouple and I could not do it. If one
wishes to see that commented code:
deobfus.c.