IOCCC Accepting New, 'Improved' Entries
Rudolf writes: "The 16th International Obfuscated C Code Contest is open from now until 01 Dec 2001 23:59:59 UTC. Details are at the IOCCC web site. From the front page,
the contest goals are: -- To write the most Obscure/Obfuscated C program (within contest rules -- 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. :-)"
Anybody notice the 'A is for ASCII, B is for Byte' stuff on the winners index?
link
"Draco dormiens nunquam titillandus."
There are cases, often with complex logical expression with deeply nested parenthese, && and ||, where the assembly is easier to read than
the so called "high level" source code.
(Well, C is not high-level in any case)
Or would that be too easy?;)
My favorite isn't so much obfuscated code, but hair-brained.. I've actually seen this by paid contract programmers......
String getLetter( int index ){
String [] x = { "A", "B", "C", "D" };
for ( int i = 0; i < 4; i++ ){
if ( i == 0 && index ==0 )
return "A";
else if ( i == 1 && index == 1 )
return "B";
else if ( i == 2 && index == 2 )
return "C";
else if ( i ==3 && index == 3 )
return "D";
if ( i >= 4 )
break;
}
return null;
}
Are they getting paid by the line?
The highlight of the annual Computer Bowl occurred when
Bill Gates,
who was a judge, posed the following
question
to the contestants:
After a moment of silence, Jean-Louis Gassee (ex-honcho at Apple) hit his buzzer and answered:
Mr. Bill's expression was, in the words of one who was there, "classic."
Trolling using another account since 2005.
There already is one!
...
Also, if you go to Perl Monks, there are heaps of people submitting obfuscated Perl code for judgement
My favourite obfuscation is this pi-program.
The only thing in main() is large drawing of a filled circle. And then it says
"If you want better accuracy, make a bigger drawing"!
-- A Mathematician is a machine for turning coffee into theorems. - Paul Erdös
perhaps an unobfuscated one for that little canines snack of a language?
> it's a nice story, that (once upon a time) russian coders liked to write code with obfuscation built in.
> Can anyone confirm this?
I have one story that is true.
When I worked on image recognition software (1999), the boss decided that we needed a new recognition engine. So he paid for some source code written by a Russian (the guy didn't speak English, with almost no net acess, and limited access to a phone.)
It was the worst piece of inefficient spagitti (crap) code I have ever seen. Variables names like j1, j2, j3, j4, j20, j22, and hardcoded array access like x[4] = , x[50] =, x[52] =. It took me a few months of reverse engineering and cleaning it up. I ended up just chucking it away, and starting from scratch, which was a valuable lesson for me -- If you're spending most of your time refactoring existing code, it's better to just chuck it away and start fresh with a clean design.
> Maybe the compiled code is even easier to understand...
It was! I also found it usefull to treat each function as a black box, and figure out
a) input (& are they const)
b) outputs (& are they const)
c) intermediate values
Ironically we had a co-worker Russion coder that was half decent. A little inexperienced on good coding practises, but a hard worker, and I could depend on him to get tasks done.
Obviously 2 people isn't a large statistical enough sample to draw any conclusions from.
H4R3-br41N3D, not hare-brained, not hare-braned, not hare braned, not hair brained.....
"Ken (a 1997 winner of the IOCCC)"
Do you point this accomplishment out to prospective employers? Do they view it as a positive thing? :)
I could really use an unobfuscater to translate all the code I write at 3:00am while on a Jolt/Vivarin high.
It would also come in handy when I have to look at the code the interns wrote.
Perl takes me back, though.
Every time I look at someone else's perl, I expect a line to end with "NO CARRIER"...
-l