Slashdot Mirror


IOCCC 2006 is now open

leob writes "The 19th International Obfuscated C Code Contest opened one minute before the New Year to qualify for the 2006 designation. Entries accepted until the end of February. Start writing and submitting your entries now!"

76 comments

  1. On the other hand ... by Salvance · · Score: 2, Insightful

    They could always create an International Obfuscated AJAX competition, then every entrant could be a winner.

    Either I'm dumber than I had hoped, have worked with nimwitted programmers, or (much more likely) most AJAX implementations are just completely illogic to follow. When reviewing "Web 2.0" work, I often miss the logic and structure of C.

    --
    Crack - Free with every butt and set of boobs
    1. Re:On the other hand ... by Anonymous Coward · · Score: 0

      You're just trying to find a way to bash Microsoft (and you'll probably get modded up for doing so), but in all seriousness - does Microsoft do anything that is not closed source? You can bet that if they submitted code, it would be patented, trademarked, and copyrighted.

    2. Re:On the other hand ... by misleb · · Score: 2, Insightful

      AJAX is complicated by the fact that you are executing code in two places... the server and the client. And code is often mixed with HTML. How obfuscated it is (or seems) really depends on the framework you are using. If you're putting together an app/site with PHP and writing your own AJAX calls, it can get pretty hairy. But when using something like Ruby on Rails, it is pretty straight forward.

      -matthew

      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    3. Re:On the other hand ... by WhyDoYouWantToKnow · · Score: 1

      Not to mention the proprietary viewer required to view the code that can only be obtained by purchasing a complex, convoluted license that won't necessarily allow you to view the code intended to be viewed by the program. Said act of viewing the code with the program intended to view the code will, of course, violate a little known line in the DMCA that will invalidate the license.

      --
      "Oh drat these computers, they're so naughty and so complex. I could pinch them."
      Marvin the Martian
    4. Re:On the other hand ... by clydemaxwell · · Score: 1

      patented? is the code doing something new and revolutionary?
      trademarked? is the code a catchphrase, logo, or title?

      Okay, but you're right. It probably WOULD be copyrighted.

      --
      Browsing with classic discussion, noscript, at -1 and nested
      no hidden comments and I only mod UP
  2. Racist contest by fatnicky · · Score: 3, Funny

    I for one find it appalling that only C is allowed. What about Plus or Sharp? They have the same rights as the high and mighty C does. What this amounts to is pure and simple racism. This brings us right back to the coding rights movement of the 80's. I cannot believe we are still struggling.

    I'm so mad, I'm calling Jess-C Jackson. He'll get Al #ton on the phone as well.

    --
    Free childcare classifieds: www.carebrite.com
    1. Re:Racist contest by extern_void · · Score: 1

      Because these variants are already obfuscated by making no sense at all.

    2. Re:Racist contest by Dachannien · · Score: 2, Funny

      I was going to make a Johnnie Cochran joke, but I couldn't think of any programming languages that would make a good pun.

    3. Re:Racist contest by aquatone282 · · Score: 5, Funny

      If the compiler does not quit, you must commit?

      --
      What?
    4. Re:Racist contest by morgan_greywolf · · Score: 1

      I dunno. Maybe because it's the Obfuscated C contest, and not the Obfuscated C# or Obfuscated C++ contest? I mean really, C# and C++ are really completely different languages from C.

    5. Re:Racist contest by fatnicky · · Score: 1

      It was a joke dude.

      Do you C now?

      --
      Free childcare classifieds: www.carebrite.com
    6. Re:Racist contest by Anonymous Coward · · Score: 0

      The joke: ---->
      Your head: o

  3. Starting a minute before midnight by grahamsz · · Score: 4, Funny

    Having the 2006 competition run in 2007...

    It's like they are setting out to create a contest that is unclear and needlessly difficult to understand.

    1. Re:Starting a minute before midnight by extern_void · · Score: 1

      ahahah cool, so the obfuscation contest is obfuscated itself! What a goal!

    2. Re:Starting a minute before midnight by gkwok · · Score: 3, Funny

      Maybe they're using a 0-based year array.

    3. Re:Starting a minute before midnight by Da+Fokka · · Score: 1

      Maybe they're using a 0-based year array. So are we.
    4. Re:Starting a minute before midnight by Bastard+of+Subhumani · · Score: 1
      So are we.
      oy vey, you insensitive schlemiel!
      --
      Only three things are certain; death, taxes, and apocryphal quotations - Ben Franklin.
    5. Re:Starting a minute before midnight by hackstraw · · Score: 0, Redundant

      It's like they are setting out to create a contest that is unclear and needlessly difficult to understand.

      Specifically, what part of obfuscation is unclear an needlessly difficult for you to understand?

    6. Re:Starting a minute before midnight by quigonn · · Score: 1
      Maybe they're using a 0-based year array.
      So are we.

      No. The Gregorian calendar does not have a year zero.
      --
      A monkey is doing the real work for me.
    7. Re:Starting a minute before midnight by Anonymous Coward · · Score: 0

      It's like they are setting out to create a contest that is unclear and needlessly difficult to understand.

      Specifically, what part of obfuscation is unclear an needlessly difficult for you to understand? Probably nothing. On the other hand, you may wish to brush up on irony.
  4. It'll get better. by Anonymous Coward · · Score: 0

    AJAX is still a very immature technology. With some time, it will improve. The same is true for most technologies, including Java and .NET. What we're seeing with all of them is a move towards the capabilities of Lisp. That's not surprising, considering that Lisp is the mathematical underpinning of programmin language theory.

    The ideal situation would be for AJAX to ditch JavaScript and XML, and instead just use Common Lisp or Scheme as the language of choice, and s-exprs to represent the formatted data. Maybe it shouldn't really be called "AJAX" at that point, but the end result would still be superior to what we have to deal with now.

    When you build your technology upon proven and mathematically-inherent concepts such as those offered by Common Lisp, you end up with consistency, stability, sensibility and reliability. In short, your product improves greatly when you build upon a solid foundation of theory and practice. Common Lisp offers just that base.

    1. Re:It'll get better. by Da+Fokka · · Score: 1

      Don't get me wrong, I like LISP. But I think you just mentioned the one and only way in which AJAX code could become even less readable.

    2. Re:It'll get better. by Anonymous Coward · · Score: 1, Insightful

      Common Lisp or Scheme code is often only unreadable to people who have had their brains scrambled by languages like C, C++, Java, C# and VB. I was involved with a college class that taught Scheme to first-year business students. These students, many of whom had never written a program in their lives, picked up Scheme very quickly. I had helped with a similar Scheme course for third-year Comp. Sci. students, and a greater percentage of them had trouble adjusting to Scheme.

      After talking with some of the business students, they suggested that it was the syntax that made it so easy! The extreme consistency of s-expressions basically eliminates confusion. There's no question as to how to write a piece of code, as the steps to take are so very clear, and the code to write is basically self-evident.

      Some students did have trouble. But after talking with them, we found that it was usually because they had had some previous experience using languages like Perl, C or some sort of Basic. Such languages are consistently inconsistent, especially Perl, when it comes to syntax. So when somebody finally learns such languages, they actually find it far more difficult to go to a very consistent language, as all they are used to is inconsistency.

    3. Re:It'll get better. by Da+Fokka · · Score: 1

      Consistency is not a fixed property of a language. Consistency only exists in relation to the programming paradigm. For an object-oriented viewpoint, I think Java and C# are pretty consistent. If I need to specify an algorithm, I turn to something like LISP. the functional paradigm works very well there. But if I need to write a program for a client, I prefer the imperative/oo approach.

      I can believe that for simple programs, many people find functional languages quite intuitive. I did when I had to write backtracking algorithms back on college. But most application programming would be hell to do in LISP.

    4. Re:It'll get better. by morgan_greywolf · · Score: 2, Insightful
      Common Lisp or Scheme code is often only unreadable to people who have had their brains scrambled by languages like C, C++, Java, C# and VB.


      C or C++ code is often only unreadable to people who have had their brains scrambled by languages like Common Lisp and Scheme.

      So? The fact that some management types think scheme proves exactly what?
    5. Re:It'll get better. by Anonymous Coward · · Score: 0

      "...we found that it was usually because they had had some previous experience using languages..."

      There is a lot of truth to that. I was learning some AppleScript, which is suppose to have an intuitive syntax, but prior programming experience really made it confusing at first. But IMHO the designers of a radically different language syntax have tunnel vision sometimes. They assume that is the only language you will ever use or you have a memory like an elephant if you have to program in other languages. If you have to constantly look up basic loop structure and program logic because it is so different, you don't become too productive with it. But, I guess, how do you effect change otherwise.

    6. Re:It'll get better. by TheRaven64 · · Score: 1

      AppleScript is one of the few languages that is trivial to read, but very difficult to write. If you find yourself using it again, then remember that it is semantically almost identical to Smalltalk. Mentally replace each 'tell FOO ... end tell' block with 'FOO: ...' and you will find it starting to make sense.

      --
      I am TheRaven on Soylent News
    7. Re:It'll get better. by Anonymous Coward · · Score: 0

      Every decent C, C++, Java and C# programmer I know is well-versed with languages like Scheme, Common Lisp, Haskell or Standard ML. Their C, C++, Java or C# code is often of such a high quality namely because they apply many of the practices of functional languages when designing and developing software.

    8. Re:It'll get better. by Anonymous Coward · · Score: 0

      C or C++ code is often only unreadable to people who have had their brains scrambled by languages like Common Lisp and Scheme.

      You can reverse the statement, but then doesn't fit the data. It's unreadable to anybody who hasn't done C and C++. People new to programming find it nasty, too, and they make up the vast majority of people in the world.

      So? The fact that some management types think scheme proves exactly what?

      It's not hard to find other examples of people (non-managers) who had trouble with Algol-derived programming languages, but then discovered Lisp. I don't know of anybody who discovered C and said "wow, malloc and free make me so much more productive!". Even Stroustrup won't claim that C++ is elegant.

      That's because C was designed to be portable assembly language, and therefore matches pretty well with the structure of some hardware that doesn't exist any more (hello, \0-terminated ASCII strings!). Lisp, OTOH, was designed as a way for McCarthy (who doesn't even own a computer) to write algorithms. It's no surprise the former causes newcomers so much grief.

  5. captchas by Anonymous Coward · · Score: 0

    In the future obfuscated C and perl programs will be used as captchas.

  6. A good one for a good programmer... by nweaver · · Score: 1

    Make a C mutator: It takes C, parses, and applies a bunch of randomizing but semantically preserving transformations. Make it small, and compact.

    Then run your code through it a few times and submit it.

    --
    Test your net with Netalyzr
    1. Re:A good one for a good programmer... by TrappedByMyself · · Score: 1

      Make it small, and compact.

      And don't forget to format the final code to look like a penis, and you'll be sure to win

      --

      Help me take back Slashdot. When did 'News for Nerds' become 'FUD and Conspiracy Theories for Extremist Nutjobs'?
    2. Re:A good one for a good programmer... by Anonymous Coward · · Score: 0

      That's not really what the contest is about. Sure some of it is just simple "mutations" as you say but often the winning entries are using tricks or abuse the language is a non-obvious manner. An automated script can't produce that kind of code. That's the whole point of the contest really.

    3. Re:A good one for a good programmer... by misleb · · Score: 1

      I think a good obfuscated contest winner will go beyond mere syntactic scrambling. Or at least it would be "creative" syntactic scrambling.

      Anyway, I HOPE you can't win the content simply by running normal code through an obfuscating program.

      -matthew

      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    4. Re:A good one for a good programmer... by JabberWokky · · Score: 1
      The first steps it goes through are a preprocessor and an indenter. Things like "#define i void" are pretty much old hat and not seen as creative nowadays. Most of the obvious things (that syntax scramblers tend to do) are poor scoring manipulations. See the guidelines for exactly how they score. Highest scores are given to novel approaches, and that in turn is somewhat dictated by what has been done in the past.

      --
      Evan

      --
      "$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
    5. Re:A good one for a good programmer... by nacturation · · Score: 2, Interesting

      That's probably a good way to lose since creativity is one of the key factors, not just plain illegibility. Take, for example, this program (one of my all-time favorites) which prints out the value of pi:

      http://www0.us.ioccc.org/1988/westley.c

      Or this one which, when compiled and run, prints out another character as program source. You compile the output to that, run it and it outputs another character as program source. You compile that, and you get back the original program's source:

      http://www0.us.ioccc.org/2000/dhyang.c

      And given the space constraints, your program should be quite clever and compact itself even before you try and obfuscate it.

      --
      Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
    6. Re:A good one for a good programmer... by XO · · Score: 1

      Yeah I think it has to do what it does in an obfuscated form as well. I had one bizarre one that I used as a sig for a long time, that was about a 20 line program or so that would print the Twelve Days of Christmas, using ASCII math and loops. Very strange.

      --
      "Champagne for my real friends - and real pain for my sham friends!" http://ericblade.postalboard.com/
    7. Re:A good one for a good programmer... by imsabbel · · Score: 1

      Just a piece of info about the second one (to understand why its SO GREAT):

      The ORIGINAL source is the head of a guy, and the two kanji the other sources show are a rather famous expression attributed to this man.

      --
      HI O WISE PRINCE. WHT TOOK U SO DAM LONG?
    8. Re:A good one for a good programmer... by zobier · · Score: 1
      Make a C mutator: It takes C, parses, and applies a bunch of randomizing but semantically preserving transformations. Make it small, and compact.

      Then run your code through it a few times and submit it.
      That's probably a good way to lose since creativity is one of the key factors, not just plain illegibility.
      Well if you ran the mutator through itself it may count as an interesting entry.
      --
      Me lost me cookie at the disco.
  7. my sample by Anonymous Coward · · Score: 0

    #include <stdio.h>

    static const int one = 1;

    #if one == 1
        static const int result = 2;
    #else
        static const int result = 42;
    #endif

    int main(void)
    {
        printf("1 + 1 = %d\n", result);
        return 0;
    }

    1. Re:my sample by vranash · · Score: 1

      It'll always return 42 because one is a variable, not a #define, hence its value isn't set in relation to compile-time activities (such as which value to place in result.)

      Am I right?

  8. 2007 by Lethyos · · Score: 1

    Leob, I just thought of a New Years Resolution for you.

    --
    Why bother.
    1. Re:2007 by leob · · Score: 1

      Eh... Maybe next year.

  9. A good place... by Anonymous Coward · · Score: 0

    ...to find skilled Perl programmers.

  10. A clarification... by nweaver · · Score: 1

    You submit your OBSFUCATOR after you reobsfucate it a few times.

    --
    Test your net with Netalyzr
  11. RTFA by Aladrin · · Score: 1

    Lethyos, I just thought of a New years Resolution for you.

    http://www0.us.ioccc.org/years.html - 17th was 2004. 19th is... Hmm... Yeah, 2006. And the contest started in 2006. So yeah, 2006.

    --
    "If you make people think they're thinking, they'll love you; But if you really make them think, they'll hate you." - DM
  12. Isn't it time for a CLEAR code contest? by dpbsmith · · Score: 3, Interesting

    A contestant would submit a piece of code together with the specification of what the code was supposed to do, but no other documentation.

    The judges would propose a straightforward change in the specification.

    The code and the revised specification would be given to an impartial panel of a hundred programmers, selected at random from the ranks of people working for a living writing code. Each of them would be asked to modify the code to meet the revised spec. They would also be instructed to fix any bugs they noticed in the code they were given. The revised code and spec would then submit each one to an impartial panel of 100 SQA testers, selected at random from the ranks of people who work for a living testing code.

    The winner would be the contestant whose code, after being modified by other programmers, passed the largest number of SQA tests.

    (And, yes, SQA failures due to unfixed bugs in the original code would count against the contestant).

    1. Re:Isn't it time for a CLEAR code contest? by nacturation · · Score: 2, Insightful

      Yeesh... sounds too much like work. I get paid to write clear code. When I don't get paid, I want to have fun with it.

      --
      Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
    2. Re:Isn't it time for a CLEAR code contest? by Anonymous Coward · · Score: 0

      Clearest code? Here's your winner. :)

    3. Re:Isn't it time for a CLEAR code contest? by poot_rootbeer · · Score: 1

      "The revised code and spec would then submit each one to an impartial panel of 100 SQA testers, selected at random from the ranks of people who work for a living testing code."

      Yeah right. As if there were more than 100 competent SQA testers in the world.

    4. Re:Isn't it time for a CLEAR code contest? by pclminion · · Score: 1

      Jesus, this sounds like just about the most boring thing in the world. I do this every day at work. It's called "my job." Strangely, I already get paid for it.

  13. Rough crowd by Anonymous Coward · · Score: 0

    It was supposed to be a joke about how secretive some closed-source vendors can be and how they try everything in their power to keep their code secret. It was supposed to be absurdly funny. Apparently it fell a little(lot?) short.

  14. Oh man, now you've done it! :) by Anonymous Coward · · Score: 0
    I'm so mad, I'm calling Jess-C Jackson. He'll get Al #ton on the phone as well.
    Here's a * - U think you're #? U had 2 dig y|| own `, && isle £ it out y|| :. Forget the ^, this is the stick.
    I cannot _ this any further. Do ! + me.

    Or put another way ...
    (Here's a pointer - you think you're sharp? You had to dig your own grave, and I'll pound it out your colon. Forget the carrot, this is the stick. I cannot underscore this any further. Do not cross me.)
  15. Vista Source code by Anonymous Coward · · Score: 0

    Now where is that hacked MS Vista source code?

  16. every year, this must get re-explained by Speare · · Score: 2, Informative

    Okay, the 2006 "Explanation of Why IOCCC Is Not Just Ugly Code" is now underway.

    The winning entries are pieces of art, not pieces of dung. They look like they should do one thing, but they do another. They arrange the code in a visually pleasing but maintenance-proof way. They choose some concept and take it to the absurd limit, all within a tiny amount of code.

    My favorite past entry is John Tromp's maze generator. In seven lines of code, he produces random mazes. The variables are named M, A, Z, E instead of useful functional mnemonics. The source code is formatted to LOOK like a maze. And even in this maze which is the source code, the passages in the maze spell out the word 'maze.' This is not just putting a pig on the lipstick, this is making the pig look *good*.

    --
    [ .sig file not found ]
  17. the first half dozen were fun... by oohshiny · · Score: 0, Flamebait

    but it really is time to stop it already. We shouldn't be programming in C anymore.

    1. Re:the first half dozen were fun... by leenks · · Score: 1

      Yeah, I mean computers are fast enough for everything these days. Lets use Java for everything.

    2. Re:the first half dozen were fun... by mmkkbb · · Score: 1

      There are still things that need a genericized assembly language, so there is still a need for C!

      --
      -mkb
    3. Re:the first half dozen were fun... by smittyoneeach · · Score: 1

      Aw, c'mon: there is a time and place for everything.
      The number of large, successful projects coded in C thoroughly mocks your viewpoint.

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    4. Re:the first half dozen were fun... by oohshiny · · Score: 1

      There are still things that need a genericized assembly language, so there is still a need for C!

      C was a high-level assembly language for the PDP-11; it is not a high-level assembly language for modern architectures.

    5. Re:the first half dozen were fun... by oohshiny · · Score: 1

      The number of large, successful projects coded in C thoroughly mocks [sic] your viewpoint.

      Heck, yes, by your argument, let's go back to DOS, Fortran, and COBOL, then. I mean, who even needs this, new-fangled C and UNIX stuff?

    6. Re:the first half dozen were fun... by smittyoneeach · · Score: 1

      You've swerved from one ditch to the other, sir.
      How about something moderate? Good tool/job match? Decent balance among power, performance, and ease of use?

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    7. Re:the first half dozen were fun... by mmkkbb · · Score: 1

      yeah, cause modern ISAs aren't designed to be easy to compile C for or nothin'.

      --
      -mkb
    8. Re:the first half dozen were fun... by Anonymous Coward · · Score: 0

      The ISAs do support C, but the actual architectures are designed to be primarily fast, with almost no regard for the ease of compiler writers. From a hardware company's point of view, compilers are only software and far cheaper to create than a modern processor.

      In particular, the memory semantics and heavy use of pointers in C require compilers to go to heroic efforts to analyze which memory accesses can be moved ahead in the code stream, or out of loops.

    9. Re:the first half dozen were fun... by oohshiny · · Score: 1

      yeah, cause modern ISAs aren't designed to be easy to compile C for or nothin'.

      Modern architectures try to accomodate C as much as possible, but they have lots of important functionality that isn't available from C. Therefore, C can be compiled for them, but C isn't a "high level assembly language" for them.

      Conversely, some of the areas where modern architectures have tried to accomodate the C language have arguably led to bad architectural decisions and have held back the industry both on runtime safety and performance. That's yet another reason to ditch C.

      C is just a poorly designed high-level language, nothing more. It was obsolete the day it was conceived.

    10. Re:the first half dozen were fun... by oohshiny · · Score: 1

      How about something moderate? Good tool/job match? Decent balance among power, performance, and ease of use?

      Yes, and C is never the optimal choice on purely technical grounds; C is full of flaws and design errors that can be fixed without affecting its expressiveness or performance in any way.

      The only reason to use C (and I do) is because lots of other people are using it.

    11. Re:the first half dozen were fun... by Anonymous Coward · · Score: 0

      C is full of flaws and design errors that can be fixed without affecting its expressiveness or performance in any way.

      Elaborate, troll.

  18. c programing language by Ozgur+Uksal · · Score: 1

    I missed writing programs in C. Anyways, I think, the creator of Perl has also won that competition. C rules/rocks!!!

    Ozgur Uksal
    http://en.wikipedia.org/wiki/C_(programming_langua ge)/

    1. Re:c programing language by Anonymous Coward · · Score: 0

      Yea, he did, twice actually.

  19. Thank you for taking the joke as intended. by Lethyos · · Score: 1

    I wish I could moderate your reply as funny. :)

    --
    Why bother.
  20. There is more then one way to do it... by GNUThomson · · Score: 1

    They should run a Perl version with prizes for actually clear code. But I suppose it would be too difficult. Or maybe it would end up as a Loebner contest-style contest: lots of entries, no winners. Oh well.

  21. A bit of code... by Anonymous Coward · · Score: 0

    Here's something I wrote a while ago. It's not up to snuff for the IOCCC but it might give some Slashdotters an interesting challenge.

    The solution is out there on the web somewhere, but I think it would be fairly hard to Google for it.

    Just explain what this function does:

    int pm(char *p, char *m)
    {
    return !*p?!*m:!*m?!((*p^(*p>>1))-(!!*p<<6)+1)&&pm(p+1,m) :!(*p- (!!*p<<6)+1)?pm(p+1,m+1):!((*p^(*p>>1))-(!!*p<<6)+ 1)?pm(p +1,m)||pm(p,m+1):*p==*m&&pm(p+1,m+1);
    }
    1. Re:A bit of code... by leob · · Score: 1