Slashdot Mirror


2004 IOCCC Winners Source Code Released

Langly writes "The IOCCC have finally released their source code for 2004. My thoughts goes out to the poor guys that actually wrote this code. Reader discretion is advised." Every time I see an obfuscated code contest, I wonder if 'Winner' is the right word to describe the victor ;)

47 of 175 comments (clear)

  1. frist? by Anonymous Coward · · Score: 5, Funny

    void main(void) {
    printf("frist prost");
    }

    1. Re:frist? by Anonymous Coward · · Score: 2, Informative

      Various standard C library functions are known to the compiler, and the compiler is allowed to optimise them. For example, here's a little trick. If you compile:

      printf("Hello\n");

      With max opt, GCC will convert it into:

      puts("Hello");

      How cool is that? You've saved one byte in your string and called a much quicker/smaller function!

    2. Re:frist? by gorre · · Score: 3, Insightful

      Arrggh, main returns an int god dammit!

      --
      "Madness is something rare in individuals - but in groups, parties, peoples, ages it is the rule." -- Nietzsche
    3. Re:frist? by aled · · Score: 2, Insightful

      So what? it's just a warning. Much the better to ofuscation.

      --

      "I think this line is mostly filler"
    4. Re:frist? by quigonn · · Score: 2, Interesting

      gcc -std=c99 -o frist_prost frist_prost.c works perfectly without warning. By default, gcc still interprets the code as C89.

      --
      A monkey is doing the real work for me.
    5. Re:frist? by pchan- · · Score: 4, Insightful
      It also doesn't take a void argument.

      sure it does. int main(void) is completely legitimate. there's no reason why your program needs to take in commandline arguments. the loader will probably pass them to you anyway, but you don't need to acknowledge their existance.
      $ cat x.c
      #include <stdio.h>

      int main(void)
      {
      printf("sweet\n");
      return 0;
      }

      $ gcc -Wall -std=c99 x.c
      $
    6. Re:frist? by BreadMan · · Score: 3, Informative

      For GCC, at least, the entry point as far as Linux is concerned is _init, defined in /usr/lib/crti.o.

      _init opens the standard file descriptors, gathers the command line arguments and does a but of housekeeping before calling main, your program's entry point. GCC links to this by default; but you can change this if necessary, for instance an embedded project running without an OS would need very different initialization code, and for that matter it could define the entry point of the application as something other than main().

      If you want to see what GCC is doing for a compilation, try

      gcc =### x.c

      And you'll be able to see what gcc passes to the underlying tools to pre-process, compile, assemble and link.

  2. obfuscated server by LiquidCoooled · · Score: 5, Funny

    The code running on the webserver must be AMAZING.
    Its so obfuscated that I cant even see it!

    ahhhhhh its finally shown up.

    Doesnt bode well though.

    --
    liqbase :: faster than paper
  3. ouch by mpost4 · · Score: 3, Interesting

    I would hate to have to be the one that either updates that code or has to read it. Some nice ASCII art in there, I am not brave enough to test to see if the programs do what they say they do. I went to the spoiler page so I could get the synopsis of them. That code would be a good Halloween costume it is just scary.

    1. Re:ouch by ajs · · Score: 5, Insightful

      I'm so tired of this. Every time the IOCCC winners are announced someone has to go off on how unmaintainable the code is.

      For those who are unable to grasp the point, I'll say it slowly: this code is written by people who understand C well enough to twist it into any shape they please. Of course, they could write clean, maintainable code, but then they would LOSE the competition. The goal is to write obfuscated code.

      The IOCCC is an expression of source-code as art in a compettitive forum. If that isn't your cup of tea, don't hurt your brain by reading the submissions.

  4. Big deal by Anonymous Coward · · Score: 5, Funny

    When I was learning programming, I would obfuscate code so bad that even the compiler couldn't understand it, let alone humans...

  5. Follow up story. by AtariAmarok · · Score: 5, Funny

    "Within 20 minutes of the code release, SCO sued claiming that it contained something of theirs".

    --
    Don't blame Durga. I voted for Centauri.
  6. More C-related sillyness by cjellibebi · · Score: 2, Interesting

    Slightly offtopic, but this will serve the needs of those of us reading this thread for a fix of C-related humour. The Infrequently asked questions in C (C-IAQ).

  7. Oh the irony by agent+dero · · Score: 5, Funny

    An obfuscated code contest article has a Microsoft "Get the Facts" ad beneath it.

    Does the OSTG try to be subtle or what? :-P

    --
    Error 407 - No creative sig found
  8. Mirrors by mozingod · · Score: 5, Informative

    Google cache with different mirrors across the globe: http://64.233.167.104/search?q=cache:LAIfxt7dfOEJ: www.ioccc.org/+ioccc&hl=en

  9. clueless submitters by jbellis · · Score: 3, Interesting

    I wish the submitters for these things understood that 90% of the obfuscation is done post-debugging with perl scripts... (The remaining 10% is the clever part.)

    1. Re:clueless submitters by RangerRick98 · · Score: 5, Funny

      Actually, 90% of obfuscation is perl scripts. :)

      <runs>

      --
      "You're older than you've ever been, and now you're even older."
    2. Re:clueless submitters by willisachimp · · Score: 5, Interesting
      Actually, I work with the guy who wrote the 'gavin' (the best of show this year), and know for a fact that the final version you see is *very* similar to his development version. Pretty much the only difference is shorter, meaningless variable names and running it through indent (thus giving no information in the indentation, by using a standard indentation tool)

      What you see is how he wrote it - he really is that sick :-D

      I'm so glad he doesn't write like this when he's working. Well, not often, anyway.

  10. Time to brush up on your l33t coding skills by GillBates0 · · Score: 5, Funny
    How to write unmaintainable code

    Some gems:
    Naming variables :
    #1 Baby names: Buy a copy of a baby naming book and you'll never be at a loss for variable names. Fred is a wonderful name, and easy to type. If you're looking for easy-to-type variable names, try adsf or aoeu if you type with a DSK keyboard.

    #17 Bedazzling Names: Choose variable names with irrelevant emotional connotation. e.g.:
    marypoppins = ( superman + starship ) / god;
    This confuses the reader because they have difficulty disassociating the emotional connotations of the words from the logic they're trying to think about.

    #26 Misleading names: Make sure that every method does a little bit more (or less) than its name suggests. As a simple example, a method named isValid(x) should as a side effect convert x to binary and store the result in a database.

    --
    An Indian-American Hindu committed to non-violent thought/speech/action alarmed by the global explosion of radical Islam
    1. Re:Time to brush up on your l33t coding skills by itsNothing · · Score: 2, Funny
      The weirdest naming i saw was while trying to help an undergraduate work on a program:
      one = 4
      two = 3
      three = one + two
      The benefit is that you're pretty sure not to run out of variable names. The downside is that this is a real problem to try to follow after a VERY short time.
  11. The value of not being seen by downward+dog · · Score: 5, Funny

    In this film we hope to show how not to be seen. This is "Hello World" by Mr. E. R. Bradshaw of Cambridge, MA. It can not be seen. Now I am going to ask the code to stand up. "Hello World," will you stand up please. This demonstrates the value of not being seen.

  12. Obfuscated webserver by dk.r*nger · · Score: 3, Funny

    Their webserver is actually written in obfuscated c++ .. Sure, it's slow, but the binary plays a technoversion of Star Sprangled Banner when piped through /dev/dsp ..

    1. Re:Obfuscated webserver by achowe · · Score: 3, Informative
      Yes. I wrote it and I'm rather proud of that entry. You can see it working here:
      http://hibachi.snert.org:8008/
      Version 2.1, the Unobfuscated Posix Windows threaded version will be released sometime soon. If anyone is interested in testing it, email me.
    2. Re:Obfuscated webserver by Eneff · · Score: 2, Funny

      I was so unbelievably depressed when I read your entry, I just about went into my Boss's room and quit on the spot.

      I bow and commit seppaku in honor of your programming prowess.

  13. Every day by 3770 · · Score: 5, Funny

    Hey,

    I write code like that every day for a living.

    I'm just about to finish a world wide, 3-tier, trouble ticketing system in the shape of a Maze.

    --
    The Internet is full. Go Away!!!
    1. Re:Every day by RobertB-DC · · Score: 2, Funny

      Sometimes, .sigs mesh with comments in particularly interesting ways:

      I'm just about to finish a world wide, 3-tier, trouble ticketing system in the shape of a Maze.
      Don't write code, generate it using XML and XSLT with Visual Studio XGen


      I just hope the XGen development team has a good sense of humor...

      --
      Stressed? Me? Of course not. Stress is what a rubber band feels before it breaks, silly.
    2. Re:Every day by 3770 · · Score: 2, Funny


      I couldn't tell you if the XGen development team has a good sense of humor. What I _can_ tell you is that I'm the only developer in that project.

      It is also an open source project so you could see the source code.

      --
      The Internet is full. Go Away!!!
  14. Re:Great article summaries lately... by RPI+Geek · · Score: 2, Informative

    International Obfuscated C Code Contest (I think).

    This groups releases a challenge each year that the entrants have to solve using the most obfuscated C code possible. They judge tne entries and award prizes to the best of the worst. Previous entries have used the precompiler to do much of the work, eliminated brackets and spaces, hacked the stack, and generally used many other tricks to complete the challenge.

    --

    - "Nobody came out that night, not one was ever seen. But Old Man Stauf is waiting there, crazy sick and mean!"
  15. Official IOCCC mirrors by Anonymous Coward · · Score: 3, Informative
    IOCCC Mirrors

    Asia


    Europe

    North America
  16. Re:Mirror this already! by Anonymous Coward · · Score: 5, Informative

    There are several mirrors. I know, I run one of them. Why the submitter hardcoded the us one is beyond me.

    • Antarctica
      none yet :-)
    • Africa
      none
    • Australia and other Pacific
    • www.au.ioccc.org - Sydney, Australia (34 0' S 151 0' E)
    • Extraterrestrial
      SETI is looking for some sites :-)
    • South America
      none
  17. Mirrors ... by foobsr · · Score: 4, Informative

    http://www.de.ioccc.org/years.html#2004

    also tw, au, es, www1.us

    CC.

    --
    TaijiQuan (Huang, 5 loosenings)
  18. OK Mr Supar Comuputar by stratjakt · · Score: 5, Funny

    I wonder if 'Winner' is the right word to describe the victor

    This is coming from the dingus behind slashcode.

    --
    I don't need no instructions to know how to rock!!!!
  19. Another mirror by DoctorEternal · · Score: 3, Informative
  20. Simple trick for beginners by grungeman · · Score: 4, Funny

    Name your variables A1, Al, B1, Bl, and so on. With some fonts (especially those fixed width fonts in code editors) a "l" (small "L") looks exactly the same as a "1" (a one), which makes sure that the guy maintaining the code will have fun a-plenty.

    --

    Signature deleted by lameness filter.
    1. Re:Simple trick for beginners by mopslik · · Score: 5, Interesting
      Bah, why use "A" and "B" when "I" (capital i) will do the trick even better?

      Examples:
      I1I1 (eye one eye one)
      IlIl (eye ell eye ell)
      lIll (ell eye ell ell)
      etc.
  21. Is This Necessary? by Mignon · · Score: 4, Funny

    Hasn't obfuscated C already been perfected?

    1. Re:Is This Necessary? by Nicolay77 · · Score: 2, Informative

      Well, then you should know that Larry Wall was a winner of the IOCCC in 1987.

      --
      We are Turing O-Machines. The Oracle is out there.
  22. Oh noooooo by ewe2 · · Score: 2, Funny


    Every time I see an obfuscated code contest, I wonder if 'Winner' is the right word to describe the victor ;)


    I certainly feel like a loser when I read obfuscated code!

    --
    insecurity asks the wrong question irritation gives the wrong answer
  23. Gotta love it. by jcuervo · · Score: 4, Funny
    Check out vik1.c:
    /* Some more code */
    I think they gave him extra points for the comment.
    --
    Assume I was drunk when I posted this.
  24. Re:Great article summaries lately... by Scarblac · · Score: 4, Interesting

    And best of all, that ridiculous code is REALLY AMAZINGLY POWERFUL in many cases.

    I only looked at the first entry, anonymous.c. It's 47 utterly incomprehensible lines. What it does is convert text into one of Tolkien's Elvish fonts - and the result looks rather nice, for such a tiny C program (that doesn't use any libraries apart from stdlib, stdio and string).

    I took the example from the hint file, pasted only the first half ("ash nazg durhbatuluhk, ash nazg gimbatul") and created a picture, then converted it to PNG with ImageMagick. The result is here. I think that's rather good.

    And that's just the first one of this year. Many of the entries of earlier years were stunning.

    --
    I believe posters are recognized by their sig. So I made one.
  25. Size does matter! by mwvdlee · · Score: 5, Interesting

    Why not just differentiate by varying the length of the names?

    xxxxxxxxxxxxxx = xxxxxxxxxxxx + xxxxxxxxxxxxxxxxxxxxx / xxxxxxxxxxxxxxxx;

    Makes sense, doesn't it? And it works with every letter of the alphabet too!

    --
    Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
  26. Even more obfuscated code by Anonymous Coward · · Score: 3, Funny

    If you want to take a look at some code that's a real mess, try this code here.

    Ugh.

  27. IOC code? by MrCocktail · · Score: 2, Funny

    I read the title a little too fast, collapsed all the C's together, and wondered out loud when coding became an Olympic sport...

  28. Centrinia by Ann+Coulter · · Score: 2, Interesting
    Centrinia has a base library that is written in C. Since C does not have namespace features, I did the next "best" thing: explicitly have the entire namespace in each global identifier. Take a look at my web site at http://www.student.gsu.edu/~zliu2/centrinia.html to see my rationel. An example of my natural number routine name is
    centrinia___base___N___large___arithmetic___multip lication
    (without the space(s)). Again, the rationel for this is on the web site.
  29. A tutorial by Smallest · · Score: 2, Interesting
    --
    I have discovered a truly remarkable proof which this margin is too small to contain.
  30. My Contribution by AnalogDiehard · · Score: 2, Funny

    I submitted a M$ Windows XP EULA. The code parser exploded and it was disqualified.

    --
    Eternity: will that be smoking, or non-smoking? I Corinthians 6:9-10
  31. Re:Great article summaries lately... by Coryoth · · Score: 2, Informative
    And best of all, that ridiculous code is REALLY AMAZINGLY POWERFUL in many cases.

    I only looked at the first entry, anonymous.c. It's 47 utterly incomprehensible lines. What it does is convert text into one of Tolkien's Elvish fonts


    I was fairly impressed with Gavin.c. It's 165 lines of nicely indented/formatted C code that's pretty much incomprehensible. What does it do? It's a 32 bit multitasking operating system complete with a GUI, a shell, and a text viewer called vi.

    Or perhaps Vik1.c - 63 lines (including a comment :-), that when compiled gives you an X11 racing game. But check out the feature list:

    • Drive on a road in a 3-d landscape with hills and curves
    • Mountains in the horizon
    • A sun in the sky when driving during the day.
    • Dark sky and reduced visibility when driving at night.
    • Snow when driving in the winter.
    • Slippery road when driving in the winter.
    • When driving off the road, the car slows down to a halt
    • Three different race tracks that takes about one minute to complete.
    • Speed meter.
    • Computer driven opponent cars.
    • Collision detection when driving into other cars.
    • Lap time measurement.
    • The best lap time is stored as reference.


    Not bad for 63 lines of C code.

    Jedidiah.