2004 IOCCC Winners Source Code Released
Langly writes "The IOCCC have finally released their source code for 2004.
My thoughts goes out to the poor guys that actually wrote this code.
Reader discretion is advised." Every time I see an obfuscated code contest, I wonder if 'Winner' is the right word to describe the victor ;)
Google cache with different mirrors across the globe: http://64.233.167.104/search?q=cache:LAIfxt7dfOEJ: www.ioccc.org/+ioccc&hl=en
International Obfuscated C Code Contest (I think).
This groups releases a challenge each year that the entrants have to solve using the most obfuscated C code possible. They judge tne entries and award prizes to the best of the worst. Previous entries have used the precompiler to do much of the work, eliminated brackets and spaces, hacked the stack, and generally used many other tricks to complete the challenge.
- "Nobody came out that night, not one was ever seen. But Old Man Stauf is waiting there, crazy sick and mean!"
Asia
Australia and other Pacific
Europe
North America
There are several mirrors. I know, I run one of them. Why the submitter hardcoded the us one is beyond me.
none yet
none
SETI is looking for some sites
none
http://www.de.ioccc.org/years.html#2004
also tw, au, es, www1.us
CC.
TaijiQuan (Huang, 5 loosenings)
Various standard C library functions are known to the compiler, and the compiler is allowed to optimise them. For example, here's a little trick. If you compile:
printf("Hello\n");
With max opt, GCC will convert it into:
puts("Hello");
How cool is that? You've saved one byte in your string and called a much quicker/smaller function!
HERE
This has nothing to do with C89 or C99. The only standard-compliant forms of main are those that return 'int', regardless of which C standard you are talking about. Also, the -std argument to gcc is not sufficient to make it a standard C compiler. RTFM.
The gcc manual also says:
So this is not a perfect way of checking compliance, but it is usually fairly good.
For GCC, at least, the entry point as far as Linux is concerned is _init, defined in /usr/lib/crti.o.
_init opens the standard file descriptors, gathers the command line arguments and does a but of housekeeping before calling main, your program's entry point. GCC links to this by default; but you can change this if necessary, for instance an embedded project running without an OS would need very different initialization code, and for that matter it could define the entry point of the application as something other than main().
If you want to see what GCC is doing for a compilation, try
gcc =### x.c
And you'll be able to see what gcc passes to the underlying tools to pre-process, compile, assemble and link.
I only looked at the first entry, anonymous.c. It's 47 utterly incomprehensible lines. What it does is convert text into one of Tolkien's Elvish fonts
I was fairly impressed with Gavin.c. It's 165 lines of nicely indented/formatted C code that's pretty much incomprehensible. What does it do? It's a 32 bit multitasking operating system complete with a GUI, a shell, and a text viewer called vi.
Or perhaps Vik1.c - 63 lines (including a comment
Not bad for 63 lines of C code.
Jedidiah.
Craft Beer Programming T-shirts
Well, then you should know that Larry Wall was a winner of the IOCCC in 1987.
We are Turing O-Machines. The Oracle is out there.