2004 IOCCC Winners Source Code Released 175
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 ;)
frist? (Score:5, Funny)
printf("frist prost");
}
Re:frist? (Score:1, Funny)
Re:frist? (Score:3, Insightful)
Re:frist? (Score:2, Interesting)
Re:frist? (Score:1, Informative)
This has nothing to do with C89 or C99. The only standard-compliant forms of main are those that return 'int', regardless of which C standard you are talking about. Also, the -std argument to gcc is not sufficient to make it a standard C compiler. RTFM [gnu.org].
Re:frist? (Score:2, Informative)
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!
Re:frist? (Score:2)
Re:frist? (Score:1, Funny)
Objective.
Obfuscation.
Efficiency.
Re:frist? (Score:2)
Re:frist? (Score:2)
Re:frist? (Score:3, Insightful)
Re:frist? (Score:2)
Re:frist? (Score:5, Insightful)
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.
Re:frist? (Score:1, Informative)
Re:frist? (Score:4, Informative)
_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.
Re:frist? (Score:2)
Good point.
Re:frist? (Score:1)
No. main() can take argc, argv pair: int main(int argc, char *argv[])
or no arguments: int main(void).
Re:frist? (Score:1, Offtopic)
obfuscated server (Score:5, Funny)
Its so obfuscated that I cant even see it!
ahhhhhh its finally shown up.
Doesnt bode well though.
The value of not being seen (Score:5, Funny)
Re:The value of not being seen (Score:2)
ouch (Score:3, Interesting)
Re:ouch (Score:1, Offtopic)
Re:ouch (Score:5, Insightful)
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.
Re:ouch (Score:2)
Re:ouch (Score:2)
Article text? (Score:2)
Re:Article text? (Score:2)
Big deal (Score:5, Funny)
That's nothing (Score:1, Funny)
Free iPod Photo [freephotoipods.com] | Free Flat Screens [freeflatscreens.com] | It really works! [wired.com]
Re:Big deal (Score:1)
> the compiler couldn't understand it, let alone humans...
The trick is to write the code so that the compiler understands it in a
completely different way from any human reader, so that, upon seeing the
output, the poor human goes, "How does it DO that? This code shouldn't
get that result... heck, it shouldn't even compile!"
Re:Big deal (Score:2)
"Hey! Why's that Hello World program running a four function calculator?"
That would be really cool, in a stupid sort of way.
great performance (Score:1)
Re:great performance (Score:2)
Follow up story. (Score:5, Funny)
More C-related sillyness (Score:2, Interesting)
Oh the irony (Score:5, Funny)
Does the OSTG try to be subtle or what?
Re:Oh the irony (Score:1)
Mirrors (Score:5, Informative)
Re:Mirrors (Score:1)
Re:Mirrors (Score:1)
www.tw.ioccc.org [ioccc.org]
Australia and other Pacific
www.au.ioccc.org [ioccc.org]
Europe
www.de.ioccc.org [ioccc.org]
www.es.ioccc.org [ioccc.org]
www.gr.ioccc.org [ioccc.org]
North America
www0.us.ioccc.org [ioccc.org]
www1.us.ioccc.org [ioccc.org]
Re:Mirrors (Score:1)
clueless submitters (Score:4, Interesting)
Re:clueless submitters (Score:5, Funny)
<runs>
Re:clueless submitters (Score:5, Interesting)
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.
Mirror of source tarball (Score:2)
please don't kill me
Re:Mirror of source tarball (Score:1)
Time to brush up on your l33t coding skills (Score:5, Funny)
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.
Re:Time to brush up on your l33t coding skills (Score:2)
Code maintanence is a business consideration, not one for computer scientists.
Re:Time to brush up on your l33t coding skills (Score:2, Funny)
Re:Time to brush up on your l33t coding skills (Score:2)
Class
class
CLASS
c1ass
Classe
classe
cas
Case
CASE
all in the same code.
Obfuscated webserver (Score:4, Funny)
Re:Obfuscated webserver (Score:3, Informative)
Re:Obfuscated webserver (Score:3, Funny)
I bow and commit seppaku in honor of your programming prowess.
Every day (Score:5, Funny)
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.
Re:Every day (Score:3, Funny)
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 [sourceforge.net]
I just hope the XGen development team has a good sense of humor...
Re:Every day (Score:3, 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.
Re:Every day (Score:2)
"It[Xgen] is also an open source project so you could see the source code."
Right. Next thing you'd be linking to goatse.cx.
Re:Every day (Score:2)
Hahaha...
Good comeback.
Official IOCCC mirrors (Score:3, Informative)
Asia
Australia and other Pacific
Europe
North America
ugh. (Score:2)
Double-rot-13 obfuscation!
Re:ugh. (Score:1)
Mirrors ... (Score:5, Informative)
also tw, au, es, www1.us
CC.
Wow, that's the ultimate obscuring.... (Score:2, Funny)
OK Mr Supar Comuputar (Score:5, Funny)
This is coming from the dingus behind slashcode.
Another mirror (Score:3, Informative)
Simple trick for beginners (Score:5, Funny)
Re:Simple trick for beginners (Score:2)
Re:Simple trick for beginners (Score:2)
The A1h's (that some assemblers would take as a hex value A1) should remind one to also use these strings as hex constants: 0xA1, 0xB1, and of course have idenfifiers starting with the letter O as OxA1, OxBl, Oxe4c. (okay, I had to use a little hac|3r 5p33|k - hmm, don't recall seeing any of that in these entrie
Re:Simple trick for beginners (Score:1)
Re:Simple trick for beginners (Score:5, Interesting)
Examples: etc.
Size does matter! (Score:5, Interesting)
xxxxxxxxxxxxxx = xxxxxxxxxxxx + xxxxxxxxxxxxxxxxxxxxx / xxxxxxxxxxxxxxxx;
Makes sense, doesn't it? And it works with every letter of the alphabet too!
Re:Simple trick for beginners (Score:2)
For ease of writing such horrid code, I recommend the Bistream Vera Sans Mono [bitstream.com] typeface. All those characters can be distinguished from each other, and there are bold, italic and bold-italic variants for your syntax highlighting needs. Just because you want to confuse and antagonise your fellow cow-orkers do
Is This Necessary? (Score:5, Funny)
Re:Is This Necessary? (Score:2, Informative)
Oh noooooo (Score:3, 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!
Gotta love it. (Score:4, Funny)
Even more obfuscated code (Score:3, Funny)
Ugh.
IOC code? (Score:2, Funny)
Obfuscation of the English language (Score:1)
I've never had more than one thought GOES out anywhere. Perhaps it is time for a language obfuscation contest.
Re:Obfuscation of the English language (Score:1)
mkentry.c? (Score:2)
Imagine my surprise when I found out that this was supposed to be normal, radable code.
Re:mkentry.c? (Score:2)
Centrinia (Score:3, Interesting)
Re:Centrinia (Score:1)
Re:Centrinia (Score:2)
I still don't agree with it at all :-/
Re:Centrinia (Score:2)
dlopen
ever heard of either of them?
Re:Centrinia (Score:2)
Inline Article Links (Score:1)
I'm sure it'll save a few expensive phone-calls.
A tutorial (Score:3, Interesting)
text formatting? please. (Score:2)
i mean, realistically, how hard is it to strip out white space in vi or some other editor that has find/replace? once the white place is gone, place tabs as appropriate.
real obfuscation comes from indecipherable variable names, unused variables, complex algorithms that accomplish no more than simple iteration, etc.
besides, the best way to write obfuscated code in C
hee hee (Score:1)
My Contribution (Score:3, Funny)
Re:Great article summaries lately... (Score:3, Informative)
This groups releases a challenge each year that the entrants have to solve using the most obfuscated [reference.com] 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.
Re:Great article summaries lately... (Score:5, 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 [gerlich.nl]. 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.
Re:Great article summaries lately... (Score:1)
But seriously that is very impressive.
Re:Great article summaries lately... (Score:3, Informative)
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 (
Re:Great article summaries lately... (Score:2)
I actually thought it was clever how the story on an obfuscated coding contest was, iteself, obfuscated.
Re:Mirror this already! (Score:5, Informative)
There are several mirrors. I know, I run one of them. Why the submitter hardcoded the us one is beyond me.
none yet
none
SETI [seti.org] is looking for some sites
none
Re:nethack/vi keys for arachnid (Score:2)