Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Programming

20th IOCCC Source Code Released 46

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."
This discussion has been archived. No new comments can be posted.

20th IOCCC Source Code Released

Comments Filter:
  • Winners link (Score:5, Informative)

    by SimonCooper ( 638013 ) <ea_slashdot@sfik.com> on Monday April 23, 2012 @03:44PM (#39774987) Homepage
    The link to the winners and descriptions is, http://www.ioccc.org/2011/whowon.html [ioccc.org]
  • by McGregorMortis ( 536146 ) on Monday April 23, 2012 @03:59PM (#39775105)

    Your age is showing...

    Yes, kids, PCs used to have turbo buttons.

    • Re:Turbo button? (Score:4, Informative)

      by ericloewe ( 2129490 ) on Monday April 23, 2012 @04:03PM (#39775155)

      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?

      • Your guess is as good as mine; I've never seen a turbo button that was wired up to anything!
        (Pipe down, grandad. I'm not on your lawn.)
        • by gl4ss ( 559668 )

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

      • by Anonymous Coward

        Yes. The "turbo" button, when on, would run the processor at full speed or allow caching. The Wikipedia article [wikipedia.org] mentions that exceptions exist, but did not mention any. I think the reason is that people would start some programs and go "Whoa! This is running too fast," and then hit the turbo button to try and get it to run normally. None of my computers had one, but I don't know if I would actually run a computer like that.

        Interestingly, one of my uncles had a computer that had one and always had it se

        • Comment removed based on user account deletion
        • My family's first computer was a 25mhz 486sx.

          Running North & South at 25 made it exceedingly hard to do anything at all due to the speed of everything.

          Turning off the 'turbo' button slowed it down to 10mhz and made it playable.

          • by celle ( 906675 )

            I had a 50Mhz DX back then(early ninties), with turbo off down to 25Mhz. Made "blip to death" in fighter mode on Wing Commander down to "warp speed to death" with the turbo off. Another great game bit the dust as I had sold my earlier rig to pay for the DX. I still have my copy of WC in my basement somewhere too.

      • by Anonymous Coward

        The turbo button on my Cyrix-based machine disabled a cache.

        The best thing about the machine was the /proc/cpuinfo reported "CyrixInstead" rather than "IntelInside".

        • by tlhIngan ( 30335 )

          The best thing about the machine was the /proc/cpuinfo reported "CyrixInstead" rather than "IntelInside".

          Actually, it's 12 characters long - 3 registers.

          Intels report "GenuineIntel"
          AMDs report "AuthenticAMD"
          Vias say "CentaurHauls"

          I don't remember what the other x86-clones report.

      • Re:Turbo button? (Score:4, Interesting)

        by ChatHuant ( 801522 ) on Monday April 23, 2012 @05:17PM (#39776025)

        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.

        • ... and there still were utilities (I remember 'goslow' and 'slow') you could use to slow down the PC even more if the turbo button was not enough. On my PC depressing turbo slowed it from 20 MHz to 10 MHz, but if you wanted to play old XT (4.77 MHz) games ('sopwith', anyone?), you could run these.

          My CS teacher used to turn turbo off by default 'so that all those outputs would not flash in front of her eyes so blazingly fast'.
      • by Nimey ( 114278 )

        Yep. The only machine I ever had with a turbo button read its state at boot time and then ignored it if you pressed it again before rebooting. This machine (a Pentium 90) has a mini Linux distribution on it, so booting the thing with it enabled is... boring.

        I believe the goal of most turbo buttons was to approximate the speed of an 8 MHz 80286. I don't know why this was chosen instead of a 4.77 MHz 8088; maybe it was easier to simulate the speed of something faster.

  • UCC is better (Score:2, Interesting)

    by Anonymous Coward

    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? [notanumber.net]

  • The true obfuscation is that Chrome will not display .c files, but forces you to save it.

    Then, if you open it in Notepad, it will show it all as one line, so you can't see whats going on.

    Pure genius.

    • Notepad was never intended to be a source code editor. To really mess things up, use Wordpad instead.
    • by gl4ss ( 559668 )

      The true obfuscation is that Chrome will not display .c files, but forces you to save it.

      Then, if you open it in Notepad, it will show it all as one line, so you can't see whats going on.

      Pure genius.

      it's just their mimetypes. ie and firefox do the same thing. if you had opened the .c file in IE, it would show the source as intended. silly, huh?

    • Comment removed based on user account deletion
      • by Hatta ( 162192 )

        There's an add-on for that. I'm running "Open In Browser 1.11" on Firefox 10.0.3. Works great.

  • Comment removed (Score:5, Interesting)

    by account_deleted ( 4530225 ) on Monday April 23, 2012 @04:53PM (#39775745)
    Comment removed based on user account deletion
    • That one works with K&R C. It won't work with C90 or later.
      Can you tell why not?

      I should also note that Daniel Ireland's explanation of why/how it works is incorrect.
      Do you know what is wrong with the explanation?
      How does it actually work?

      That is still one of the best, because all the assumptions it relies upon were valid at the time it was written.
    • by don.g ( 6394 )

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

    • by Bomazi ( 1875554 )

      I don't like this because it depends on knowing an obscure trivia (i.e. that unix == 1) that is not in ISO C and totally useless. An interviewee shouldn't fail because of that.

Hackers are just a migratory lifeform with a tropism for computers.

Working...