less_retarded_wiki/ioccc.md
2024-08-15 12:41:06 +02:00

2.4 KiB

International Obfuscated C Code Contest

The International Obfuscated C Code Contest (IOCCC for short) is an annual online contest in making the most creatively obfuscated programs in C. It's kind of a "just for fun" thing but similarly to esoteric languages there's an element of art and clever hacking that carries a high value. While the productivity freaks will undeniably argue this is nothing more than a waste of time, the true programmer appreciates the depth of knowledge and creative thinking required to develop a beautifully obfuscated program. The contest has been around since 1984 and was started by Landon Curt Noll and Larry Bassel.

Unfortunately some shit is surrounding IOCCC too, for example confusing licensing -- having a CC-BY-SA license in website footer and explicitly prohibiting commercial use in the text, WTF? Also the team started to use Microshit's GitHub. They also allow latest capitalist C standards, but hey, this is a contest focused on ugly C, so perhaps that makes sense after all.

Hacking the rules of the contest is also encouraged and there is an extra award for "worst abuse of the rules".

To list a few common ideas employed in the programs let's mentioned these:

  • formatting source code as ASCII art
  • misleading identifiers and comments
  • extreme macro/preprocessor abuse
  • abuse of compiler flags
  • different behavior under different C standards
  • doing simple things the hard way, e.g. by avoiding loops
  • including weird files like /dev/tty or recursively including itself
  • code golfing
  • weird stuff like the main function recursion or even using it as a signal handler :)
  • ...

And let us also mention a few winning entries:

  • program whose source code is taken from its file name (using __FILE__)
  • ray tracer in < 30 LOC formatted as ASCII art
  • operating system with multi-tasking, GUI and filesystem support
  • neural machine learning on text in < 4KB
  • program printing "hello world" with error messages during compilation
  • X11 Minecraft-like game
  • web browser
  • self-replicating programs
  • ...

See Also