ҹ1000

Competition opens to find the world’s most perplexing computer code

Software developers entering the International Obfuscated C Code Contest must write programs that look baffling, but perform unusual, unexpected or catastrophic tasks
International Obfuscated C Code Contest. 2011 entry which downsamples PGM, PPM images and ASCII art (of Akari from YuruYuri) by Don, Yang https://en.wikipedia.org/wiki/International_Obfuscated_C_Code_Contest
A 2011 entry to the International Obfuscated C Code Contest, designed to look like a manga character
PGM/PPM images and ASCII art by Don, Yang

Computer programmers are being challenged to write the world’s sneakiest and most confusing code in a competition that opens next week. To win, entrants must find ways to write programs in the C language that baffle judges on first reading, then perform unusual, unexpected or catastrophic tasks when run.

The (IOCCC) began in 1984 and its co-founder, , says it is the longest-running online competition of any kind. Noll and co-founder conceived of the competition while employed to fix bugs in the Genix operating system.

“We both came out of our offices at the same time, sort of saying: ‘You wouldn’t believe the code I’m trying to fix’,” says Noll. The pair wondered at the ugly and fragile code that people wrote while trying to create good software and decided to see how bad things could get if people actively aimed for bad code.

“[The competition] has a lot of fun in terms of odd things that people do, but it also is really stressing the importance of writing quality code,” says Noll. “These programs that win are almost unmaintainable. They are sometimes written in such a twisted, interlocking way that just to fix something would break them.”

Winners are announced in various categories that change from year to year, including “most enigmatic”, “most irrational” and “best abuse of the rules”.

The competition has been on hiatus since 2020, but will reopen for entries on 19 February, running until May. Programs mustn’t exceed 4993 bytes and former winners have managed to squeeze chess-playing engines, entire operating systems and simulations of real computer chips into that tiny amount of memory.

One entry deliberately crashed itself when run, spilling its internal state into memory and then using that dump of zeroes and ones as a starting point for its next iteration. Entries are often visually interesting, such as a flight simulator whose code was in the shape of an aircraft.

“Occasionally we get an entry that’ll just stop us in our tracks, saying ‘how is this doing what it’s doing?’, and we have to struggle [to understand it],” says Noll.

, a software engineer at Walt Disney Animation Studios in California, won the “best calculated risk” category in 2004 with a poker game written in a single statement. Usually, all but the simplest programs would contain dozens or hundreds of statements.

“I had a colleague congratulate me. I was surprised anyone noticed, to be honest,” says Burley. “I’m quite proud of my win and feature it on my LinkedIn profile. If I saw an IOCCC win on a résumé, I would be impressed.”

Another former winner, who asked to remain anonymous, says: “In the industry where I work, obfuscated code raises immediate suspicion.” But they were drawn to enter because of the conciseness, and even elegance, of the code on show.

“The competition is undoubtedly fun, but what impresses me most is the expressiveness of C. While there may not be much left to learn about the C language itself, the strict size constraints push participants to distil complex ideas into remarkably compact implementations,” they say.

Topics: Computing