The International Obfuscated C Code Contest (abbr. IOCCC) is a Programming contest for the most creatively obfuscated C (programming language) Code held annually since 1984 (with the exception of 1997, 1999, 2002, 2003, and 2006). There are many winning entries each year, and each entry gets a category such as "Worst Abuse of the C preprocessor" or "Most Erratic Behavior".
The IOCCC was started by Landon Curt Noll and Larry Bassel. They were talking together about the horrible code it was their jobs to maintain. They decided to hold a contest for the worst possible C code. Within the code size limit of only a few kilobytes, the contestants manage to do complicated things — a 2004 winner turned out an operating system .
Some quotes from 2004 winners include:
- To keep things simple, I have avoided the C preprocessor and tricky statements such as "if", "for", "do", "while", "switch", and "goto".
- We still aren't sure whether or not this is a useful program, but it's the first atomic fission we've seen in the IOCCC.
- Why not use the program to hide another program in the program? It must have seemed reasonable at the time.
- The program implements an 11-bit ALU in the C preprocessor.
- I found that calculating prime numbers up to 1024 makes the program include itself over 6.8 million times.
(Note that the entry was written in K&R C; it doesn't work correctly in ANSI C without some change.)
Another good example is this clever flight simulator, the winner of the IOCCC in 1998 as shown below:
Some ways in which contributions are notable include:
- The appearance of the source code, which may resemble images, text, etc.
- Preprocessor redefinitions to make code harder to read
- Self-modifying code
- Worst abuse of the rules. In several years, an entry was submitted that was so patently absurd that it required a new definition of some of the rules for the next year. This, of course, is a high honor. An example is the world's shortest Quine (computing). The entry was a program zero bytes in length that if run printed zero bytes to the screen (this requires some creative use of the Makefile to get it right).
The nature of this contest has naturally resulted in programs which skirt around the edges of C standards, or result in constructs which trigger rarely used code path combinations in compilers. As a result, several of the past entries may not compile directly in a modern compiler, and some may even cause crashes.
See also Edit
Notes and references Edit
|This page uses content from Wikipedia. The original article was at International Obfuscated C Code Contest. The list of authors can be seen in the page history. As with the Programmer's Wiki, the text of Wikipedia is available under the GNU Free Documentation License.|