Slashdot Mirror


18th International Obfuscated C Code Contest Opens

chongo writes "The 18th International Obfuscated C Code Contest, the Internet's longest running contest, is now open. The goals, rules, and guidelines are available. Use the online submission tool to submit your obfuscated C code by 22-May-2005 23:59:59 UTC."

187 comments

  1. Past Winners with Spoilers by Entropy248 · · Score: 5, Informative

    Here are some past winners with "Spoilers" for what they do. It's already pretty slow though and I'm first post.

    1. Re:Past Winners with Spoilers by strider44 · · Score: 1

      The most brilliant one in my opinion is Jason from 2001. In the author's words it's 'downright chatty for only having two string literals ("%d \n" and "Y\n : ! ,.?>")'

      The thing is I know theoretically how the program does it, but I just don't know how he wrote it!

    2. Re:Past Winners with Spoilers by Vo0k · · Score: 1

      Now waiting for YOUR favourites from the entries.
      Mine:
      -calculating surface of circle by counting the characters of ascii-arted one,
      -the letter from Char(lie) to Char(lotte).

      --
      Anagram("United States of America") == "Dine out, taste a Mac, fries"
    3. Re:Past Winners with Spoilers by mirko · · Score: 2, Interesting
      My personal favorite is the following:
      http://remus.rutgers.edu/~rhoads/Obfuscated_C/hagu e


      It's a command line based ascii to morse converter...
      I especially like the fact it's a bunch of DAH DAHDIT!
      --
      Trolling using another account since 2005.
    4. Re:Past Winners with Spoilers by Anonymous Coward · · Score: 0

      Wow. Marking First Post as Redundant. Nobody's afraid of metamoderation nowadays.

    5. Re:Past Winners with Spoilers by aliasptr · · Score: 2, Interesting

      After running arg.c (just a file with the original source code in it) through the preprocessor and some indentation:

      # 1 "arg.c"
      # 1 ""
      # 1 ""
      # 1 "arg.c"
      # 9 "arg.c"
      char _DAH_[]="ETIANMSURWDKGOHVFaLaPJBXCYZQb54a3d2f16g7c 8a90l?e'b.s;i,d:";
      main ( )
      {
      char * _DIT,* DAH_,* DIT_,* _DIT_,* malloc (),* gets ( );

      for ( _DIT=malloc ( 81 ),DIT_=_DIT++;_DIT== gets ( _DIT );__DIT('\n') )
      for ( DAH_=_DIT; *DAH_; __DIT ( *_DIT_?_DAH ( * DIT_ ):'?'),__DIT(' '),DAH_ ++ )
      for (* DIT_=2,_DIT_=_DAH_; * _DIT_ && (* _DIT_!=( * DAH_>='a'? *DAH_&223:* DAH_ ) ); (* DIT_ ) ++,_DIT_ ++ )
      * DIT_+= ( * _DIT_>='a'? * _DIT_-'a':0);
      }_DAH
      ( DIT_ )
      {__DIT
      (DIT_>3?_DAH ( DIT_>>1 ):'\0');
      return DIT_&1?'-':'.';
      }__DIT
      ( DIT_ ) char DIT_;

      {
      ( void ) write ( 1,&DIT_,1 );
      }

      (arg.c is just the original source file)

      And there you have it. As mentioned on the page the similar names are annoyingly hard to read, ternary operator usage, weird function exits (I think I am not very good with C... corrections or resources about what exactly is going on with {__DIT ... }__DIT? Or perhaps some Google searching :-P . I had wasted my time making this so I figured I'd post it.

      --
      It takes all types in this world. I sincerely mean it... This is just my perspective.
    6. Re:Past Winners with Spoilers by aliasptr · · Score: 1

      Oh yeah I used the preprocessor to cheat through the redefinition of the reserved keywords and other operators basically just the #define DIT ( #define DAH ) #define __DAH ++ #define DITDAH * #define DAHDIT for #define DIT_DAH malloc #define DAH_DIT gets #define _DAHDIT char stuff. After that it's pretty much just reading normal-ish code... enjoy

      --
      It takes all types in this world. I sincerely mean it... This is just my perspective.
    7. Re:Past Winners with Spoilers by Anonymous Coward · · Score: 0
      I think I am not very good with C... corrections or resources about what exactly is going on with {__DIT ... }__DIT?

      It's not C you're bad at, it's knowing which tools to use. You presumably indented that by hand, didn't you? If you use an automatic indenter, you get better results. For example, formatting the original using a command line as simple as cpp produces quite readable output:
      char _DAH_[] = "ETIANMSURWDKGOHVFaLaPJBXCYZQb54a3d2f16g7c8a90l?e' b.s;i,d:";
      main ()
      {
      char *_DIT, *DAH_, *DIT_, *_DIT_, *malloc (), *gets ();
      for (_DIT = malloc (81), DIT_ = _DIT++; _DIT == gets (_DIT); __DIT ('\n'))
      for (DAH_ = _DIT; *DAH_; __DIT (*_DIT_ ? _DAH (*DIT_) : '?'), __DIT
      (' '), DAH_++)
      for (*DIT_ = 2, _DIT_ = _DAH_;
      *_DIT_ && (*_DIT_ != (*DAH_ >= 'a' ? *DAH_ & 223 : *DAH_));
      (*DIT_)++, _DIT_++)
      *DIT_ += (*_DIT_ >= 'a' ? *_DIT_ - 'a' : 0);
      }

      _DAH (DIT_)
      {
      __DIT (DIT_ > 3 ? _DAH (DIT_ >> 1) : '\0');
      return DIT_ & 1 ? '-' : '.';
      }

      __DIT (DIT_)
      char DIT_;
      {
      (void) write (1, &DIT_, 1);
      }
      And it becomes clear that the problem you're having is that you don't recognise K&R-style function definitions.
    8. Re:Past Winners with Spoilers by Anonymous Coward · · Score: 0

      Damn Slashdot! Damn Slashdot! Damn Slashdot!

      That should of course have read "...formatting the original using a command line as simple as cpp < arg.c | indent produces...".

    9. Re:Past Winners with Spoilers by Anonymous Coward · · Score: 0

      Wow. Posting a link to the same site as the article to do karma whoring in a first post. Nobody's afraid of moderation these days.

    10. Re:Past Winners with Spoilers by Anonymous Coward · · Score: 0

      > Damn Slashdot! Damn Slashdot! Damn Slashdot!

      Well fuck yuo for not using "Preview".

    11. Re:Past Winners with Spoilers by SEWilco · · Score: 1
      My favorite, many years ago, won "Best Abuse of the Rules":
      #include "/dev/tty"
  2. Reminds me of a joke... by mirko · · Score: 5, Funny
    The highlight of the annual Computer Bowl occurred when Bill Gates, who was a judge, posed the following question to the contestants:

    ``What contest, held via Usenet, is dedicated to examples of weird, obscure, bizarre, and really bad programming?''

    After a moment of silence, Jean-Louis Gassee (ex-honcho at Apple) hit his buzzer and answered ``Windows.''

    Mr. Bill's expression was, in the words of one who was there, ``classic.''
    --
    Trolling using another account since 2005.
    1. Re:Reminds me of a joke... by Pastis · · Score: 2, Informative

      2 things:

      - this was I think in 1993 and Gassiee has been more famous since by being the man behind BeOS.

      - this was on TV. we NEED to find that episode...
      It apparently is not in these archives: http://www.archive.org/movies/movieslisting-browse .php?collection=computerchronicles&cat=computer%20 bowl&PHPSESSID=afa9787e38cc81e4f22ed0542058072a

      Anyone with it? Maybe Mr Gassiee has it :)

    2. Re:Reminds me of a joke... by Anonymous Coward · · Score: 0

      Hello
      s/Gassie/Gassée/g
      --
      Be developer E-1437 :)

    3. Re:Reminds me of a joke... by phrasebook · · Score: 1

      Reminds me... does anyone have a link to that video where the IBM employee who invented Ctrl-Alt-Del said something like "I didn't make Ctrl-Alt-Del famous, Bill did" and Bill G just sits there silent in response? I love his reaction there.

    4. Re:Reminds me of a joke... by Rufus211 · · Score: 2

      Google Search: CtrlAltDel.asf

      all the links to andrew.cmu are dead as I've removed the video from my webspace, but there are plenty of copies floating around.

    5. Re:Reminds me of a joke... by Anonymous Coward · · Score: 3, Informative
    6. Re:Reminds me of a joke... by jaavaaguru · · Score: 1

      I'll probably regret the bandwidth usage, but here's a copy:
      http://www.sorn.net/misc/CtrlAltDel.asf

    7. Re:Reminds me of a joke... by Anonymous Coward · · Score: 0

      The first link goes to "Comuter Bowl" instead of "Computer Bowl". When is archive.org ever going to get around to fixing all of those typos on their site?

    8. Re:Reminds me of a joke... by toph42 · · Score: 1

      Sorry, I used to have it. It was shown on Computer Chronicles on PBS, which I taped. Unfortunately, I recently chucked all my VHS tapes.

    9. Re:Reminds me of a joke... by Pastis · · Score: 1

      and sorry for the typo. It's Jean-Louis Gassée, not Gassiee...

    10. Re:Reminds me of a joke... by Audacious · · Score: 1

      You know that doctors hand out laxatives for Obfuscated people. ;-)

      --
      Someone put a black hole in my pocket and now I'm broke. :-)
  3. Our Legacy code by AhaIndia · · Score: 5, Funny

    The legacy code I have to work on must be submitted. No body knows how it works and there is no documentation.

    --
    ~Aha~
    1. Re:Our Legacy code by Anonymous Coward · · Score: 2, Funny
      No body knows how it works and there is no documentation.
      Oh, so you're the one who is developing OpenSSL's libcrypto.
    2. Re:Our Legacy code by Anonymous Coward · · Score: 0

      Either that's the only kind of code, or you're one of my co-workers

    3. Re:Our Legacy code by hnile_jablko · · Score: 1

      There is one benefit to legacy some times... security. JOB Security.

    4. Re:Our Legacy code by jonadab · · Score: 1

      > The legacy code I have to work on must be submitted. No body knows how it
      > works and there is no documentation.

      Yeah, but is it _short_ enough to fit within the IOCCC's draconian size limits?

      That's why the Obfuscated Perl Competition is better: it has size limits too,
      but a skilled Perl golfer can squeeze virtually anything into them. Golf is
      much harder in C.

      --
      Cut that out, or I will ship you to Norilsk in a box.
    5. Re:Our Legacy code by FooAtWFU · · Score: 1

      Duh! Libcrypto! It's a cryptography library! Isn't being un-understandable, like, the entire point?

      --
      The World Wide Web is dying. Soon, we shall have only the Internet.
    6. Re:Our Legacy code by Anonymous Coward · · Score: 0

      To misquote robin williams:

      We Russians have the bomb, we dont know where we left it - bUT WE HAVE IT!>

  4. Re:Rawr by 0x461FAB0BD7D2 · · Score: 3, Funny

    Line 20 will never execute unless you return from Hell. Yes, Jesus, I mean you.

  5. Grr by chiapetofborg · · Score: 1

    Stupid HTML that ignores white space. It looks kinda cool in the source of the page.

    1. Re:Grr by Rattencremesuppe · · Score: 2, Informative
      Stupid HTML that ignores white space. It looks kinda cool in the source of the page.
      Use <ecode>
    2. Re:Grr by Anonymous Coward · · Score: 0
      In the following sample, there are multiple spaces between each word, and a different number of spaces at the start of every line. Observe how well the <ecode> tag preserves these features:
      <ecode> strips multiple spaces down to one
      and
      messes up
      alignment.
      Looks like "not at all" would be the appropriate description. <ecode> is broken: it is unusable for accurately posting source code. God only knows why.
    3. Re:Grr by Humorless+Coward. · · Score: 1

      Which reminds me...
      I think someone should submit an entry for
      the contest in html documents. Each document
      should be formatted using numeric ampersand
      code html tags for each character, requiring
      translation using an html browser before the
      files can be compiled.

      If one is going to obscure something, go the extra mile.

  6. Re:Rawr by JesusCigarettes · · Score: 2, Funny

    Hey, don't bring me into this!

    Besides, if Keanu Reeves can do it, anyone can.

  7. Hmm.. by bl4nk · · Score: 5, Funny

    DOS C:\DOS C:\DOS\RUN RUN DOS RUN.. Wait... that's C isn't it? God damn it. I'll never win at this rate...

  8. Simple by Tablizer · · Score: 0, Redundant

    executeBrainFuckLanguageInterpreter(">>-+>+[>]+[-[ [>]-]>-[>]-]]");

    1. Re:Simple by duncanbojangles · · Score: 1

      I ran your brainfuck code through my own interpreter and you're loops are unbalanced.

    2. Re:Simple by Anonymous Coward · · Score: 1, Funny

      Yeah, he is loops are unbalanced.

  9. Mirrors by ugo · · Score: 5, Informative

    www.tw.ioccc.org - Hsin-Chu, Taiwan
    www.au.ioccc.org - Sydney, Australia
    www.de.ioccc.org - Frankfurt/Main, Germany
    www.es.ioccc.org - Madrid, Spain
    www.gr.ioccc.org - Athens, Greece
    www0.us.ioccc.org - Sunnyvale California, US
    www1.us.ioccc.org - Saint Paul, Minnesota US

  10. Re:Rawr by mirko · · Score: 1

    Well, he's supposed to resurrect on Sunday, then, which makes him just a little slower than Linux which can do endless loops in 6 seconds.

    --
    Trolling using another account since 2005.
  11. I wonder... by slobber · · Score: 3, Interesting

    is there a similar contest for Perl? I imagine much crazier submissions with Perl than what can be done with C (no offense to C programmers ;))

    --
    "You mortals are so obtuse." -Q
    1. Re:I wonder... by Anonymous Coward · · Score: 5, Funny

      No, they have the UNobfuscated version of the event for Perl - much harder to win.

      http://humorix.org/articles/2000/09/unobfuscated /

    2. Re:I wonder... by Electroly · · Score: 4, Funny

      Obfuscated Perl? Contests are supposed to be hard. :-)

    3. Re:I wonder... by Ryvar · · Score: 4, Funny

      Obfuscated Perl? Contests are supposed to be hard. :-)

      Oh, it would be hard, just not in the way you think. If none of the judges can figure out any of the entries, how would they be able to pick a winner?

      --Ryv

    4. Re:I wonder... by Crspe · · Score: 5, Interesting

      Well, there is kind of a similar competition for perl ... perl golf ... where the aim is to write the smallest possible perl program to fulfill a particular task. The winners of these competitions are invariably amazingly obfuscated, and unbelievably small!
      One example - one competition involved calculating and printing out the huffman codes for a given input - the winner achieved this with a 76 character perl program!

      find more here:
      http://www.google.com/search?hl=en&q=perl+golf
      or here http://terje.perlgolf.org/

    5. Re:I wonder... by Anonymous Coward · · Score: 0

      Actually, given the right competition, every contest can be hard. Sure, hamburger eating is easy but if you fall in the 50+ hamburgers class it becomes a pro league. Sure it's easy to write obfuscated Perl. But write in it such an innovative way as to make most of competing perl code clean by comparison is hard.

    6. Re:I wonder... by ikkonoishi · · Score: 0, Flamebait

      The last obfuscated perl contest created a void of reason so large that it caused George Lucas to develop the character Jar-Jar Binks.

      So just remember, "Every time you ofuscate Perl you piss off a million Star Wars fans. Please think of the Star Wars fans.".

    7. Re:I wonder... by Threni · · Score: 1

      > is there a similar contest for Perl?

      Presumably that one would be an unobfuscated programming contest?

    8. Re:I wonder... by Procrasti · · Score: 2, Funny

      You know why there is no obfuscated Perl contest?

      Everyone's a winner!

    9. Re:I wonder... by downbad · · Score: 3, Informative

      They could run it through Perl and look at the optimized syntax tree it generates, but I suspect that's outside most hackers' repertoires.

    10. Re:I wonder... by ajs · · Score: 1
      Actually, Perl is not an ideal language for obfuscated code. It has many special cases in the tokenizer (e.g. using a balanced character like [ with a quote-like operator causes it to search for the appropriate end-character like ], but using the end-character to start the quote is also possible and quite hard to read), which can be used to great effect in obfuscation, but then nothing in Perl compares to the unholy things you can do with the C pre-processor, as evidenced by Perl's tokenizer (which is written in C, and few people dare touch).

      The major problem with obfuscating Perl is the "line noise". All of the funky extra syntax you have to throw into your code that makes newbies blanch actually makes it VERY hard to obfuscate code.

      Of course, you can take advantage of the fact that people who don't know the language find it hard to read, so
      $_=$/++
      will certainly intimidate people not familiar with Perl, but for those who are, there's not only no obfuscation there, but a wealth of information about what is being done.

      In short, Perl is a great language for writing code that people who don't write Perl consider obfuscated, but if you want to write code that even people well-versed in the language find difficult, you have to go to a language which has less redundant information available to the observer. It also helps to use a language in which you can trivially violate the grammar of the language by building your own syntax (e.g. the C pre-processor).
    11. Re:I wonder... by Anonymous Coward · · Score: 0

      Obfuscated C is not perl ?

    12. Re:I wonder... by Ohreally_factor · · Score: 2
      I never realized that
      $_=$/++
      was Perl. I always thought it was an emoticon representing the JFK assassination.
      --
      It's not offtopic, dumbass. It's orthogonal.
    13. Re:I wonder... by Anonymous Coward · · Score: 0

      I have a copy of the best one ever from the obfuscated perl contest. It is a dense block of text which is both a postscript program and a perl program that do different things. Unfortunately the "junk character" filter won't let me post it.

    14. Re:I wonder... by Chandon+Seldon · · Score: 1

      Actually, some of these C entries are a bit more obfusciated than I'd expect Perl to get. Perl has no preprocessor, and a lot of the idioms that you use in perl are expected - no one will ever be confused by "&$x->{y}" for example.

      --
      -- The act of censorship is always worse than whatever is being censored. Always.
  12. Quoth the output, "I've dumped a core" by aendeuryu · · Score: 5, Funny

    Once upon a midnight dreary, gcc compiled, growing weak and weary,
    code obfuscated like ne'er seen before.
    I could hear a faint grinding,
    As the preprocessor went on finding,
    it was a noise I could plainly say I abhor.
    T'was an executable destined to dump quite a core.

    It was a nice sunny day, I remember, in May,
    and there lay pizza boxes scattered all o'er the floor.
    But because of this Gentoo, I felt I was being sent to
    the depths of hell for damnation evermore.
    All for a program that would dump its core.

    In time, day diminished, and gcc was finished,
    and the program was a size worthy of lore,
    because of the a.out, my hard drive near ran out,
    as the program took up gigabytes galore,
    and when I ran it, quoth the output, "I've just dumped a core."

  13. Yes but the real question is... by ravenspear · · Score: 1

    Will anyone be able to top the venerable 12 days?

    1. Re:Yes but the real question is... by Anonymous Coward · · Score: 0

      The 12 Days of Christmas is a walk in the park compared to this one:

      X=1024; Y=768; A=3;

      J=0;K=-10;L=-7;M=1296;N=36;O=255;P=9;_=1<< 15;E;S;C;D;F(b){E="1""111886:6:??AAF"
      "FHHMMOO555 57799@@>>>BBBGGIIKK"[b]-64;C="C@=::C@@==@=:C@=:C@= :C5""31/513/5131/"
      "31/531/53"[b ]-64;S=b<22?9:0;D=2;}I(x,Y,X){Y?(X^=Y,X*X>x?(X^=Y) :0, I (x,Y/2,X
      )):(E=X); }H(x){I(x, _,0);}p;q( c,x,y,z,k,l,m,a, b){F(c
      );x-=E*M ;y-=S*M ;z-=C*M ;b=x* x/M+ y*y/M+z
      *z/M-D*D *M;a=-x *k/M -y*l/M-z *m/M; p=((b=a*a/M-
      b)>=0?(I (b*M,_ ,0),b =E, a+(a>b ?-b:b)): -1.0);}Z;W;o
      (c,x,y, z,k,l, m,a){Z=! c? -1:Z;c <44?(q(c,x ,y,z,k,
      l,m,0,0 ),(p> 0&&c!= a&& (p<W ||Z<0) )?(W=
      p,Z=c): 0,o(c+ 1, x,y,z, k,l, m,a)):0 ;}Q;T;
      U;u;v;w ;n(e,f,g, h,i,j,d,a, b,V){o(0 ,e,f,g,h,i,j,a);d>0
      &&Z>=0? (e+=h*W/M,f+=i*W/M,g+=j*W/M,F(Z),u=e-E*M,v=f-S*M,w =g-C*M,b=(-2*u-2*v+w)
      /3,H(u*u+v*v+w*w),b/=D,b*=b ,b*=200,b/=(M*M),V=Z,E!=0?(u=-u*M/E,v=-v*M/E,w=-w* M/
      E):0,E=(h*u+i*v+j*w)/M,h-=u*E/(M/2),i-=v*E/(M/ 2),j-=w*E/(M/2),n(e,f,g,h,i,j,d-1
      ,Z,0,0),Q/=2,T/ =2, U/=2,V=V<22?7: (V<30?1:(V<38?2:(V<44?4:(V==44?6:3))))
      ,Q+=V&1?b: 0,T +=V&2?b :0,U+=V &4?b:0) :(d==P?(g+=2
      ,j=g>0?g/8:g/ 20):0,j >0?(U= j *j/M,Q =255- 250*U/M,T=255
      -150*U/M,U=255 -100 *U/M):(U =j*j /M,U<M /5?(Q=255-210*U
      /M,T=255-435*U /M,U=255 -720* U/M):(U -=M/5,Q=213-110*U
      /M,T=168-113*U / M,U=111 -85*U/M) ),d!=P?(Q/=2,T/=2
      ,U/=2):0);Q=Q< 0?0: Q>O? O: Q;T=T<0? 0:T>O?O:T;U=U<0?0:
      U>O?O:U;}R;G;B ;t(x,y ,a, b){n(M*J+M *40*(A*x +a)/X/A-M*20,M*K,M
      *L-M*30*(A*y+b)/Y/A+M*15,0,M, 0,P, -1,0,0);R+=Q ;G+=T;B +=U;++a<A?t(x,y,a,
      b):(++b<A?t(x,y,0,b):0);}r(x, y){R=G=B=0;t(x,y,0,0);x<X?(printf("%c%c%c",R/A/A,G
      /A/A,B/A/A),r(x+1,y)):0;}s(y){r(0,--y?s(y),y:y); }main(){printf("P6\n%i %i\n255"
      "\n",X,Y);s(Y);}

      Pipe the output to a ppm file and enjoy.

    2. Re:Yes but the real question is... by TheRaven64 · · Score: 1

      I think Fabrice Bellard's original implementation of TCC is more interesting that the 12 days. The entry contained a compiler for a subset of C that was enough to compile the compiler itself (among other things). Since then, TCC has been un-obfuscated and enhanced. While it does not produce highly optimised code, it does produce correct code very quickly, and so is quite useful in rapid test/development cycles.

      --
      I am TheRaven on Soylent News
  14. Re:Is that the fact(18)th annual? by Anonymous Coward · · Score: 0

    Error: Too much recursion.

  15. Maze of Code by Anonymous Coward · · Score: 5, Interesting

    Compile with -fwritable-strings, run, type in a number like 20, find your way out...

    char*M,A,Z,E=40,J[40],T[40];main(C){for( *J=A=scanf(M="%d",&C);
    -- E; J[ E] =T
    [E ]= E) printf("._"); for(;(A-=Z=!Z) || (printf("\n|"
    ) , A = 39 ,C --
    ) ; Z || printf (M ))M[Z]=Z[A-(E =A[J-Z])&&!C
    & A == T[ A]
    |6<<27<rand()||!C&!Z?J[T[E]=T[A]]=E,J[T[A]=A-Z ]=A,"_.":" |"];}

    1. Re:Maze of Code by Anonymous Coward · · Score: 0

      If there's anyone reading this who doesn't recognise that rather famous example, here is the article the parent stole that code from. It's rather interesting, as it explains how the code was actually constructed, instead of just presenting it as a fait accompli.

    2. Re:Maze of Code by master_p · · Score: 0

      From the first look, the result is ...42.

    3. Re:Maze of Code by Speare · · Score: 3, Informative
      This was one of my favorite ObC programs from the distant past. Did you notice that the first variables spell MAZE? Did you notice the code is a maze? Did you notice the passages of the maze spell MAZE? A proper ObC entry is not just obfuscated, but is an onion of beautifully expressed multiple messages.

      There's another one in which the program is shaped like a sailor's semaphore, and produces stick-figure cartoons of a sailor waving semaphores to spell out a user-supplied message.

      --
      [ .sig file not found ]
  16. Speaking of obfuscated code... by PornMaster · · Score: 5, Informative

    If you haven't been there yet, you should check out TheDailyWTF... it's not obfuscated code, but rather unmaintainable code people submit to show what they've been left to deal with at work. Quite interesting, and sometimes as difficult to understand as intentionally obfuscated code.

    1. Re:Speaking of obfuscated code... by Repton · · Score: 5, Funny

      This truly brings tears to my eyes...

      public boolean compareObjects(Object obj1 , Object obj2) {
      if (obj1.equals(obj2) == true)
      return true;
      else
      return false;
      }

      Oh why aren't we teaching more people to code like this?

      --
      Repton.
      They say that only an experienced wizard can do the tengu shuffle.
    2. Re:Speaking of obfuscated code... by lachlan76 · · Score: 1

      This truly brings tears to my eyes...

      Tears...chest pains...same thing.

    3. Re:Speaking of obfuscated code... by Dannon · · Score: 1

      Y'know, I think I've seen that same function in some code at my office.... Just change the names a bit....

      --
      Good judgment comes from experience.
      Experience comes from bad judgment.
    4. Re:Speaking of obfuscated code... by Anonymous Coward · · Score: 0

      int getHttpPort() throws IllegalArgumentException

      Now that is funny.

    5. Re:Speaking of obfuscated code... by Anonymous Coward · · Score: 0

      If you have chest pains in your eyes, you better see a doctor.

    6. Re:Speaking of obfuscated code... by Quantum+Jim · · Score: 1

      In my experience, code like that often comes about as a programmer is experimenting with a different algorithms (sometimes to fix bugs) and simply forgot to finish refactoring that slice.

      For instance, I once used a byte array of one 1 element as a buffer! The reason was that my previous design overused Java IO streams. The next version (which is much simpler) just modified the bytes directly from a single stream. However, with my brain in "byte" mode I tried to use bytes where I should have used an int. Here's what it looked like (from memory):

      byte[] bb = new byte[1];
      byte buffer;
      while(in.available()) {
      in.read(bb,0,1);
      buffer = bb[0];
      // ...

      and only `buffer` was used in the code block from there onward. After recognizing my mistake, I refactored to use a single integer:

      for(
      int buffer = in.read();
      buffer != -1;
      buffer = in.read()
      ) {
      // ...

      I could have used:

      int buffer;
      while((buffer = in.read()) != -1) {
      //...

      But that form seems to obfusticate the meaning and is harder to read. As you can see, code is often drastically refactored as algorithms are changed. Some things slip through.

      --
      It is impossible to enjoy idling thoroughly unless one has plenty of work to do.
      - Jerome Klapka Jerome
    7. Re:Speaking of obfuscated code... by sconeu · · Score: 4, Funny

      Reminds me of some code... it was in a military system...


      while (strncmp(p," ", 1) == 0)
      ++p;


      To find the first non-space character in a string.

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    8. Re:Speaking of obfuscated code... by syukton · · Score: 1

      I prefer the latter form:

      int buffer;
      while((buffer = in.read()) != -1) { //...

      It reads the easiest, to me. "While the read operation doesn't return -1"

      Since most read operations return the number of characters/bytes read though, I'd probably write it as:

      while ((buffer = in.read()) > 0)

      to give a clearer indication of expecting more than 0 characters/bytes. Maybe I'm just overly used to reading while(read(buf,1024) > 0) statements.

      --
      Reinvent the wheel only at either a lower cost, greater effectiveness, or your own personal enrichment and satisfaction.
    9. Re:Speaking of obfuscated code... by Anonymous Coward · · Score: 0

      That code is funny on so many levels. Not quite as good as my Integer class which I invented several years ago to illustrate how people often take the object-oriented concept too far. Basically, it was a class that contained an int as a member, and of course, if overloaded every operator that can operate on ints.

    10. Re:Speaking of obfuscated code... by Quantum+Jim · · Score: 1

      while ((buffer = in.read()) > 0)

      That wouldn't work, since the null character is still a legit byte. Did you mean:

      while ((buffer = in.read()) >= 0)

      That's why I usually deal with buffer classes and streams for both reading and writing rather than looking at the bytes by hand. :) However, in this case they were overkill for my method.

      --
      It is impossible to enjoy idling thoroughly unless one has plenty of work to do.
      - Jerome Klapka Jerome
    11. Re:Speaking of obfuscated code... by Quantum+Jim · · Score: 1

      while(in.available()) {

      Correction! Actually, the faulty line was:

      while(in.available() > 0) {

      That's what I get for typing from memory...

      --
      It is impossible to enjoy idling thoroughly unless one has plenty of work to do.
      - Jerome Klapka Jerome
    12. Re:Speaking of obfuscated code... by syukton · · Score: 1

      Actually, null characters are used to terminate strings, so if there's one byte left to be read and it's a null character, the read routine would just return a string with length of zero. If it's the EOF character, it would return -1.

      I actually had a problem with the null character recently where somehow one of them ended up in an XML document and my parser was just choking all over it and I couldn't figure out why until I pulled the source into a hex editor the examine all the character codes specifically. A null character and a space look very much the same in Windows' Notepad. If you have a string like "see jack run" and between the k of "jack" and r of "run" there's a null character, you can select the string and copy it, but it doesn't all get into RAM and when you paste it you'll only get up until the end of Jack. Weird huh? The odd copy and paste behavior is actually what alerted me to the presence of the null character...

      --
      Reinvent the wheel only at either a lower cost, greater effectiveness, or your own personal enrichment and satisfaction.
    13. Re:Speaking of obfuscated code... by scavenger87 · · Score: 2, Funny
      Can somebody enlighten a newbie what is wrong with parent's code? Is the following snippet better:
      public boolean compareObjects(Object obj1,Object obj2) {
      return obj1.equals(obj2);
      }
    14. Re:Speaking of obfuscated code... by Quantum+Jim · · Score: 1

      Actually, null characters are used to terminate strings, so if there's one byte left to be read and it's a null character, the read routine would just return a string with length of zero. If it's the EOF character, it would return -1.

      That's true in C, but not in Java. Try this code fragment:

      byte[] bytes = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
      String string = new String(bytes, "UTF-16LE");
      System.out.println(string.length());
      System.out.println("'" + string.codePointAt(1) + "'");

      The first println will output "3" and not "0", even though it is a string of just null characters. You can verify this by the second println, which prints the bytes (as an integer) of the second character. It will ouptut "'0'" too.

      Just one of the advantages of Strings as Objects. Of course, sometimes you just have to dig into the bytes as I did in this project (comments encouraged!).

      --
      It is impossible to enjoy idling thoroughly unless one has plenty of work to do.
      - Jerome Klapka Jerome
    15. Re:Speaking of obfuscated code... by emurphy42 · · Score: 1

      while (1) {
      buffer = in.read();
      if (buffer == -1) break;
      // ...
      }

    16. Re:Speaking of obfuscated code... by sconeu · · Score: 1

      Thanks for modding me up, guys, but the correct mod is "+1 Sad-but-true".

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
  17. Imawhore by Kethinov · · Score: 4, Informative
    Google cache of the main page: http://64.233.167.104/search?q=cache:QecdG73oJ2cJ: www.ioccc.org/main.html+The+International+Obfuscat ed+C+Code+Contest&hl=en&client=firefox-a

    Full text of rules.txt

    18th International Obfuscated C Code Contest Rules

    Copyright (C) 2005 Leonid A. Broukhis, Simon Cooper, Landon Curt Noll and
    Peter Seebach.

    All Rights Reserved. Permission for personal, education or non-profit use is
    granted provided this this copyright and notice are included in its entirety
    and remains unaltered. All other uses must receive prior permission in
    writing from the contest judges.

    Obfuscate: tr.v. -cated, -cating, -cates. 1. a. To render obscure.
    b. To darken. 2. To confuse: his emotions obfuscated his
    judgment. [LLat. obfuscare, to darken : ob(intensive) +
    Lat. fuscare, to darken < fuscus, dark.] -obfuscation n.
    obfuscatory adj.

    GOALS OF THE CONTEST:

    * To write the most Obscure/Obfuscated C program under the rules below.
    * To show the importance of programming style, in an ironic way.
    * To stress C compilers with unusual code.
    * To illustrate some of the subtleties of the C language.
    * To provide a safe forum for poor C code. :-)

    The 18th IOCCC contest window is:

    | 21-Mar-2005 00:00 UTC to 22-May-2005 23:59:59 UTC

    RULES:

    To help us with the volume of entries, we ask that you follow these rules:

    1) Your entry must be a complete program.

    2) The size of your program source must be <= 4096 bytes in length.
    The number of characters excluding whitespace (tab, space,
    newline, formfeed, return), and excluding any ; { or } immediately
    followed by whitespace or end of file, must be <= 2048.

    3) Submissions should be performed using the instructions outlined at,

    | http://www.ioccc.org/2005/submit

    4) If your entry is selected as a winner, it will be modified as follows:

    Your 'build' instructions will be incorporated into a
    makefile. If your build instructions *is* a makefile then
    it should be portable and usable from within a master
    makefile.

    Your program source will be renamed using an identifier of
    our choice (usually your family name or anonymous) followed
    by an optional digit, followed by '.c'

    Your entry will be compiled into a file with the above name
    minus the '.c'.

    If your entry requires that a build file exist, state so in
    your entry's remark section. The makefile will be arranged to
    execute a build shell script containing the 'build'
    information. The name of this build shell script will be your
    entry's title, possibly followed by a digit, followed by '.sh'.

    If needed, your entry's remarks should indicate how your entry
    must be changed in order to deal with the new filenames.

    5) The build file, the source and the resulting executable should be
    treated as read-only files. If your entry needs to modify these files,
    it should make and modify a copy of the appropriate file. If this
    occurs, state so in your entry's remarks.

    6) Your program source must be able to be compiled cleanly by an ANSI C
    compiler, or if there are any compile errors, they must be documented
    in the "remarks" section of your submission.

    7) The program must be of original work. All submitted programs are
    are thereby put in the public domain. All explic

    --
    You're right, I wouldn't steal a car. But if it were possible, I sure as hell would download one!
    1. Re:Imawhore by acaspis · · Score: 1
      :(){ :|:&};:
      Attack of the obfuscated killer penguin ?
    2. Re:Imawhore by Kethinov · · Score: 1

      Unfortunately I can't submit it because it's bash, not C.

      --
      You're right, I wouldn't steal a car. But if it were possible, I sure as hell would download one!
  18. Apologies Mr Watterson: by sshtome · · Score: 3, Insightful

    "With a little practice, language can become a complete impediment to understanding"

    1. Re:Apologies Mr Watterson: by Anonymous Coward · · Score: 0

      Where is that comic? Is it anywhere online? I only saw it outside a prof's door once, and have looked for it in books and online, but have never seen it again.

  19. That pink stuff on the walls... by fm6 · · Score: 3, Funny
    ...is from all the brains that exploded as they tried to grasp that code.

    But what's the point? Why expend all that effort on obfuscating code when there are languages with obfuscation already built in?

  20. Ode to C. by Anonymous Coward · · Score: 5, Funny

    May your signals all trap
    May your references be bounded
    All memory aligned
    Floats to ints rounded

    Remember ...

    Non-zero is true
    ++ adds one
    Arrays start with zero
    And NULL is for none

    For octal, use zero
    0x means hex
    = will set
    == means test

    use -> for a pointer
    a dot if its not
    ? : is confusing
    use them a lot

    a.out is your program
    there's no U in foobar
    And char (*(*x())[])() is a function returning a pointer to an array of pointers to functions returning char.

    1. Re:Ode to C. by ajs · · Score: 1

      You lost me at "?: is confusing"... how is a simple ternary logic operator confusing?!

    2. Re:Ode to C. by Anonymous Coward · · Score: 0

      Some beginner programmers have never seen them and need to look them up. Personally, I use them all the time. Great way to compactly expressing very simple if/else assignments.

    3. Re:Ode to C. by Chemisor · · Score: 1

      > a simple ternary logic operator confusing?

      For the same reason you can't use words like "abstruse" in any modern text. People just don't want to learn their language before insisting on using it.

    4. Re:Ode to C. by ajs · · Score: 1

      You're just trying to be abstruse. ;-)

    5. Re:Ode to C. by Anonymous Coward · · Score: 0
      And char (*(*x())[])() is a function returning a pointer to an array of pointers to functions returning char.
      #define _(__) char(__)(){return*#__;}
      _(a)_(b)_(c)char(i)=0,(*s [])()={a,b,c};char(*(*r())[])(){return&s;}p(char(* (*x(
      ))[])(),int(y)){char(**t)()=(*x());while(y-- )putchar((*t++)());}main(){p(r,3);}
      Result: abc
    6. Re:Ode to C. by Chemisor · · Score: 1

      > You're just trying to be abstruse

      No, I'm trying convey my perspicuous indignation at the tenacity of human ignorance. The ignominy of its apostles inspires enmity and distaste in any reasonable man. Alas, the conundrum of their persistence is unexplainable.

  21. Not many languages could have such a contest by Anonymous Coward · · Score: 4, Insightful
    It does say something about the joy and beauty of C that such a contest is even possible. It says something about "learning from their mistakes" that you couldn't even have a contest like this in Java. You just can't write a valid Java file that is obfuscated to such an extent. A large part of it is that Java has no pointers and everything has to exist within a class.

    Wasn't there some kind of obfuscated vote counting software contest announced before the recent US election? I would like to see some of the entrants into that.

    1. Re:Not many languages could have such a contest by m50d · · Score: 1

      http://developers.slashdot.org/article.pl?sid=04/1 0/16/139230&tid=156&tid=103&tid=133, the site has the results. IME the judging was a bit off, with the rather nice code-embedded-in-a-comment one scoring really low. But some of it's interesting.

      --
      I am trolling
  22. Re:Oh. My. God. by dg41 · · Score: 1

    Gotta blow off steam somehow.

  23. Re:Oh. My. God. by Anonymous Coward · · Score: 0

    Yes you are, you retard.

  24. A tattoo of obfuscated C ... by Crspe · · Score: 5, Interesting

    This I love - One guy went and had the first ever entry in the ioccc (from 1984) tattooed on his forearm ...
    http://tattoo.thomasscovell.com/index.html

    This I also love - the first ever entry was a hello world program!

    That entry was the longest one ever made into a tattoo, however there are hundreds of people around the world who have unknowingly had this entry tattoed on their forearm:
    http://www.de.ioccc.org/years.html#1994_smr

    This is really a great competition - lots of fun, lots to learn. Try understanding how some of the entries work, its really a challenge sometimes, and you can learn plenty about C and the preprocessor.

    1. Re:A tattoo of obfuscated C ... by hugesmile · · Score: 1
      That entry was the longest one ever made into a tattoo, however there are hundreds of people around the world who have unknowingly had this entry tattoed on their forearm:
      http://www.de.ioccc.org/years.html#1994_smr

      wow. I didn't realize that I had that tattoo!

      ...took me a few minutes to figure out why the source wasn't loading. Then I realized that damn Microsoft C loaded it more than 1000 times in the same window!

    2. Re:A tattoo of obfuscated C ... by iamplasma · · Score: 1

      Hahaha, as much as it's bragging, I have to admit I'm the guy who actually sent a picture in to the IOCCC of my forehead reporting that I had a tattoo on 1994/smr on my forehead since long before that Thomas Scovell guy got his tattoo. Nothing beats being told by the IOCCC that you've done an "excellent hack", and I didn't need to write a line of code!

    3. Re:A tattoo of obfuscated C ... by Anonymous Coward · · Score: 0

      that just makes you an Uber-geek. I'm impressed.

    4. Re:A tattoo of obfuscated C ... by Anonymous Coward · · Score: 0

      Too bad he did the tattoo with the wrong font..

  25. Re:Oh. My. God. by Rattencremesuppe · · Score: 3, Funny
    Am I the only that thinks that perhaps the programmers of the world can spend their energies doing something a little...um...i dunno...um...productive?

    Like... posting on Slashdot?

  26. That would be a good joke if Windows were... by Anonymous Coward · · Score: 3, Insightful

    a) a contest

    b) held via Usenet.

    1. Re:That would be a good joke if Windows were... by rubycodez · · Score: 1

      the contest is the OS marketplacem, so now the joke should be 50% funnier to you than it was before

  27. I agree with you. Join us. Join us. by kahei · · Score: 5, Funny


    Unproductive labor is bad. Only productive units can be allowed in hive. Workers who waste energy must be sent to the vats. It is therefore in interests of workers to be productive. To conserve energy. To obey.

    (This message brought to you by the World Utilitarian Council).

    --
    Whence? Hence. Whither? Thither.
  28. Too right! by SweetAndSourJesus · · Score: 3, Funny

    As we all know, programming and fun are mutually exclusive. It's completely inconceivable that someone might have, I don't know, a good time writing code.

    --

    --
    the strongest word is still the word "free"
  29. Yes by AthenianGadfly · · Score: 5, Funny

    Yes, they do have this in Perl. It's called programming.

  30. I've got a good one in the same vein by Anonymous Coward · · Score: 5, Funny

    B: Why did the chicken cross the road?

    A: Windows sucks!

    1. Re:I've got a good one in the same vein by Anonymous Coward · · Score: 5, Funny

      B: Windows NT Chicken:
      A: The Windows NT Chicken is designed to run over the Novell chicken as it crosses the road. Forget about crossing the road with less than 100MB of RAM

      B: Win 95 Chicken:
      A: The Win95 Chicken can cross any given road in eleven different ways, not counting the use of wizards who will actually cross the road for the chicken. If you can remember all eleven ways, you can become a Microsoft Certified Poultry Specialist (MCPS). If you come up with new way for the Windows 95 Chicken to cross the road, you can become a Microsoft Certified Solution Provider (MCSP.) But if you come up with a whole new chicken altogether, then you will become a Microsoft Certified Enemy (MSROADKILL)

      B: Microsoft Chicken (tm):
      A: Already owns both sides of the road and the space in the middle (check out "The Road Ahead", by Bill Gates). The Microsoft Chicken no longer worries about getting to the other side of the road. Its sole hell-bent mission is to somehow install MS Internet Explorer on your hard drive and choke the Netscape Chicken.

      B: Longhorn Chicken
      A: Struts around like it's king, but when it eventually crosses the road, it's indistinguishable from the XP Chicken

    2. Re:I've got a good one in the same vein by Paisley+Phrog · · Score: 1

      Which reminds me of this one....

      If Operating Systems Were Beers:

      DOS Beer:
      Requires you to use your own can opener, and requires you to read the directions carefully before opening the can. Originally only came in an 8-oz. can, but now comes in a 16-oz. can. However, the can is divided into 8 compartments of 2 oz. each, which have to be accessed separately. Soon to be discontinued, although a lot of people are going to keep drinking it after it's no longer available.

      Mac Beer:
      At first, came only a 16-oz. can, but now comes in a 32-oz. can. Considered by many to be a "light" beer. All the cans look identical. When you take one from the fridge, it opens itself. The ingredients list is not on the can. If you call to ask about the ingredients, you are told that "you don't need to know." A notice on the side reminds you to drag your empties to the trashcan.

      Windows 3.1 Beer:
      The world's most popular. Comes in a 16-oz. can that looks a lot like Mac Beer's. Requires that you already own a DOS Beer. Claims that it allows you to drink several DOS Beers simultaneously, but in reality you can only drink a few of them, very slowly, especially slowly if you are drinking the Windows Beer at the same time. Sometimes, for apparently no reason, a can of Windows Beer will explode when you open it.

      OS/2 Beer:
      Comes in a 32-oz can. Does allow you to drink several DOS Beers simultaneously. Allows you to drink Windows 3.1 Beer simultaneously too, but somewhat slower. Advertises that its cans won't explode when you open them, even if you shake them up. You never really see anyone drinking OS/2 Beer, but the manufacturer (International Beer Manufacturing) claims that 9 million six-packs have been sold.

      Windows 95 Beer:
      A lot of people have taste-tested it and claim it's wonderful. Others say its flat. The can looks a lot like Mac Beer's can, but tastes more like Windows 3.1 Beer. It comes in 32-oz. cans, but when you look inside, the cans only have 16 oz. of beer in them. Most people will probably keep drinking Windows 3.1 Beer until their friends try Windows 95 Beer and say they like it. The ingredients list, when you look at the small print, has some of the same ingredients that come in DOS beer, even though the manufacturer claims that this is an entirely new brew.

      Windows NT Beer:
      Comes in 32-oz. cans, but you can only buy it by the truckload. This causes most people to have to go out and buy bigger refrigerators. The can looks just like Windows 3.1 Beer's, but the company promises to change the can to look just like Windows 95 Beer's - after Windows 95 beer starts shipping. Touted as an "industrial strength" beer, and suggested only for use in bars.

      Unix Beer:
      Comes in several different brands, in cans ranging from 8 oz. to 64 oz. Drinkers of Unix Beer display fierce brand loyalty, even though they claim that all the different brands taste almost identical. Sometimes the pop-tops break off when you try to open them, so you have to have your own can opener around for those occasions, in which case you either need a complete set of instructions, or a friend who has been drinking Unix Beer for several years.

      AmigaDOS Beer:
      The company has gone out of business, but their recipe has been picked up by some weird German company, so now this beer will be an import. This beer never really sold very well because the original manufacturer didn't understand marketing. Like Unix Beer, AmigaDOS Beer fans are an extremely loyal and loud group. It originally came in a 16-oz. can, but now comes in 32-oz. cans too. When this can was originally introduced, it appeared flashy and colorful, but the design hasn't changed much over the years, so it appears dated now. Critics of this beer claim that it is only meant for watching TV anyway.

      VMS Beer:
      Requires minimal user interaction, except for popping the top and sipping. However cans have been known on occasion to explode, or contain extremely un-beer-like contents. Best drunk in high pressure developmen

  31. Winner of all times by halleluja · · Score: 4, Funny

    telnet.c

  32. Learnings from the Competition ... by Crspe · · Score: 3, Insightful
    The goals of the competiton are ...
    • To show the importance of programming style, in an ironic way.
    • To stress C compilers with unusual code.
    • To illustrate some of the subtleties of the C language.
    • To provide a safe forum for poor C code. :-)

    They certainly achieve their goal of showing how bad caode can be and also of providing a safe forum for amazing C code.
    I have also learnt much better how to program in C, even for unobfuscated code. There is nothing like going through some of these entries to understand much better how the preprocessor works, and how compilers react to differrent constructs.
    So, the only goal left is that of stressing the C compilers ... does anyone have some good examples of bugs found *and later fixed* in c compilers due to this competition? There are certainly enough evidence of the compilers being crashed, but I wonder if anything positive has come out of it.
  33. Last Year's Winners by ajs318 · · Score: 2, Interesting

    I actually quite liked Hibachi. And not just for the animated logo! You can even run multiple instances on separate ports, and use NAT and port forwarding to get a poor man's virtual server setup.

    I'd recommend you stick to v1.0 {which is actually PD}, for licencing reasons. The v2.8 licence is unnecessarily restrictive.

    --
    Je fume. Tu fumes. Nous fûmes!
  34. Re:Mirrors WITH A CLICKABLE LINK by hugesmile · · Score: 2, Informative
  35. Careful! by braney · · Score: 1

    Running the above will generate different output from the original, due to the extra spaces in the strings (near the top), apparently added by Slashdot. The original is at 2004/gavare.c (relative to one of the IOCCC mirrors).

    It's a great program; one that has been distracting me since March 1st!

    --
    Let me know if you have an open postdoc position. -braney
  36. Re:I agree with you. Join us. Join us. by Touisteur · · Score: 0

    Go talking to Nils HellStrom... He would tell you how far your are from reality.
    Workers in the hive only work. They are selected at birth to be workers. And bad workers won't be sent to the "cuve", because of their weakness (being bad workers). It's not that unproductive labor is bad, it's that in the hive every work is productive.
    Well, on a such geeky website, I'd never had imagined telling someone : "Go back first school reading Herbert" =o)

  37. Who thinks.... by 10101001011 · · Score: 4, Funny

    We ought to submit the code for WIndows?

  38. Re:Maze of Code - Does NOT work with Visual Studio by AhaIndia · · Score: 1

    The instruction at "0x00401234" referenced memory at "0x0042202d". The memory could not be "written".

    Click on OK to terminate the program
    Click on CANCEL to debug the program

    OK Cancel

    --
    ~Aha~
  39. Offshore winners by Anonymous Coward · · Score: 0

    Wow! I'll be sure to send this to the guys at the Indian delivery team my company is using. I am quite sure I could find a winner there!

    / Anonymous Architect Guy

  40. Re:Maze of Code - Does NOT work with Visual Studio by Anonymous Coward · · Score: 0

    Use a real compiler that understands -fwritable-strings

  41. Comment removed by account_deleted · · Score: 0, Redundant

    Comment removed based on user account deletion

  42. Re:the joke's on Gassee by michaeldot · · Score: 3, Insightful

    Whoosh! I'll explain the scenario:

    No one knew the answer to the quiz question. When it became obvious no one was going to respond, Gassée decided to be facetious with that smug we're-better-than-everyone-else 1980s hubris that would later bring "old Apple" to its knees ("we're so cool we don't need to think about modernizing our OS architecture - you'll never be as good as us").

    It's hardly surprising Gates had no pity for Apple during the "GUI OS war" and probably relished seeing that smug attitude pounded into the dirt.

    And it's very fortunate for Apple that when Jobs returned to save it from bankruptcy, he took a groveling stance towards Gates and told the fanboys, "Microsoft is not the enemy. For Apple to survive, we have to do a really good job." A much better attitude than a smartass remark designed to antagonize an extremely powerful man.

  43. OMG by Hobbex · · Score: 3, Funny

    This clearly has no hacker cred what so ever if Visual Studio won't compile it!

    (Real men use visual basic!!!!)

  44. Re:Maze of Code - Does NOT work with Visual Studio by proverbialcow · · Score: 2, Informative

    Worked beautifully for me using gcc, like so:

    gcc -fwritable-strings -o maze maze.c

    --
    The only surefire protection against Microsoft infections is abstinence. - The Onion
  45. Breaks the rules alas by Anonymous Coward · · Score: 0

    ..
    Rule 7. No one shall submit code that contains swear words in the comments.

    and this

    Rule 13. No one shall submit code that was developed with the help of Satan or any of his little helpers.

  46. Not only did you post it way too late by Anonymous Coward · · Score: 0

    You didn't even get it right, tard.

    C:\DOS
    C:\DOS\RUN
    RUN\DOS\RUN
  47. I wrote this to my (girl) friend by nsupathy · · Score: 3, Funny

    And she never replied back. Of course she knew programming.

    int ec(int c){return c-5;}
    void dc(char *s){if(*s){putchar (ec(*s));dc(s+1);}}
    int fp();se(f){f&1?fp():f&2?
    fp2(): f&4 ? fp3():0;}
    fp(){char t[4] = "";dc("N%fr%ytt%ynwji%ytif~33%|fsy%f%ltti%mtrj%rfi j%yjf%gjktwj%mjfinsl%mtrj$");putchar(012);dc("Nx%n y%utxxngqj%ytif~D%`~jx4stb%");gets(t);(!strcasecmp (t, "yes"))?
    se(2):se(4);}
    fp2(){char s[21]="";dc("|mfy%ynrj%hfs%N%iwtu%nsD%");gets(s);
    dc("N%|nqq%gj%ymjwj%g~%");puts(s);dc("Ymfsp%~tz") ; }
    fp3(){dc("N%fr%xt%xfi33333%");dc("Fs~|f~%ymfsp% ~tz %ktw%wzssnsl%ymnx");
    putchar(012); }
    main(){se(1);}

    --
    #include std_disclaimer.h
  48. Submitting SCO code? by mnmn · · Score: 1

    Ive seen obfuscated DVD decryption code..

    But what happens if someone submits obfuscated SCO code? Heck, what happens if someone submits code that used to be proprietary? Noone really checks, and say the code gets printed on T-shirts and the like, and is discovered by the owners, wonder what the consequences will be.

    I'll just send my sendmail.cf

    --
    "Give orange me give eat orange me eat orange give me eat orange give me you." -Nim Chimpsky
  49. Re:Oh. My. God. by Random+Web+Developer · · Score: 1

    All work and no play....

    Seriously if I see what most people do for the play part, watching TV, reading slashdot, .... I think this is one of the more useful pastimes, at least these people learned something while having fun.

    It's not like most people are productive 16 hours a day (or more if they sleep less than 8 hours).

    --
    Artists against online scams http://www.aa419.org/
  50. oxymoron by SQLz · · Score: 0

    "Obfuscated C Code"

  51. Re:Maze of Code - Does NOT work with Visual Studio by lachlan76 · · Score: 1

    He said to compile with "-fwritable-strings".

    I don't know if VC has an option for it, but what it does is allow you to write to string constants. Without it, it will segfault.

  52. A more interesting contest of skill by beforewisdom · · Score: 1

    Many people can write code, fewer people can write good code.

    The many who do not write good code also produce obfuscated code without even trying. This is particularly true with large projects, done by groups, over time, and with limited oversight.

    Another interesting contest would be to see how fast different people could figure out such code.

  53. Re:Maze of Code - Does NOT work with Visual Studio by ajs · · Score: 1

    Yep, that's why you need -fwritabe-strings in gcc. Old C compilers (remember this was written almost 20 years ago) let you write to constant strings (that is to say, they weren't constant in the first place). MSVS probably has an option for this.

  54. Great! by Lisandro · · Score: 1

    I've been wanting to get a cool tatoo for a while now...

    1. Re:Great! by woah · · Score: 0

      Nah, it's crap. Plus it's just a hello world program with the "hello world" bit clearly visible in the code.

  55. When are we going to see... by HomerJayS · · Score: 0, Troll

    A NON-obfuscated Perl contest?

  56. Another idea by gordlea · · Score: 1

    I've always thought that slashdot should hold an obfuscated english contest...

    --

    Choose yer poison: Prophets or Profits

  57. For the C-impaired: by Anonymous Coward · · Score: 0
    This should be the output (I didn't test it, so no guarantee):
    I am too tired today.. want a good home made tea before heading home

    Is it possible today? [yes/no]
    If the user now enters "yes" (and exactly that!), it will give you:
    what time can I drop in?
    Getting a 21-character string...
    I will be there by
    Said 21-character string...
    Thank you
    Any other answer above would have spawned this:
    I am so sad.....
    Anyway thank you for running this
    (Linebreaks added after each string, /.-inserted spaces removed)
  58. obligatory link by gklnx · · Score: 0
  59. Finally.. by mattr · · Score: 1

    Looks like line noise.

  60. Re:Funny.... by Anonymous Coward · · Score: 0

    I always thought slashdot was an obfuscated english contest!

  61. I like the bubble sort. by kingj02 · · Score: 1
    Just enter 10 integers:
    int main(void){int v,w,x,y,z[10];for(v^=v;
    v<0xa; ++v)scanf("%d", &z[v]);for(v=v&~v;v
    <0012;v++)for(w=v,++w;w<0xA;w ++)z[v]=(z[v]
    >z[w])? z[v]=~ (z[v]& z[w])& (z[v]|z[w]),z
    [w]=~(z[w]& z[v])& (z [v]|z[w ]),(z[w]|z [
    v])&~(z[v]& z[w]):z[v] ;for(v^=v; v<w;v++)
    printf("%d\n", z[v]);return 0;}
    --
    Ardente veritate incendite tenebras mundi
  62. Is it just me... by Minute+Work · · Score: 2, Funny

    ...or did any other web developers get their wires crossed when they read "18th International" and thought this had something to do with "I18N"?

  63. You want obfuscated? by prakslash · · Score: 3, Informative

    Try this:

    Whitespace

    It is so obfuscated, you cannot even see it!

    1. Re:You want obfuscated? by m50d · · Score: 2, Interesting

      It's pretty simple really though, you just have to convert it and then you've got your basic language, as long as you can handle stack-based programming it's a breeze. Ook is more to my liking.

      --
      I am trolling
  64. Update: Contest has been cancelled by MarkGriz · · Score: 0, Redundant

    Someone submitted the leaked Windows source code.

    Microsoft has been declared the winner.

    --
    Beauty is in the eye of the beerholder.
  65. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  66. But C++... by rbarreira · · Score: 1

    On the other hand, I think such a contest for C++ would produce even more obfuscated code than IOCCC. Think about what could be done with just:

    - operator overloading
    - multiple inheritance...

    --

    The AACS key is NOT 0xF606EEFD628B1CA427BEA93A9CA9773F
    1. Re:But C++... by roemcke · · Score: 1

      You forgot templates.

      There is no better way to secure your job than using a lot of templates in your code....

    2. Re:But C++... by Anonymous Coward · · Score: 0

      On the other hand, I think such a contest for C++ would produce even more obfuscated code than IOCCC. Think about what could be done with just:

      - operator overloading
      - multiple inheritance...


      If you think those can obfuscate code better than the preprocessor, you truly have no clue.

    3. Re:But C++... by rbarreira · · Score: 1

      If you think C++ doesn't have a preprocesor too, YOU have no clue.

      --

      The AACS key is NOT 0xF606EEFD628B1CA427BEA93A9CA9773F
  67. Appropriate forum by LPetrazickis · · Score: 1

    Actually, you should submit all unintentionally horrible code to The Daily WTF instead. Great site.:)

    --
    Is this a sigs-optional kind of place? 'Cause I am totally down with that if you know what I mean.
  68. Because verbing weirds language (n/t) by Anonymous Coward · · Score: 0

    Stuff.

  69. Re:Rawr by Ohreally_factor · · Score: 1

    Dude, where's my code?

    --
    It's not offtopic, dumbass. It's orthogonal.
  70. s/Oxymoron/Redundancy/; by LPetrazickis · · Score: 2, Informative

    "Military Intelligence" an "Microsoft Works" are oxymora. "Dead Corpse" and "Obfuscated C Code" are redundancies. Hope that helps. Have a nice day.^-^

    --
    Is this a sigs-optional kind of place? 'Cause I am totally down with that if you know what I mean.
    1. Re:s/Oxymoron/Redundancy/; by SQLz · · Score: 1

      Your mom goes to college.

  71. PI = E by keysman · · Score: 1

    I remember one from years and years ago that I believe was published in Dr. Dobbs. It as a C source listing that had all kinds of 3.14s etc in it and the code was literally formatted to look like pi, however it calculated e. Does anyone remember it or have it?

    1. Re:PI = E by banz23 · · Score: 1

      e can be calculated using pi, which is probably why pi was located throughout the code. e^(i*pi) + 1 = 0 more than likely it was running this equation: sum n from 1 to infinity (1/n^2 * cos(9/(n*pi + sqrt(n^2*pi^2 - 9)))) = - pi^2 /(12*e^3) = -0.040948222... If the program contained the value of pi in it, I think it should scream to you that the program doens't calculate pi.

  72. Contest Over? by Anonymous Coward · · Score: 0

    Um, what is the point of this ?

    Posted by timothy on Wednesday March 23, @02:19AM
    Contest Over: 22-May-2005 23:59:59 UTC

    Could you give me some warning next time?

  73. Re:Rawr by Anonymous Coward · · Score: 1, Funny

    Linux which can do endless loops in 6 seconds.

    That article you linked is ten years old, I really think Linux have improved since then.

  74. Re:Maze of Code - modifications for Visual Studio by Anonymous Coward · · Score: 1, Informative
    To make this run under Visual Studio, you have to make a couple of changes:

    First you have to make your own definition of rand() because Windows' rand() only returns 15 bits worth, and the program will be very boring if you don't extend the range. Next, to get around the -fwritable-strings issue, try using char M[3] = "%d" instead of char* M and M = "%d". Your code will look something like:
    #define rand2() ((rand()<<30)|(rand()<<15)|rand())
    char M[3]="%d",...scanf(M,&C);
    ...
    |6<<27<rand2()...
    These changes work under Visual C++ 6.0.

    p.s. It would also work to put M[3] = "" and use scanf("%d",&C).
  75. Re:Contest is NOT Over by Anonymous Coward · · Score: 0

    Posted by timothy on Wednesday March 23, @02:19AM
    Contest Over: 22-May-2005 23:59:59 UTC

    Troll much lately?

  76. Re:Rawr by Anonymous Coward · · Score: 0

    Well, unless of course a serious error occurs in Hell, raising an exception at which point you simply "resume next".

  77. Re:the joke's on Gassee by MrBlackBand · · Score: 0, Flamebait

    Don't forget to wipe your chin when you're done. Mr. Gates doesn't like it when you dribble afterwards.

    --
    "It is difficult to get a man to understand something when his salary depends upon his not understanding it."
  78. 2005 International Obfuscated Ruby Code Contest by OSXexpert · · Score: 1

    Well, it would seem there is a Ruby IORCC contest as well, with over 1000 USD in prizes and big name sponsors. I can't help but imagine which contest they got their brilliant ideas from :) I would know, I'm shamelessly plugging the IORCC. http://iorcc.dyndns.org/ Looks promising, entry window ends at the end of this month. Enjoy

    --
    --- Old Time NeXThead
  79. I must be a pussy then.... by Anonymous Coward · · Score: 0

    Always willing, and never rejected.
    I don't mind being called a pussy..

    R.C.

  80. Slashdotted by sbszine · · Score: 1

    Once upon a midnight dreary,
    while I websurfed, weak and weary,
    Over many a strange and spurious
    website of hot chicks galore,

    While I clicked my fav'rite bookmark,
    suddenly there came a warning,
    And my heart was filled with mourning,
    mourning for my dear amour.
    'Tis not possible, I muttered,
    give me back my cheap hardcore! --

    Quoth the server, "404".

    --

    Vino, gyno, and techno -Bruce Sterling

  81. Holy crap by Sloppy · · Score: 1

    I'm not worthy.

    --
    As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.