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. :-)"
I once heard, it may be a rumour, but at least it's a nice story, that (once upon a time) russian coders liked to write code with obfuscation built in. They were so scared to loose their jobs that they wrote code only themselves could understand, using strange/misleading variable names, senseless loops or whatever. Can anyone confirm this?
It's a well documented phenomena.
There already is one.
http://www.sysadminmag.com/tpj/obfuscated/
"You cannot find out which view is the right one by science in the ordinary sense." - C.S. Lewis on Intelligent Design
Ternary, not tertiary. (Or rather, the ? : operator is the ternary conditional operator. See JLS 15.28.)
Jon
Grab it here instead. The source where cut in the post.
I doubt that other languages offer the same possibilities for befuddlement as C, but there's only one way to find out...
No, C was designed to limit the number of keywords required. There's a huge difference. Compare C to pascal. C has less than a dozen keywords and Pascal has almost 100, but neither is more readable if used correctly.
Also, C was not popular until we already had video terminals - and then, C was the UNIX-head-only language until the 80's.
You're so incredibly misinformed about computer history.
Hands in my pocket
The author pointed out that even though it's not technically a legal C program, most C
compilers (including the one the IOCCC uses) will in fact accept it and proceed to spit out a binary that does
nothing.
Let's see:
# touch test.c
# gcc test.c
/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
Doesn't work anymore.
(We gotta keep up with the code bloat like everyone else
(why 521? Well 521 is prime and 2^521-1 is a Mersenne prime and I like primes
chongo (was here)
There are some good examples of quines (self-replicating programs) at http://www.nyx.net/~gthompso/quine.htm
Also, I like Esoteric Topics in Computer Programming
Over the years, gcc has survived the best. It has chucked core cookies on a few entries, but not nearly as often as some of the commercial C compilers.
If a winning entry does cause problems for somebody's C compiler, we usually file a bug report. They may not be pleased with the code sample, but that is the break;'s. :-)
p.s. The entry that broke causde the most problems on the most platforms was the 1988 Best of show. Not only did it crash a few C pre-processors, it cause one system to turn casters-up when it ran out of swap space!
chongo (was here)