Stories
Slash Boxes
Comments

SoylentNews is people

posted by martyb on Monday May 07 2018, @01:44PM   Printer-friendly
from the do-you-see-what-I-did-there? dept.

The International Obfuscated C Code Contest (IOCCC) has now posted the winning entries from its 25th event. The summary of winning entries does NOT contain brief explanations of each winning entry, so you can try to spot the tricks yourself. If you don't mind seeing a brief summary of each entry, there is an alternate page with spoilers linked to from the main page.

The goals of the IOCCC are to write the most Obscure/Obfuscated C program within the contest's rules, while showing the importance of programming style, in an ironic way. It stresses the C compilers with unusual code and illustrates some of the subtleties of the C language. Lastly it provides a safe forum for poor C code.


Original Submission

This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
(1)
  • (Score: 4, Funny) by Snotnose on Monday May 07 2018, @01:50PM (10 children)

    by Snotnose (1623) on Monday May 07 2018, @01:50PM (#676640)

    I'd have said the site was slashdotted. Now it's, what, soyled?

    Whatever, it's not responding.

    --
    When the dust settled America realized it was saved by a porn star.
    • (Score: 2, Informative) by Anonymous Coward on Monday May 07 2018, @01:56PM

      by Anonymous Coward on Monday May 07 2018, @01:56PM (#676643)
    • (Score: 0) by Anonymous Coward on Monday May 07 2018, @01:58PM (4 children)

      by Anonymous Coward on Monday May 07 2018, @01:58PM (#676644)

      Perhaps it was, as your subject suggests, “years ago”, but I just downloaded from http://www.ioccc.org/years.html#2018 [ioccc.org] (such as the tarball from http://www.ioccc.org/2018/2018.tar.bz2 [ioccc.org] ) and it worked fine.

      • (Score: 2) by Snotnose on Monday May 07 2018, @02:25PM (3 children)

        by Snotnose (1623) on Monday May 07 2018, @02:25PM (#676650)

        Nope, site still times out. Maybe it's a California thing.

        --
        When the dust settled America realized it was saved by a porn star.
        • (Score: 0) by Anonymous Coward on Monday May 07 2018, @02:27PM

          by Anonymous Coward on Monday May 07 2018, @02:27PM (#676652)

          Only if California recently emigrated to Europe... Because it's not really working here either.

        • (Score: 0) by Anonymous Coward on Monday May 07 2018, @06:53PM (1 child)

          by Anonymous Coward on Monday May 07 2018, @06:53PM (#676737)

          Site works fine for me. Just downloaded http://www.ioccc.org/2018/2018.tar.bz2 [ioccc.org] and while it took 10 seconds to download about 3.4 MB, it download just fine. I went to a new York site and downloaded from that host and it took 8 seconds. I went to our UK office, 9 seconds. From Paris, 10 seconds.

          Maybe the problem is your network? Maybe "net neutrality" is impacting you? :-)

          • (Score: 2) by Gaaark on Monday May 07 2018, @10:12PM

            by Gaaark (41) on Monday May 07 2018, @10:12PM (#676807) Journal

            Shit! You da Flash?

            Man you gets around!

            --
            --- Please remind me if I haven't been civil to you: I'm channeling MDC. ---Gaaark 2.0 ---
    • (Score: 0) by Anonymous Coward on Monday May 07 2018, @02:26PM

      by Anonymous Coward on Monday May 07 2018, @02:26PM (#676651)

      Yeah, the word is "soyled", though I doubt there are enough Soylentils to bring down the IOCCC by ourselves :) Instead, it was "hugged to death" - I just saw the link posted on the HN frontpage [ycombinator.com] an hour or two ago (#1 then, #6 now), and it was already unavailable then.

    • (Score: 0) by Anonymous Coward on Monday May 07 2018, @02:58PM (1 child)

      by Anonymous Coward on Monday May 07 2018, @02:58PM (#676660)

      I love "Soyled!"

      • (Score: 0) by Anonymous Coward on Monday May 07 2018, @03:05PM

        by Anonymous Coward on Monday May 07 2018, @03:05PM (#676664)

        you would . . .

    • (Score: 3, Funny) by RS3 on Monday May 07 2018, @04:23PM

      by RS3 (6367) on Monday May 07 2018, @04:23PM (#676681)

      I'd have said the site was slashdotted...

      Hey now, no need for that surly language here.

  • (Score: 4, Funny) by The Mighty Buzzard on Monday May 07 2018, @04:23PM (8 children)

    Most all of my C is naturally obfuscated. Sometimes I'm so good at it that even I can't read it the very next day.

    --
    My rights don't end where your fear begins.
    • (Score: 2) by bob_super on Monday May 07 2018, @05:30PM (6 children)

      by bob_super (1357) on Monday May 07 2018, @05:30PM (#676696)

      I've actually had to threaten to fire a guy who used acronyms for all his variables, and never wrote a line of comment. His stuff was working, but was unmaintainable, maybe not even by him.
      He was nice enough to find somewhere else to be.

      • (Score: 0) by Anonymous Coward on Monday May 07 2018, @06:15PM (1 child)

        by Anonymous Coward on Monday May 07 2018, @06:15PM (#676719)

        Gotta save those bytes man!

        I have never found typing speed to be the bottle neck, so I try and keep my variables reasonably descriptive.

        • (Score: 1) by redneckmother on Monday May 07 2018, @06:36PM

          by redneckmother (3597) on Monday May 07 2018, @06:36PM (#676729)

          (See a porting project description below)

          I'm not much of a typist (school of seek and ye shall find), so I employ "search and replace" to improve function / procedure / variable / parameter names... I usually start out with some funky short string as a name, then s/r to a descriptive one. Sheesh, modern editors - who'd a thunk it?

          After much wailing and gnashing of teeth, I converted a coworker to using the same technique - he had been partial to using variable / parameter names like "j1", "j2", etc. for both locals and globals. He also gained appreciation for documentation in comments. Oftentimes, comments explaining intent are helpful for identifying logic and coding errors.

          --
          Mas cerveza por favor.
      • (Score: 4, Interesting) by redneckmother on Monday May 07 2018, @06:21PM (3 children)

        by redneckmother (3597) on Monday May 07 2018, @06:21PM (#676721)

        Used to develop in assembly language - had a hard time deciphering some x86 source for a port to another device. The x86 author was steadfastly opposed to using comments, and was fond of saying, "Well, it's obvious what this routine does." Hell, even the name of the routine didn't come close to hinting the intent. The original source was heavily hand- optimized for both size and instruction cycle counts, sometimes using obscure register "side effects". Don't miss trying follow that dick's crap.

        The target device was proprietary, and the ported application was tested nightly (in Japan) during the project. The testers were VERY thorough, albeit not fluent in English ("Step 1: Press space key 512 time" ... "Step 49: Press Enter" ... "Error is occurred"). They uncovered some GLARING logic errors that existed in the x86 code, which I had faithfully ported. The lesson I learned is that, no matter how good the pay, a functional port from well documented code is a MUCH preferred task. And yes, I commented the crap out of my port.

        --
        Mas cerveza por favor.
        • (Score: 0, Disagree) by Anonymous Coward on Monday May 07 2018, @06:53PM (1 child)

          by Anonymous Coward on Monday May 07 2018, @06:53PM (#676738)

          optimized for both size and instruction cycle counts,

          Not possible.

          • (Score: 0) by Anonymous Coward on Monday May 07 2018, @07:14PM

            by Anonymous Coward on Monday May 07 2018, @07:14PM (#676756)

            Yes, it is. Less opcodes means (usually) less clock cycles.

        • (Score: 2) by jb on Tuesday May 08 2018, @07:26AM

          by jb (338) on Tuesday May 08 2018, @07:26AM (#676936)

          The x86 author was steadfastly opposed to using comments

          I've never understood that attitude.

          Surely assembly language (for any given target architecture) has got to be the language that encourages comments more than any other. After all, isn't that why the instructions are all so short -- so there's room left over for a comment on every line?

          The same held true even back when 40-column displays were a thing -- with 80+ cols to play with, there's really no excuse...

          On the other hand, I feel your pain with deciphering x86 code. That's one instruction set that seems to have been designed to discourage readability (which only makes good comments even more important...).

    • (Score: 2) by RS3 on Tuesday May 08 2018, @01:02AM

      by RS3 (6367) on Tuesday May 08 2018, @01:02AM (#676852)

      Most all of my C is naturally obfuscated.

      There's too much artificially obfuscated C. It's heartwarming that you're greening up the code and getting back to nature.

  • (Score: 1, Interesting) by Anonymous Coward on Monday May 07 2018, @07:14PM (4 children)

    by Anonymous Coward on Monday May 07 2018, @07:14PM (#676755)

    How about a Readable Code Contest? Take a specimen algorithm and the person/team who re-writes it in the most readable code form wins. You don't need to encourage coders to write obfuscated code; most do that naturally. That's like a "messy dorm contest".

    • (Score: 1, Interesting) by Anonymous Coward on Monday May 07 2018, @07:43PM (2 children)

      by Anonymous Coward on Monday May 07 2018, @07:43PM (#676761)

      As I understand the point is to hide the true behavior of your code to demonstrate how easy it is to hide malicious behavior, even from those with access to the source code.

      • (Score: 1, Informative) by Anonymous Coward on Monday May 07 2018, @08:28PM (1 child)

        by Anonymous Coward on Monday May 07 2018, @08:28PM (#676776)

        No, that's the Underhanded C Contest, this is the Obfuscated C Contest. Different beasts.

        • (Score: 1, Funny) by Anonymous Coward on Tuesday May 08 2018, @12:47AM

          by Anonymous Coward on Tuesday May 08 2018, @12:47AM (#676848)

          You are the winner of the Pedantic C Contest Identifying contest. Contrats, your prize is a day without off-by-ones!

    • (Score: 2) by jb on Tuesday May 08 2018, @07:32AM

      by jb (338) on Tuesday May 08 2018, @07:32AM (#676937)

      How about a Readable Code Contest? Take a specimen algorithm and the person/team who re-writes it in the most readable code form wins.

      That sounds like it would be too easy.

      To spice up the competition a bit, how about picking a sufficiently verbose target language (cobol perhaps?) and require that in addition to being readable for understanding, the code must be readable out loud in Iambic pentameter?

  • (Score: 2) by FatPhil on Tuesday May 08 2018, @08:01AM

    Complaining that most code is already ugly is missing the point. Most code is as buggy as fuck. These programs all work exactly to admittedly perverse designs.
    I've always liked one-liners, and burton1 is no exception - the expression mentioned in the hint was a real wtf-er. Endoh's a regular worthy winner, but I'm no fan of state-machine/interpreters/compressed data hidden in line-noise strings, and it seems both of his entries rely on that. endoh2, however, is hilarious, so also gets a big thumbs up. Hou is a wonderful piece of twisted-brain WTF, no idea what the preprocessor makes of it, as I don't have gcc's manpages to hand at the moment, and am lazy.

    Several of the entries were a bit sub-par. Relying on "I'm smart, and have derived a hard-to-understand algorithm" does not a great IOCCC entry make. I remember being able to remove about 50 non-whitespace bytes from a previous bellard entry, and this one looks similarly barely obfuscated, merely mangled. Ferguson, likewise, did little for me. I'm sure there was something just like poikala in the past, maybe even from another Finn. Yang even used his own source code as input to his program, a technique I find even cheaper than the compression/state-machine strings, despite it being a clever bundle of ideas.

    Other opinions are available, of course.
    --
    Great minds discuss ideas; average minds discuss events; small minds discuss people; the smallest discuss themselves
(1)