Obfuscate C and Win - IOCCC 2011/12 Has Started
Written by Harry Fairhead   
Monday, 14 November 2011

The IOCCC is a C programming competition with a difference - you can write code that is as horrific as you like and still expect to win.

What can you feel about a competition that is all about going against the very ethos of programming?

All you have to do to win is essentially create a tricky program. One that does something that you wouldn't expect by reading its source code. The International Obfuscated Code Contest has been around for a long time but it has fallen off the calendar recently because of organizational difficulties - look what do you expect from a competition for obfuscation? It is now back with its 20th challenge running from 12th Nov 2011 to 12th Jan 2012. This is the first since 2006.



All you have to do is write a C program that is obscure and obfuscated. Of course, there are those who think that C programmers write in this style most of the time - but I'm not one of them. Let's just say that I know one or two that could be clearer in their expression of algorithmic concepts  and it probably isn't due to them writing in C. 

But just in case you don't know what obfuscate means (and that probably indicates that you aren't a C programmer) the definition provided by the official web site is:

Obfuscate: tr.v. -cated, -cating, -cates. 1. a. To render obscure. b. To darken. 2. To confuse: his emotions obfuscated his judgment.
[LLat. obfuscare, to darken : ob(intensive) + Lat. fuscare,
to darken < fuscus, dark.] -obfuscation n. obfuscatory adj

In plain, unobfuscated, speak this means, write a program that does something that isn't obvious from its definition.

So how do you pick the best obscure program?

Well there are some guidelines. According to the official web site, the program should:

  • show the importance of programming style, in an ironic way.
  • stress C compilers with unusual code.
  • illustrate some of the subtleties of the C language.
  • provide a safe forum for poor C code. :-)

What exactly is a "safe forum" for poor C code is an interesting question. Most would want it sealed in a lead box and dropped into the Marianas Trench - or somewhere deeper if possible.




In practice the program that will win should be clever beyond belief and do something amazing. It should also be the sort of thing that once you understand how it works you have learned something of the darker side of C or the environment that C is interacting with.

You can see some of the past winners at the web site and you really do need to check that your creation hasn't already been a winner - good ideas tend to be reinvented.

One final thought... why not C++?

It could be argued that C++ would make the challenge far too easy.

Good luck and try not to do the job too well.  This is one case where winning might be considered to be losing.

More Information:

The IOCCC home page


To be informed about new articles on I Programmer, subscribe to the RSS feed, follow us on Google+, Twitter or Facebook or sign up for our weekly newsletter.



Introduction to Machine Learning with Scikit-Learn

A free course on the fundamentals of Machine Learning with Python, taught by Kevin Markham founder of Data School, helps you ease your way into ML and scikit-learn, one of the best-known libraries for [ ... ]

A Low Cost Hackable Watch

Pine makes a range of community-supported hardware that is well worth knowing about, but its new PineTime SmartWatch offers a unique opportunity to program your wrist.

More News

Last Updated ( Tuesday, 15 November 2011 )