×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

21st IOCCC Source Code Released

timothy posted about a year and a half ago | from the but-you-can't-read-it dept.

It's funny.  Laugh. 24

First time accepted submitter johntromp writes "Source code for the 21st International Obfuscated C Code Contest was released last weekend, following announcement of the winners on Sep 30, and just over a month after the submission window closed on Sep 14, a new speed record for the judges. Happy source code browsing!"

cancel ×
This is a preview of your comment

No Comment Title Entered

Anonymous Coward 1 minute ago

No Comment Entered

24 comments

OS doesn't matter. (1, Offtopic)

SolitaryMan (538416) | about a year ago | (#41711717)

This is one of those cases where opening the source does not really mean anything.

Surprisingly cool Re:OS doesn't matter. (4, Interesting)

Fubari (196373) | about a year ago | (#41712053)

Surprisingly cool stuff; the hint files of the various entries [ioccc.org] are worth a look too. For example, this is from the zeitak/hint.html [ioccc.org] entry:

Selected Judges Remarks:

This is an extremely subtle and twisted piece of Gold award winning code!

The judges had spent a considerable amount of time analyzing this entry. At one point we spent 18 minutes just to understand 18 key characters of this code.

The file zeitak_deobfucate.c provides a version that has been slightly deobfuscated. You may find reading that file helpful in your attempt to understand this extremely subtle entry.

Author’s comments:
Nesting Errors Detector

What does it do
As you have probably understood by looking at the source*, this program has something to do with parenthesis (and equality of opening and closing parenthesis, if you look close enough). It goes over the file given to it and checks that every opening (, [, or { has a matching closing one and vice versa. It also checks that every “ or ‘ is closed.

If an error is detected, an error message will be printed. If the problem is a superfluous closing bracket, it will even print a few characters around it’s position.

Make sure you view the source with 4 spaces tab width.

Features
Ignores parenthesis inside strings or character constants, so no errors will be detected in the following line:

printf(")");

Doesn’t get confused by the 1984/anonymous entry!

Mis-Features
Escapes (e.g. \") are ignored, so the following line will produce an error:

printf("\"");

Obfuscation
IOCCC winners already contain entries without digits, control-flow keywords and certain operators in their source. This entry has an even more limited source, that is:

Without any digits.
Without any character constants.
Without using functions from headers other than stdio.
Without any control-flow keywords (not even the ?: operator).
Without any arithmetic or logic operators!

Re:OS doesn't matter. (0)

Anonymous Coward | about a year ago | (#41714519)

Why doesn't the operating system matter?

I looked at some of the source files (1)

Anonymous Coward | about a year ago | (#41711765)

That is just nuts. Must be a bitch to debug.

Re:I looked at some of the source files (2)

utkonos (2104836) | about a year ago | (#41711809)

I thought bugs were a requirement for entry, the more spectacular, the better.

KC GetTogether + This one's going out to 10CC fans (0, Offtopic)

Anonymous Coward | about a year ago | (#41711817)

I'm not in love
So don't forget it
It's just a silly phase I'm going through
And just because
I call you up
Don't get me wrong, don't think you've got it made
I'm not in love, no no, it's because

I like to see you
But then again
That doesn't mean you mean that much to me
So if I call you
Don't make a fuss
Don't tell your friends about the two of us
I'm not in love, no no, it's because..

I keep your picture
Upon the wall
It hides a nasty stain that's lying there
So don't you ask me
To give it back
I know you know it doesn't mean that much to me
I'm not in love, no no, it's because..

Ooh you'll wait a long time for me ...

Hey, that's one cool stuff (-1)

Anonymous Coward | about a year ago | (#41711999)

Yea.

Underhanded was always more interesting (5, Interesting)

monkeyhybrid (1677192) | about a year ago | (#41712149)

Very clever stuff but I always found The Underhanded C Contest [xcott.com] much more interesting. Sadly the last one of those was in 2009. I'd love to see that return.

Re:Underhanded was always more interesting (1)

dotgain (630123) | about a year ago | (#41713219)

It seems the results of the 2009 contest weren't even announced, which is a pity.

Re:Underhanded was always more interesting (0)

Anonymous Coward | about a year ago | (#41717631)

I second that I've seen code from one year where it has line by line commentary and I still had to read the whole thing at least three times to see where it all went "wrong."

First impressions (3, Informative)

chebucto (992517) | about a year ago | (#41712523)

I've only glanced at the files, and I'm far too amateur to understand them. That said, it seems at first glance that a bit too many of the entries relied in part on turning code into ascii art. There was an entry a few years ago that calculated pi by the shape of the source file code, that was neat.. but if the whitespace is there just to look cool and break up lines, then that part of the obfuscation is 2nd rate obfuscation, in my not so well deserved opinion. Still, very very good to see the IOCCC make quick work and bring us the goods.

Re:First impressions (1, Insightful)

Anonymous Coward | about a year ago | (#41712863)

When you said: "I've only glanced at the files, and I'm far too amateur to understand them" you should have stopped right there. The fact that you don't understand then should have been your clue that your so-called "at first glance" was steeped in ignorance. From there you compounded your ignorant post with even more uninformed dribble. And the fact that your post was rated "4, Informative" shows that there exist too many /. folk with rating points who rate ignorant postings like your post with the most bizarre attributes.

Go study the one-liner and understand what it does and how it works. That will be a warmup. Now take something such as the "Conway game of death" and deconstruct how it works. Finally the to convert the amazing parenthesis matcher into well document documented C code and the. Modify it not be confused by strings such as \".

When you can grok IOCCC code to that level, then post your opinion about ASCII art and obfuscation. But until you can, try to post fewer ignorant dribble and spend more time learning to correctly evaluate code.

Re:First impressions (1)

mrvan (973822) | about a year ago | (#41713305)

Yeah... I have to admit even the 'deobfuscated' versions of the source code are gibberish to me, so it is quite obvious that the ascii-art is nothing more than icing on the cake.

Re:First impressions (1)

DMUTPeregrine (612791) | about a year ago | (#41717701)

In general the ascii-art transformation is done after the code is written, it's just a fun thing to do that won't confuse the judges at all (they're sure to run it through a code-beautifier/auto-indenter and otherwise remove the art.)

Re:First impressions (1)

PuZZleDucK (2478702) | about a year and a half ago | (#41773609)

When you said: "I've only glanced at the files, and I'm far too amateur to understand them" you should have stopped right there.

Seriously?!?! just because I've never built a bridge, I can't say "that bridge could be better"

The guy qualified his oppinions and asked people for more information (and didn't post as AC). I see no problem. Keep it up chebucto.

Also thanks to DMUTPeregrine below who actualy addresses the issue (I was curious too).

Re:First impressions (1)

hankwang (413283) | about a year ago | (#41714631)

it seems at first glance that a bit too many of the entries relied in part on turning code into ascii art.

If you have been hacking for a week to squeeze a complex program into 2 kB (excluding whitespace), which by itself will lead to hard-to-read code, then spending another half hour on creative formatting is just the icing on the cake. Actually, the contest rules state that ascii obfuscation doesn't count towards the scoring; the jury will run it through a C beautifier anyway.

That said, the program endoh2 generates an ascii-art obfuscated program. The program 'deckmyn' uses the white space in the source code as data.

I find it pretty impressive what the authors manage to squeeze in tiny programs. Notable things in previous years that I remember include a C compiler and an x86 virtual machine, if I recall correctly. This year, the 'tromp' program is an interpreter - although I don't fully get what it does. :-)

Too bad that this slashdot story draws so few comments.

Make sure to read the Makefiles as well. (0)

Anonymous Coward | about a year ago | (#41713343)

These aren't the droids you're looking for Mr. Spock!

Redundant (-1)

Anonymous Coward | about a year ago | (#41713357)

You mean it's an International C Code Contest?

who needs a contest; go to any university (2)

ardiri (245358) | about a year ago | (#41713367)

... while i've always been a fan of IOCCC contests, when i was teaching C programming - most of the students source code could be considered entries to such a competition :) gone are the days where we used to write clean, understandable code. i always joke when doing presentations about the fact that the reason why most people are afraid of C as a programming language is because other people write horrible C.. if you write good, clean, understandable C - it is an excellent language :)

Obfuscated webpage (2, Insightful)

wonkey_monkey (2592601) | about a year ago | (#41713391)

Who the hell thought blue links on a dark green background [ioccc.org] was a good idea?

Re:Obfuscated webpage (0)

Anonymous Coward | about a year and a half ago | (#41722409)

That was a mistake.

This happened due to a combination of "apache2", "mod_autoindex" with a ReadmeName set to README.html instead of FOOTER.html and publishing the 2012 results that included a README.html.

I've now fixed it. SimonC.

endoh2.c (1)

David89 (2022710) | about a year ago | (#41714129)

I didn't look at all the entries, but endoh2.c is beautiful!!

Re:endoh2.c (1)

bmsleight (710084) | about a year ago | (#41714975)

It is a thing of beauty. OMG - that is real skill.

Author’s comments:
Yeah, “Again”. Sorry. But I don’t feel guilty or uncomfortable.

This entry is based on ‘over-used themes’ such as self reproducing program and pi or e computation. I know you’re tired of them.

But have you ever seen all-in-one?

Check for New Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Sign up for Slashdot Newsletters
Create a Slashdot Account

Loading...