How did I miss this? The IOCCC is back!

After a 6-year hiatus the International Obfuscated C Code Contest is back. Winners of the 20th contest, opened in 2011, were recently announced.

The contest invites submissions for code in the C programming language that is deliberately obscured or uses creative tricks to make the language work in a way it wasn’t designed to.

Winning entries are posted on the IOCCC website – the award for winning is being announced on the website .

The rules, also posted on the website, are altered each year and often include hidden loopholes that are designed for contestants to discover and make use of. Entries that take advantage of a loophole in the rules can cause the rules for the following year’s contest to be adjusted accordingly.

The contest started in 1984 and was held annually until 1996, then in 1998, 2000, 2001, 2004, 2005, 2006 and in 2011. The winning code for the 18th and 19th contests, held in 2005 and 2006, was only released in November 2011.

Examples of obfuscated C code include: source code, formatted like ASCII art to resemble images, text, etc., such as a flight simulator program designed to look like an aeroplane; preprocessor redefinitions to make code harder to read; and self-modifying code.

One of my favourites is an entry from 1988, by Brian Westley, which calculates pi by looking at its own area:

#define _ -F<00||--F-OO--; int F=00,OO=00;main(){F_OO();printf("%1.3f\n",4.*-F/OO/OO);}F_OO() {             _-_-_-_        _-_-_-_-_-_-_-_-_     _-_-_-_-_-_-_-_-_-_-_-_   _-_-_-_-_-_-_-_-_-_-_-_-_-_  _-_-_-_-_-_-_-_-_-_-_-_-_-_-_  _-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_  _-_-_-_-_-_-_-_-_-_-_-_-_-_-_  _-_-_-_-_-_-_-_-_-_-_-_-_-_-_   _-_-_-_-_-_-_-_-_-_-_-_-_-_     _-_-_-_-_-_-_-_-_-_-_-_         _-_-_-_-_-_-_-_             _-_-_-_ }

As some readers may have realised, the IOCCC is the subject and setting of the (highly fictionalised) Moogieman song, The Apostate Priest Of The PDP-11.

Tags: , , , , , , ,

Comments are closed.