Slashdot Mirror


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."

12 of 46 comments (clear)

  1. Winners link by SimonCooper · · Score: 5, Informative

    The link to the winners and descriptions is, http://www.ioccc.org/2011/whowon.html

  2. Re:Poop by Anonymous Coward · · Score: 5, Funny

    I eat poop.

    This is about C coding.
    Relating your experience coding Java is irrelevant.

  3. Turbo button? by McGregorMortis · · Score: 3, Funny

    Your age is showing...

    Yes, kids, PCs used to have turbo buttons.

    1. Re:Turbo button? by ericloewe · · Score: 3, Informative

      Weren't they actually underclock switches to maintain compatibility with older software that relied on the processor's clock for timing, the "turbo" being a marketing gimmick to make it sound faster?

    2. Re:Turbo button? by gl4ss · · Score: 2

      it was pretty handy for che.. creative playing. you know, like in star control 2 doing the lander resource gatherings.

      --
      world was created 5 seconds before this post as it is.
    3. Re:Turbo button? by ChatHuant · · Score: 3, Interesting

      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.

    4. Re:Turbo button? by jones_supa · · Score: 2

      The CPUID Wikipedia page seems to have a listing of them.

  4. UCC is better by Anonymous Coward · · Score: 2, Interesting

    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?

  5. Re:the true obfuscation by johanwanderer · · Score: 2

    Notepad was never intended to be a source code editor. To really mess things up, use Wordpad instead.

  6. Favorite by Darinbob · · Score: 4, Interesting

    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.

    1. Re:Favorite by don.g · · Score: 2

      The only thing that threw me is that "unix" symbol. cpp says it's "1" -- I assume it's one of those #defines to let you know what platform you're on.

      *** SPOILER ALERT ***

      After that it's easy -- obvious principle at work is that a[b] is equivalent to *(a+b).

      --
      Pretend that something especially witty is here. Thanks.
    2. Re:Favorite by Darinbob · · Score: 2

      You don't pass/fail interviewees on this. But the interviewee should at least ask "what is the value of this variable, I don't see it defined?". Then the task is whether they realize that a[const] is same as const[a], or can ask an intelligent question about that. I've never actually done stuff like this on interviews. As time goes on I keep simplifying my questions because so many only know C or C++ superficially (even if it's on their resume).