20th IOCCC Source Code Released
An anonymous reader writes "The 20th International Obfuscated C Code Contest apparently has the turbo button pressed, as the source code has been published in only two months, versus almost four years of the 19th contest. As we discussed in February, the judges' verdicts are in: the Best of Show entry comes from Don Yang with a program containing more programs. Some other entries winning this year are a text raytracer (used this year in IOCCC logo), a MOD player, a X11-based dual player tank shooter and a bouncing ball (Amiga-style) with ANSI escape sequences. Remember that every IOCCC entry has a limit of 4 kilobytes, so indeed every one is pretty impresive."
I always thought that the Underhanded C Contest was better. Rather than making the code hard to read or doing the odd layout, I think it is better to show people that malicious things can be hidden in even the most readable code. People always worry about malice hidden in the long unreadable stuff, but can you find the problem in this?
My favorite is still from 1987 by David Korn. Short, sweet, not arranged in a silly picture, not obscure due to lack of indenting or white space, and seems to exemplify the spirit of obfuscated C. Though it does have portability issues and intended for older compilers (try to figure out before compiling as compiler messages will give a huge hint).
main() { printf(&unix["\021%six\012\0"],(unix)["have"]+"fun"-0x60);}
I've always been tempted to give this as a question during interviews.
Weren't they actually underclock switches to maintain compatibility with older software that relied on the processor's clock for timing,
Yup, that's what they were. The original PC had a hardware timer (an 8253 IIRC), but all available counters were used for timekeeping interrupts, sound generation and the like. Many programs (especially games) used software loops to generate timing, assuming the clock ran at the original IBM PC's 4.77 MHz. When the 80286-based /AT was introduced, those programs become unusable. To preserve some compatibility, manufacturers introduced the "turbo" button, whose purpose was actually to slow down the machine close to the original PC speed. This button remained a feature on cases for years, even though it often wasn't even connected to anything anymore.