IOCCC Winners Announced 175
Arachn1d writes "The IOCCC has finally announced the winners of the 2004 contest.
With winners this year including a mini-OS and a ray-tracer, the submissions should be interesting indeed - if you can make sense of them. According to the page, the actual code for the winners should be up mid-october."
With winners this year including a mini-OS and a ray-tracer, the submissions should be interesting indeed - if you can make sense of them. According to the page, the actual code for the winners should be up mid-october."
Obfuscation (Score:5, Informative)
It's all about how to obfuscate [demon.nl] baby!
Re:Obfuscation (Score:5, Interesting)
http://p-nand-q.com/python/lambdaizing_quicksort.
Re:Obfuscation (Score:2)
print (lambda A,D,B,C,E,F,G,H,Q:"\n".join(["".join([(Q[int(
__
(x[0]+1,x[1]**2+y[1]) or x,[(0,complex(r/B,i/B))]*A))[0]+1)
)%len(Q)]) for i in range(F*B,G*B,H)]) for r in range(C*B,
E*B,H)]))(1500,4,100.0,-2.25,1.5,-1.2
I know there's no way this is getting past the lameness filter.
This is *not* ovuscation (Score:3, Interesting)
Remember to remove the whitespace
Re:This is *not* ovuscation (Score:2)
2) You're using a regex.
I can't really compete with that.
Re:Obfuscation (Score:4, Informative)
Thwart Reverse Engineering of Your Visual Basic
Re:Obfuscation (Score:4, Informative)
How to obfuscate in copious detail.
How to write unmaintainable code [mindprod.com]
Re:Obfuscation (Score:2)
Re:Obfuscation (Score:4, Funny)
Re:Obfuscation (Score:2)
Re:Obfuscation (Score:3, Funny)
Re:More tricks (Score:5, Interesting)
If you use the trick of storing all of your data in one huge 'array', try to overlap anything you can get away with overlapping. For example, if you have a constant whose most significant byte is the same as the least significant byte in a string, there's not sense in storing that byte twice.
While not allowed in IOCCC itself, try mixing your C with a language that's even more incomprehensible than C. I had good luck with writing a C program that sent PostScript code to a printer and having all the real work be done in the PostScript code.
Re:More tricks (Score:2)
So, for example, if the most significant byte of a single command was shared with the least significant byte of another.. they could jump into the middle of another instruction. Crazy.
Re:More tricks (Score:2)
One of the craziest hacks I've heard of was in an article by this guy who was hired to make some changes to an early calculator design. The calculator used a spinning magnetic drum for storage, a head that could read and write at the same time, and a buffer. It seems the original designer had extended the working memory of the machine by reading the 'OS' into the buffer while the head wrote data. The calculation would then have to finish in one revol
Re:More tricks (Score:3, Interesting)
The real problem is lack of documentation, and it's a pro
Re:More tricks (Score:2)
=D
Really, I didn't even really have a good idea of what a closure was until I learned to use them in Perl. It just seemed natural in Scheme. Sort of like how I didn't really understand certain parts of English grammar until I started learning other languages, even though I could use them fluently.
Re: Obfuscation (Score:2, Funny)
> For those who don't know what this is all about...
Darn. I clicked it in hopes of seeing pix from the International Olympic Committee Contortionist Competition.
> It's all about how to obfuscate baby!
Was the article text one of the contest entries?
Umm (Score:3, Interesting)
Seriously, a sentence or two of information in the submissions doesn't hurt.
Re:Umm (Score:5, Funny)
Maybe that's the whole point. Everything (including the article) is well... obfuscated.
Re:Umm (Score:3, Funny)
Apparently even the web site is obfuscated now.
Re:Umm (Score:5, Funny)
Time to turn in your geek card... (Score:5, Funny)
Please hand in your Geek membership card on your way out. Thank you.
Re:Time to turn in your geek card... (Score:2)
Do I get to turn in my virgin card as well?? Please say its so!
Re:Time to turn in your geek card... (Score:5, Insightful)
To be able to make something like that, you need to be able to understand the language well, which is a good thing.
Re:Time to turn in your geek card... (Score:2)
Re:Time to turn in your geek card... (Score:4, Funny)
I got a resume from some kid just out of University. He attached some samples of the code he wrote. One of them was the perennial "calendar" app that I think we all were tasked to write.
Anyhow, I was perusing the code. It was pretty sloppy, one-letter variable names, multiple statements crammed together on single lines.
So I get to this one section of code. I can't even remember how it worked now, but it was this convoluded for() statement that flipped a flag and did some weird ass computation. It took me about 10 minutes of "stepping through" it in my head to figure out what it was doing.
It was calculating leap-years. I actually stared at it in shock, imagining how much time and energy this kid spent figuring out the worlds most assinine way to figure out if it's leapyear. I would have just wrote "if (year%4 == 0) { days_in_feb=29; }" or something of the sort. I wouldnt write "if (!(year%4)) {};" because perfoming boolean tests on integers is another pet peeve, it doesn't improve the code, just detracts slightly from its readability.
I actually interviewed the kid, and pointed the lines out to him. I asked him why he didn't just use the modulus operator. He just stared at me blankly. He had no clue what "modulus" meant.
As creative as his "solution" was, his code was bad, and he was a shitty programmer with a very very poor understanding of the language.
It's all cool to have this contest, and if that's how people want to spend their spare time, go ahead. I'm just trying to send a message to the newbies reading slashdot who are still in school and tend to think this is a hallmark of a good coder in the "real world". In the real world or business, anything that makes your day more of a hassle than it needs to be, is a bad thing.
Leave the obfuscation to the marketing department. We have one who actually listed double-ROT13 encryption as a "feature" of our product. Ok, he asked me what encryption we supported by default, and I told him double-ROT13 not realizing just how dense he was. The story gets better! The marketing shpiel he put together was going to the IT security folks at the NSA! One of them called me up, in tears from laughing. He asked if I could implement quad-ROT13. I told him I could implement 2^n-ROT13, iff n>0.
But that's another story for another article.
Re:Time to turn in your geek card... (Score:2)
But these few lines in particular show its true nature:
It's still completely unreadable. Argh!
Re:Time to turn in your geek card... (Score:4, Insightful)
Actually, I think you're the one who's dense, when you think someone from marketing who asks you a straightforward question about your product is supposed to understand a geek-joke.
It's not his job to check or even understand all the technical info. It's (presumably) yours.
Re:Time to turn in your geek card... (Score:3, Informative)
determining a leap year [wikipedia.org] is more than just having it be divisible evenly by 4: The Gregorian calendar adds an extra day to February, making it 29 days long, in years divisible by 4, excepting years divisible by 100, but including year
Re:Time to turn in your geek card... (Score:2)
Your AC parent wrote:
Written more sensibly (some spaces because HTML and code often mix poorly!), this becomes:
This parses generally into:
You should try Pascal instead of C (Score:2, Insightful)
if (year mod 4) = 0
:= 29;
then
days_in_feb
endif
or something like that, it has been 20+ years since I last wrote Pascal, I'm not so familiar with the syntax anymore. Or try COBOL for the true detailed syntax you seem to adore. But one of the many advantages of C that make it so great is the concise syntax. After readi
Re:Time to turn in your geek card... (Score:2)
I just had the exact same reaction. You posted this over 30 minutes ago. I'm still laughing out loud now.
I'm still a newbie too, but spending a while coding assembly straightened me out. That and seeing the code from one of my friends from school who started C++ a couple of weeks ago. S
Re:Time to turn in your geek card... (Score:2)
Re:Time to turn in your geek card... (Score:2)
was than
I have lost some trust in my compiler's optimisations.
And how much worse is
than
Besides, I learnt assembly before C++, so I do my own optimisations out of habit.
Re:Time to turn in your geek card... (Score:2)
So if you are going to pick on programmers for bad code, at least make sure your algorithms are correct.
Re:Time to turn in your geek card... (Score:2)
Re:Time to turn in your geek card... (Score:2)
What's so hard about something like
Re:Time to turn in your geek card... (Score:3, Informative)
on my PC it turned out that it takes twice as long to go the route of strange addition
identifying leap years (Score:2)
Re:Time to turn in your geek card... (Score:5, Insightful)
Re:Time to turn in your geek card... (Score:4, Insightful)
(1) It's for fun.
(2) It's a famous tradition.
(3) There is a great elegance in the entries which win; they are far from shitty.
(4) Chill out.
Re:Time to turn in your geek card... (Score:2)
No, the obfuscation is often secondary, or at least the "don't indent, use one-letter names" portion of the obfuscation.
Example of a past winner:
The output of the entry was a program that would flip an input text file on a diagonal axis. So e.g.:
ab
cd
was turned into:
ac
bd
Simple, right? Sure, but the source code itself was such that if it was flipped on the axis, it became compileable source code to ano
Re:Time to turn in your geek card... (Score:2)
Re:Time to turn in your geek card... (Score:2, Informative)
i consider the ability to at least appreciate unreadable code, and have a good time with it, for fun, just coz, to be a good trait in a programmer. and thats what this IOCC thing is. for fun.
(thus you're fired! hand in your geekcard on the way out...)
Re:Time to turn in your geek card... (Score:2)
Just consider it... insurance.
Obfuscate... or be outsourced.
Re:Time to turn in your geek card... (Score:2)
Re:Time to turn in your geek card... (Score:4, Informative)
Anyway, this is not merely "bad code," in the sense that an idiot might program this stuff. This is the sort of code you can only attain when you actively aim for it. You really need to know the language well to know how to fuck with it so thoroughly.
Re:Time to turn in your geek card... (Score:4, Insightful)
If they don't know, hey, it says you won a fairly well-known programming contenst.
Windows CE? (Score:5, Funny)
Much better than the last 2 years (Score:4, Insightful)
Of course it looks like those extra 2 years paid off. This year's winners look very interesting.
If the IOCCC is like the IOC (Score:5, Funny)
Re:If the IOCCC is like the IOC (Score:2)
Re:If the IOCCC is like the IOC (Score:2)
Let me be the first to say... (Score:3, Funny)
C0N6R47UL4710N5 W1NN3RZZ!
Re:Let me be the first to say... (Score:2, Funny)
Re:Let me be the first to say... (Score:2)
Re:Let me be the first to say... (Score:2)
I can smell the smoke from here... (Score:5, Informative)
Re:Funny about that language (Score:2, Informative)
Also, C is something of a standard language. At least on UNIX-style systems, programs written in any other language have to use some glue-code library to allow them to use standard libraries, system calls,
Re:Funny about that language (Score:2)
Generally Lisp compilers can produce code that runs in the same ballpark, timewise, as C. Here's a perfectly good 3D app written in Lisp: Mirai [izware.com].
Personally it's a lot more important to me to be able to write software quickly, with as few bugs as possible, and with pretty good performance. But of course with Lisp once
Re:Funny about that language (Score:2)
Unless you're writing games for mobile phones - especially if writing for a virtual 32-bit processor emulated on an 8-bit physical processor. Ouch!
Additional Mirror (Score:5, Informative)
Comment removed (Score:5, Informative)
Re:Site content (Score:1, Offtopic)
Mirrors (Score:5, Informative)
Asia
* http://www.tw.ioccc.org/ [ioccc.org] - Hsin-Chu, Taiwan (24 48' N 120 59' E)
* Australia and other Pacific http://www.au.ioccc.org/ [ioccc.org] - Sydney, Australia (34 0' S 151 0' E)
Europe
* http://www.de.ioccc.org/ [ioccc.org] - Hamburg, Germany (53 33' N 10 2' E)
* http://www.es.ioccc.org/ [ioccc.org] - Madrid, Spain (40 25' N 3 41' W)
* http://www.gr.ioccc.org/ [ioccc.org] - Athens, Greece (38 00' N 23 44' E)
* North America www0.us.ioccc.org [slashdot.org] - Sunnyvale California, US (37 22' N 122 02' W)
* www1.us.ioccc.org [slashdot.org] - Saint Paul, Minnesota US (44 57' N 93 06' W)
Funny, but sickening (Score:5, Insightful)
I'm amazed at how someone can acheive such obfuscated code without really trying.
Re:Funny, but sickening (Score:3, Insightful)
I'm not amazed at all - I pay special attention to my code so that someone else could come in and use it. That doesn't mean they'll be able to just step in and understand everything, it'll be hard no matter what. But if I didn't try, I think everything I made would be unusable by anyone else. In my mind that makes the code worth very little - it is the ability to reuse code that makes it valuable. I've debugged or added f
/*Why did I do this*/ (Score:3, Interesting)
This was on an embedded system where using one 16 bit int instead of 16 8-bit chars to hold the flags resulted in a vital savings of memory.
Re:/*Why did I do this*/ (Score:2)
char *s;
while (strncmp(s," ") == 0)
s++;
Re:/*Why did I do this*/ (Score:2)
while (strncmp(s," ",1) == 0)
s++;
Re:Thats not obsfucated (Score:2)
And this was in code for mission critical stuff too. There was a lot of other crap there... I wrote up about 7 problem reports and routed them to the developers contact, the program office, my management, etc...
missing the point (Score:3, Insightful)
Anyone can write unreadable code.
It takes an artist to write code that is both unreadable and beautiful at the same time.
If your entry isn't beautiful, you're just a bad programmer.
Re:Funny, but sickening (Score:2)
Re:Funny, but sickening (Score:3, Insightful)
The whole point of the IOCCC is to demonstrate how ridiculously unreadable C programs can get if you really try. And if you don't think writing a raytracer or whatever within the guidelines set in the competition rules is worthy of admiration then you've never picked up a C compiler in your life.
I see you have a job that requires you to read CVs and presumably hire people. Please tell us which company this is so we can avoid this mi
Re:Funny, but sickening (Score:5, Insightful)
Have you ever read any of the code? Besides formatting, (you can run stuff through indent), this stuff is *very careful* obfuscation. It's not just nonsensical variable names and lack of comments. It's using constructs in novel ways, and comming up with non-trivial solutions to what are quite often complex problems.
If you can win this contest you know exactly what makes programs hard to read, and thereby in real situations, avoid them. Furthermore, some of the stuff is beautifully arranged and may be faster or more elegant than the easy to read version. It's not a mockery of the language, it's "art in c", and I would happily hire any of the winners as most probably they are masters of the nuances of c.
Re:Funny, but sickening (Score:2)
Re:Funny, but sickening (Score:3, Insightful)
Re:Funny, but sickening (Score:5, Insightful)
It's just a competition, and like most competitions, the results are fairly pointless outside the intended domain.
Reading your rant is like watching a spectator in the Tour de France yell "learn how to drive a car you idiot!" at Lance Armstrong.
Re:Funny, but sickening (Score:5, Insightful)
Except a properly written recursive function, and a loop end up being exactly the same thing once compiled... Even with a C compiler
Of course anybody putting purposefully obfuscated code into any real software should be shot... All the unpurposefully obfuscated bad code is bad enough, when maintaining it falls on you.
That's not the point IMHO, though admittedly a lot of the stuff is just that without any real content. But the real pearls would still be devious to decipher even if all identifier names were clear, and any unnecessary structural obfuscations were written in more clear way.
You need to lighten up. Some get their kicks from polisihing their car over and over, some get theirs from standing in a river in long ridiculous boots and waving a rod around, and some get it from twisting their brains around a piece of C mumbo jumbo... Nothing wrong with any of that.
Re:Funny, but sickening (Score:2)
I'd say that the C mumbo jumbo also helps them learn about C. Not just what not to do, but different ways to do the same thing. Maybe it makes some code a nightmare, but later on it might be useful. Not to mention that it must help when debugging someone else's code, or adapting
Re:Funny, but sickening (Score:3, Informative)
The C standard doesn't guarantee optimization tail-recursion; and while gcc does it (to a limited extent), many compilers do not.
Additionally, it's sometimes important to compile your code without any optimization during debugging.
Relying on tail recursion is really only possible in languages where the standard guarantees support.
Re:Funny, but sickening (Score:4, Funny)
Re:Funny, but sickening (Score:2, Insightful)
Re:Funny, but sickening (Score:4, Informative)
Oh, here [ioccc.org] is the explanation.
You've passed over many good people then... (Score:5, Insightful)
At a couple of the companies I've been with we'd have after-hours informal little "Who can optimize this code the most" contests and they were amazingly instructive. They force you to think about solutions in new and creative ways, and to really understand an algorithm or CPU at a far deeper level than a simple straightforward implementation.
And while those obscenely optimized implementations may never get near the shipping product, you always walk away with a far far better grasp of how the shipping code really does work. (And yes, we've discovered bugs by inspection... because the little optimization contest had us questioning assumptions that the shipping code relied upon)
Re:You've passed over many good people then... (Score:2)
Hence your sig, I presume :)
Re:Funny, but sickening (Score:3, Informative)
Re:Funny, but sickening (Score:2)
Whether recursion is "natural" or not depends on the PROBLEM, not the language. Recursion is a natural solution to mapping over a binary tree, for instance. It is the most straightforward solution for factorial and the Fibonacci sequence. You might argue that calculating the Nth member of the F
Transcript (Score:5, Funny)
winner: I won! I won!
MC: No, you're failing computer science.
winner: [Segmentation fault]
IOCCC? or IOC-C-C? (Score:4, Funny)
Since the Olympics have just finished and still reasonably fresh on my mind, did anyone else read that as a stuttered IOC-C-C? (International Olympic C-C-Committee)
No? J-J-Just me then?
Re:IOCCC? or IOC-C-C? (Score:2)
Sounds like these guys would be the judges if writing C compilers ever became an Olympic event. Pity this wasn't mentioned in the recent poll "Olympic Sports Needed in 2008?" [slashdot.org].
I wonder how other Olympic events would benefit from obfuscation. Perhaps all the race-tracks would resemble spaghetti junctions.
Bumper Sticker (Score:4, Funny)
"Eschew Obfuscation"
Comment removed (Score:5, Funny)
I think we just... (Score:4, Funny)
- Kevin
For those of you who don't want to wait... (Score:5, Informative)
http://uguu.org/src_rinia_c.html [uguu.org]
The only reason I can even remember where this entry would be is because he's the one a few years ago that won with that strange Saitou-Aku-Soku-Zan combination program. Yeah, I could find utilities to do what his code can do on many other places, but what better way to show your anime fandom & code fanaticism by running something like this instead. ^_^
In other news... (Score:4, Funny)
All prize money for the latest IOCCC have been used up for bandwidth after a %^&*@#@%#^% ( obfuscated ) slashdot effect hit the site soon after results were published. We are sorry for the winners...
More C-related sillyness (Score:2, Funny)
IOCCC mirrors needed (Score:5, Informative)
Please include the following words in the subject of your EMail message:
We will ask you a few questions and provide you with information on how we would prefer you to mirror the site. Please don't start mirroring until we have responded and processed your mirror request. Thanks in advance for your willingness to help.
IOCCC - FAQ and History (Score:3, Informative)
Definition
Goals:
And here is one entry from the IOCCC FAQ [ioccc.org] that talks about how the IOCCC got started:
Code Was Supposed to Be Up Today (Score:3, Informative)
They intended to have the winning code available today, but the website was designed by last year's winner, and they're guessing it'll take another 6 weeks to figure it out.
They started in January.