http://en.wikipedia.org/wiki/IOCCC
Some of that code probably belongs more in /ascii/ than a compiler.
Discuss.
I have, but then I see the damn things people have done, and I don't feel like I have any chance to keep up.
Like the program that does three different things when compiled normally, or compiled with lines in reverse order, or compiled with the lines alphabetically sorted. In addition, it can reverse and sort lines itself.
One of my favourites (because I can almost understand it), is the program that uses a bunch of (of course, slightly incorrect) #define
s to let the author write in pseudocode, and them implements a prime number searcher in this pseudocode, except of course when compiled the program does something else entirely.
IOCCC competitors are just plain nuts.
But they probably would make the best C compiler writers. They can make C breakdance on a pin while half-asleep. Truely amazing stuff.
They should call it the IOCPPTC.
Intenationally Obfuscated using C Pre Processor Tricks Contest.
cpp is a macro language... and thus allows one to write self-modifying code, in effect.
This where all the complexity and genius comes into play. But remember kids, it's all the CPP, not the compiler that makes it possible.
No, CPP tricks are considered pretty lame in the IOCCC. Old entries used them quite a bit, but it's quickly fallen out of fashion.
Errr...
Almost every example I see uses "#define" somewhere.
That's CPP.
Sure, people do a bit of #defineing, but few new entries are built entirely around #define tricks. The obfuscation usually goes far deeper than that.