15th IOCCC Results Posted 69
leob writes: "FWIW, the 15th International Obfuscated C Code Contest finally came to a conclusion. Read the main page, or, get one big tarball." The contest took a little longer than expected, but the results are fine example of their craft.
Re:Why bother? (Score:3)
What use is this? Surely winning this competition is a sign you should never work again? Obfuscated code (aka elegant) is no faster, even if it is shorter, and may even compile into worse code.
Well, (IMO) you're completely wrong. IOCC code isn't just "bad code getting awards". the winners of the IOCC show an understanding of the subtleties of the way the C language work far beyond that of your average C programmer, or even your pretty good C programmer. Or, to quote Peter Van Der Linden, "..[The IOCC] is a lot of fun and can extend your knowledge in surprising ways".
Spend a few hours or looking through the archives at things like "best one liners" and try and figure out what they do without reading the description - or maybe look through gems like the 1500 character BASIC interpreter. Deobfuscate some entries to figure out how they work and you might find you learn something about what the language can do and it might improve your day to day programming.
For me this shows the problm with open source - people are more interested in playing silly games than actually getting something constructive done.
Yuk, Trollish.
Stupid formatting (Score:1)
got tired (Score:1)
Books (Score:2)
Re:Why bother? (Score:1)
Anyway, please name some (no, really) - I've been looking around for books that cover the practice of programming, not a language reference or tutorial, and not a specific discipline. All I really came up with is Kernighan's Practice Of Programming, and some of Programming Pearls. They also both share Solid Code's anecdotal style, which I liked.
Re: Hungarian Notation - anyone whoe learned Windows programming early, from Petzold would have soaked it up - I know I did for Windows programming - although I don't do a lot of that at the moment. I suspect it's around more than you think, particularly in the windows world.
Obfuscated != Well crafted (was Re:Why bother?) (Score:3)
I really enjoy the IOCCC, and every year I download the results and play with them. Some are startlingly clever, like the flight simulator a couple of years ago. Writing these obfuscated programs is a special skill, and, yes, it is a form of craftsmanship within the context of the competition. And, of course, the people who can write these little gems have to be brilliant programmers first.
But in all normal circumstances, obfuscated code in any language is bad code . The whole purpose of highlevel languages is to communicate with human beings, not to communicate with the machine: to communicate with the programmer who is to come after you, who has to debug your code, or port it, or update it because some library it uses is obsolete and some of the API has been deprecated or dropped. That programmer may of course be you.
Code that can't be picked up by someone else in six months time - someone possibly less skilled than yourself, and read, and understood, and modified, is poorly crafted. Bad workmanship. If you can't understand this, you aren't going to be a successful member of any development team, either commercial or open source.
Enjoy the IOCCC as a cort of cross between puzzle games, satire, and poetry. A very special kind of programming - a very skilled kind of programming - but one which has virtually no carry-over into the real world.
Re:Why bother? (Score:1)
So a corporatist government combined with thousands of groups whose sole stated interest is to screw the consumer out of as much money as possible is better? How does that make any sense?
Because governments have the force of law, and corporations do not. There is no law requiring me to use Microsoft software, Xerox copiers or Blue Shield medical insurance. Better that I have the freedom to choose the honest companies over the dishonest ones, rather than being screwed 100% of the time, by law, by the government.
--
Re:Download all winning entries (Score:1)
Re:Why bother? (Score:1)
Interesting. . . (Score:2)
Maybe it's the pretty pictures. . .
Re:Why bother? (Score:1)
First, if you did not want to play a troll here, you'd better have choosed a different nickname. "Reality Master 101" ?
Second, I use troll as a compliment.
Third, agreeing, disagreeing to a post content don't really mean anything. I hope you don't think your opinions are accurately represented in a few hundred of bytes.
> Guess what? It's a product. You can choose to buy that product or not. We're not talking about food or housing
Guess what ? Food, housing, health care, education are all products. So your 'it's a product' is basically casted to void.
> we're talking about a movie in a particular format. Note that it isn't even the only format you can buy
Is it ? <http://www.amazon.com/exec/obidos/ASIN/B000053 VBN/ref=v_dh_hir_6/107-9806512-4018115>
In 5 to 10 years, movies won't be released on VHS anymore. Don't pretend you don't know this.
> It's their product. They can do whatever they want with it.
The problem is that, when we have bought such product, DMCA will prevent me to say "It is my product. I can do whatever I want with it".
> It's called "freedom"
Yeah. The freedom to buy politician. The freedom to push scelerate laws. The freedom to replace the word 'citizen' by the word 'consumer'. All that kind of freedom.
> But since you appear to advocate socialism, freedom is a word you may not be familiar with
Please, don't assume anything.
> > There is no such thing as an honest (or dishonest) company. Don't anthropomorphize.
> You know what I mean, but instead you choose to deliberately pretend that you don't rather than make a substantive argument.
No. You choosed not to understand what I said. Let me repeat:
"There is no such thing as an honest (or dishonest) company. Don't anthropomorphize"
Like in:
'It's their product. They can do whatever they want with it. It's called "freedom"' You are confusing freedom of citizen with freedom to trade. Those concepts are totally different. You are anthropomorphizing corportations. Honesty dishonesty, freedom.
Companies are not honest or dishonest. They can't be. Even if they spend hundred of million to build a corporate image, a company have no moral standing. Not even the slighest one. They can't have. By definition.
Let's go to your original post:
> I have the freedom to choose the honest companies over the dishonest ones
I'd say that freedom is a word not familiar to you. The synonym 'liberty' would be more appropriate in your sentence. Freedom have connotations you don't seem to grasp. In particular, "the condition of being free of restraints". An _alternative_ between compeeting _corporations_ giving you _liberty_ of _choice_ don't carry most of the meanings of _freedom_.
Cheers,
--fred
I am a winner (Score:2)
Comments? Questions?
Thad
Re:Obfuscated != Well crafted (was Re:Why bother?) (Score:2)
----
Re:Here's Yet Another Contest! (Score:1)
Nice to heard you again, a bit sad that you are not using a flamethrower against void main()...
Cheers,
--fred
Re:Obfuscated != Well crafted (was Re:Why bother?) (Score:1)
But in all normal circumstances, obfuscated code in any language is bad code
Well.. the debatable bit is what you define as normal. When I'm knocking out a ten line perl script I can use something I saw in an obfuscated contest because it's got such simple syntax and saves me time.
Not every bit of code is made to be inherited or worked on as a team. Many times it's just a ten line perl script that's required and these contests are great for learning shortcuts in those little bits of code (or what we type into the command line actually - obfuscation is wonderful there).
-- Eat your greens or I'll hit you!
Re:Why bother? (Score:1)
You're either a genius or insane, most prolly both (Score:1)
At first glance of the code, it looks completely unreadable and worthless, until you compile it and realize it actually works! Genius.
I have a hard enough time doing regular programming, I shudder at the thought of trying to make something like this.
I like the fact that this is a very good way to confuse people and just plain annoy them when someone asks for your source code and you know they're just gonna copy it and slap their name on it and pretend they wrote it. Makes good presents too. "Here's that game I wrote blah blah, just read through it and tweak the settings." he he.
Too bad the site is already slashdotted. Later all
Lord Arathres
Re:Here's Yet Another Contest! (Score:3)
See (for instance) <http://www.physik.tu-muenchen.de/lehrstuehle/T 32/matpack/html/Mathematics/Pi.html> to get a description. Remove slashdot added spaces from the URL.
So, definitively, no. You won't be a contender with an extremly common stolen program.
Cheers,
--fred
Obfuscating vs. AscII art (Score:2)
I would have to agree that simply rendering a program into ascii art is not itself obfuscation, and therefore, does not properly belong in this contest. On the other hand, I would tip my hat (if I had one handy) to anyone who can write a workable C program that doubles as ASCII art. This probably deserves a contest all of its own.
Remember, you saw it on Slashdot first.
Re:Why bother? (Score:2)
Regardless of what the front office does and decides as a direction, there are some pretty clever people at Microsoft (not to mention Microsoft Research [microsoft.com] - Blinn, Kajiya, Gray, and many others).
(of course, feel free to add a more illuminating comment if it wasn't just the usual MS==BAD)
Re:Well... (Score:2)
And only later did a good answer occur to me--a high tech twist on an old proverb. "There is one beautiful program, and every programmer has written it."
The original of course is, "There is one perfect child, and every mother has it."
Re:Why bother? (Score:3)
Re:Why bother? (Score:1)
Hi, reality master 101, how is your trolling session today ?
> There is no law requiring me to use Microsoft software
Wrong. Take DeCSS as an example. If you own a PC you are required to use Windows to view your DVDs. Law is here to enforce that. DMCA will give a new meaning to this. The law will not say "you are required to use window", but "it is illegal to use software non-approved by the industry", and, funnily, the industry will only approve windows software.
Sure, you can say that there is no law that forces you to buy a PC (at least now). In that case, there is no law that requires you do do anything, as you always have the possibility of reject your American citizenship.
> I have the freedom to choose the honest companies over the dishonest ones
There is no such thing as an honest (or dishonest) company. Don't anthropomorphize.
Cheers,
--fred
Bollocks (Score:1)
*obfuscated* code (Score:1)
(audience: "Boo!!! Hiss!!! Don't quit your day job!")
Download all winning entries (Score:1)
So, download the file from http://www.ioccc.org/2000.2000.tgz [ioccc.org]
Re:obfuscating not all, though... (Score:1)
I've got to say that anderson [ioccc.org] is particularly satisfying, no #defines and I still can barely understand a character of it...
Mirrors? (Score:1)
Well... (Score:5)
Why bother? (Score:2)
What use is this? Surely winning this competition is a sign you should never work again? Obfuscated code (aka elegant) is no faster, even if it is shorter, and may even compile into worse code.
For me this shows the problm with open source - people are more interested in playing silly games than actually getting something constructive done.
Microsoft didn't get to be as successful as it did by creating obfuscated code you know.
Re:Why bother? (Score:2)
No, they did it by putting Easter egg flight sims in their Office apps.
Rob.
Re:Why bother? (Score:2)
Microsoft didn't get to be as successful as it did by creating obfuscated code you know.
Based on what I've seen of Microsoft Code, I have to disagree.
Re:Why bother? (Score:1)
Re:Why bother? (Score:1)
Only under a deranged, half-baked system like capitalism would this be true. Only in such an outrageously silly system would it be acceptable or normal to attempt to cheat your fellow humans as a matter of course. Only under such a deranged set of principles would anybody refusing to scam his fellow (wo)man out of anything and everything be lauded as a role model or praised as a pillar of society. Don't even get me started on Forbes magazine's little list....
I'm sorry for going off on a tangent like this, but whenever I see this quote I'm just reminded of all that's wrong with the so-called "free world".
Re:Here's Yet Another Contest! (Score:1)
I am new to programming, so no flames please. Can something like this be ported to Perl? (I am trying to learn it.)
Yes, this can be ported to perl. Anything in C can be written in perl (and vice versa).
C is weakly typed, so I'm not sure what you're getting at here... Strong typing is to save the programmer from himself. I personally do not enjoy programming in languages that remove C's power to make non-sensical casts.
So, I guess what I am really asking is: Is this kind of program only able to be written well in something like C++ or Java?
Absolutely not. This is just an algorithm for calculating Pi. C is nice because it's portable and fast. Check out a functional programming language like Haskell [haskell.org]. Selecting a programming language for a particular task involves clearly stating your goals. If I wanted to confuse you, I'd write it in Malbolge or BrainF*ck. If I wanted to calcuate pi quickly (millions of digits), I might write it in C [umn.edu], but I'd also do my homework [gourdon.free.fr]. If I wanted something from the command line, I'd use:
$perl -e 'for(0..9999){$i=$_*8;$p+=(16**-$_)*(4/($i+1)-2/($ i+4)-1/($i+5)-1/($i+6))}print$p'
It's really a matter of "what gets the job done."
(Besides that I have a feeling that using an object-oriented language (like Visual C++) would reduce the amount of code you would have to write (due to increased code re-use.))
Simple algorithms like this one are fairly atomic. You're foo class isn't going to help you here. You really aren't going to resuse this either. That's what M_PI is for =).
Re:Why bother? (Score:3)
I can just see Kryten now... "Fun? Ah, yes. The employment of time in a profitless and non-practicable way." So what if it's pointless. It's nice to do seomthing for fun every now and then. We aren't supposed to be writing top-notch code 24/7.
Re:Slashdotted. (Score:1)
It's silly!
It's funny.
That's about it. It isn't designed to be taken seriously. MTo make you look at it, and go, what the hell does THAT do?
Re:Why bother? (Score:1)
Okay okay so I am taking what you said and adding one step to it in that direction but it sure sounds like that is what you are saying
First you go on about how people can not worry about design and structure at all and talk about clever syntax rather than typing a dozen lines of.. (easier to read for a mortal) code.
Then you say perl is called obfuscated because its encouraged to be "cool" and learn these shrotcuts so that a lesser (mortal?!#@$) cant read the code?
Hmmn..
You did a nice post in not actually saying any of that which makes it good in the sense that you are not saying good or bad or giving away anything about whether you think it is good or bad, but I think what gives it away is "reward those that know the language by not forcing them to be verbose - this can shopw off similar technique" So every day in the life of a perl guru is to see how many shrotcuts they can use and show off their technique, afterall they are being rewarded with the shrotcuts they spent hours learning to use when they could use a piece of code we could all grasp a bit easier.????
Jeremy
Re:Why bother? (Score:2)
Just by virtue of spending *so* much time figuring out how to push the language you are going to learn a whole lot.
Going reverse and actually reverse engineering one of these programs you may or may not learn as much, but chances are good you will be gifted with a good deal of insight about C
Ive tried and managed to undo several but some of these programs are truly works of art in the truest sense of the word art.
Okay so it may not be valuable in the sense regular art is however the sheer intelligence and amount of effort some people put into this the only word that comes to mind to express elegantly exactly what these programs are to a programmer is art
My two cents..
Jeremy
Re:Why bother? (Score:1)
Re:Here's Yet Another Contest! (Score:2)
Re:Here's Yet Another Contest! (Score:2)
Re:Why bother? (Score:1)
Pascal? (Score:2)
So. My first instinct when I saw this was Ha! More examples of just why C is horrible! You couldn't do this if in Pascal if you tried!
I then thought about the ingenuity of these authors...
So, does any such resource exist for Pascal code? Beyond simply putting the thing as ASCII art and giving it meaningless variable names, neither of which seem truly worthy to me.
Re:got tired (Score:1)
Frankly, I'm having a lot LESS trouble checking the response time on my site today than I am accessing slashdot to see if people are complaining about how my site's responding... Maybe slashdot's been slashdotted or something....
Re:Why bother? (Score:1)
Hi, reality master 101, how is your trolling session today ?
So if someone disagrees with you, then they must be a troll?
The law will not say "you are required to use window", but "it is illegal to use software non-approved by the industry", and, funnily, the industry will only approve windows software.
Guess what? It's a product. You can choose to buy that product or not. We're not talking about food or housing, we're talking about a movie in a particular format. Note that it isn't even the only format you can buy. Read carefully: It's their product. They can do whatever they want with it. It's called "freedom". But since you appear to advocate socialism, freedom is a word you may not be familiar with.
There is no such thing as an honest (or dishonest) company. Don't anthropomorphize.
Try this word: "metaphor [dictionary.com]". You know what I mean, but instead you choose to deliberately pretend that you don't rather than make a substantive argument. And you accuse me of trolling?
--
Re:obfuscating not all, though... (Score:1)
Re:Why bother? (Score:1)
Re:Why bother? (Score:1)
obfuscating not all, though... (Score:3)
I however enjoyed some entries, like PrimeNum [ioccc.org] which is an example of clean obfuscated code, despite its heavy use of preprocessing directives (BTW, even its own name is obfuscating as it has not much to do with prime numbers, even though its apparent algorithm is
Tomx [ioccc.org] is also interesting as it is a Makefile and a source file at the same time.
--
Re:Why bother? (Score:1)
CORRECTION (Score:1)
Only under such a deranged set of principles would anybody attempting to scam his fellow (wo)man out of anything and everything be lauded as a role model or praised as a pillar of society. Don't even get me started on Forbes magazine's little list....
Obfuscated Law contest (Score:1)
PI (Score:1)
Re:Why bother? (Score:1)
Re:Why bother? (Score:2)
Understanding obfuscated code is difficult - that's the whole point - therefore those who understand it (especially those that write it) have a firm grasp of the language - moreso than programmers that don't.
Also obfuscated code is usually about short snippets of well crafted code rather than worrying about a greater architecture. Competitions like this let people show off clever algorithms, or just clever syntax. Useful, as programmers can use the obfuscated code rather than typing a dozen lines.
Perl has been called the obfuscated programming language because of it's many short-hand syntaxes that reward those that know the language by not forcing them to be verbose - this can show off similar techniques.
-- Eat your greens or I'll hit you!
Slashdotted. (Score:2)
What is the point of this? Most of the code I've seen in the past uses some pre-processor tricks to un-obfusticate the source.
I once saw some obfusticated Perl which appeared to be no more than a standard perl program with all whitespace removed, no comments (naturally), and over-use of $_.
Then again I was attempting to revise one of the sound drivers in the current Linux kernel recently, and that was pretty well obfusticated!
Re:Why bother? (Score:1)
Re:Why bother? (Score:1)
--
Slashdot didn't accept your submission? hackerheaven.org [hackerheaven.org] will!
Re:Why bother? (Score:1)
The first and obfuscated way is good for personal projects - putting together shoddy perl scripts. Especially projects that are too short to bother about maintainability. So far as short bits of code go they require the most skill also.
The second is mostly for large projects or ones that require several programmers at the same time or the future.
Obfuscated code contests are about wank factor and showing off how well one knows a language. But as I say in the second paragraph they have their uses.
-- Eat your greens or I'll hit you!
Re:Why bother? (Score:5)
However consider this. Would you like to work for a boss who feels that winning the IOCCC is something to be ashamed from? Or would you rather work for a boss who feels it's a decent bit of fun?
I later found out that after dwindling the job candidates down there were just two suitable people left - I was one of them. My boss told me that winning the IOCCC was one of the factors that helped him to pick me over the other candidate.
So in conclusion - it can actuall _help_ your job prospects!
(Yes I know it's a troll, but who cares.)
Microsoft code (Score:1)
The bit about Open Source . . . you get all these interesting 'games' as you call them, but to me that's people being interested in what they do! An important principle of Open Source or Free Software is that people love to code.
Re:Why bother? (Score:2)
And you know, just because you paid more for something, doesn't mean it's any better. [...] Only under a deranged, half-baked system like capitalism would this be true.
Versus socialism? The difference is that under socialism, the government attempts to cheat the citizens as a matter of course. The difference is that there is only one government, and under capitalism, you can choose whichever company you percieve to cheat you the least.
And if you think socialistic government are paragons of virtue and efficiency with only the best interests of the citizens at heart, then I feel sorry for you and your naivete.
--
Re:Why bother? (Score:1)
Except it'll have the government to help it. See the British and the Dutch in Asia, the US in Latin America, and pretty much everyone in Africa. Then take into account how much money corporations spend funding campaigns for a rough estimate of what the effects can be domestically.
A democratic socialist society doesn't have any of this. I won't speak for autocratic or oligarchic ones.
and if you think socialistic government are paragons of virtue and efficiency with only the best interests of the citizens at heart, then I feel sorry for you and your naivete.
So a corporatist government combined with thousands of groups whose sole stated interest is to screw the consumer out of as much money as possible is better? How does that make any sense?
Because... (Score:1)
- Scott Kim
Re:Why bother? (Score:1)
Its just a laugh. Don`t worry about it.
"For me this shows the problm with open source"
Whats it got to do with open source?
Re:Why bother? (Score:2)
Wrong. Even by fluke they should have turned out something reasonable. For microsoft to consistently turn out products as bad as they do, they have to know *exactly* what a good product is, and work hard to make their software as unlike it as possible
Re:Why bother? (Score:1)
Yeah, trolling SlashDot with ignorant nonsense.
Re:Here's Yet Another Contest! (Score:2)
Nope. Even in obfuscated C, main cannot be declared void.
Btw, you should give credit to the original author of this program, Dick T Winter. (Which btw, did not put the 'void' before main())
Cheers,
--fred