Back to Home

C programmers commit fresh crimes against readability

Prepare to be befuddled and bamboozled – and probably bewitched

t
tech4you AI
July 5, 20267 min read
Share

The Twenty-Ninth International Obfuscated C Code Contest – or IOCCC for short – is back again with the results of the 2025 competition. This year, one of the entrants has a unique new trick up their sleeve: a valid use case.

When we reported on last year's event, it was had just been revived from a four-year hiatus, so we're happy to see it back so soon.

As we write, the judging concluded some three weeks ago, but although there is a recording on YouTube, it's very nearly three hours long. It took a while to edit it down to individual clips for each winner, which is why we are covering it now. For many of these programs, you really must see what they do to believe it, and although it's generally not our preferred format, video clips are superb for this.

There are no fewer than 23 winning entries this year, including a hat-trick of hat-tricks: three entrants, Yusuke Endoh, Nick Craig-Wood, and Don Yang, all had three winning entries each. We have room for only a few of our personal highlights, but we highly recommend reading all the winners – they are well worth your time.

One element of the IOCCC is that the judges, Landon Curt Noll and Leonid A. Broukhis, invent new categories each time for each winning entry. We're using their titles, so if the subheadings initially don't make much sense, reading the relevant IOCCC pages might explain all… but we wouldn't rely on it.

IOCCC29 – 2025/cable – Best imaginary emulator

We cannot claim to have studied every result in every IOCCC. When the first one happened in 1984, this vulture was still at school and learning BASIC. However, this year, Adrian Cable's Subleq computer was the one that grabbed our attention the most.

The reason is that we had already looked at it and what it does – or at least a closely related project. Unusually for the IOCCC, it has a real-life use case in software preservation.

The idea of the Eternal Software Initiative (ESI) is to aid in the preservation of software after its original hardware platform no longer exists by implementing a computer architecture that is specifically designed to be emulated very easily. There's a sample implementation on GitHub.

The CPU architecture isn't new; it's a One Instruction Set Computer called Subleq. OISC is the logical extrapolation of RISC: you can't reduce an instruction set any further than cutting it down to just one instruction. In this instance, that instruction is Subleq (subtract and branch if less than or equal to zero). Here's an explanation from 2020, and it wasn't new then – here's FPGA hardware from 2011 [PDF].

The ESI has implemented Subleq in software, built a C compiler to target it using LLVM, and ported Linux to it, complete with C and C++ runtime libraries. Run your emulator on that Linux, and you can bootstrap a runnable version of any hardware architecture from this tiny basis.

And we do mean tiny. This is the IOCCC winning implementation of the architecture:

#include<SDL3/SDL.h> #define o s[1&s[t=e++]?s[t]/4:t]/4,t b,y,t,e,s[3<<27],V[32],*w,**g;main(_){for(g =SDL_GetWindowSurface(w=SDL_CreateWindow(0, 800,512,!read(b,s,'frog')));_=o=y=o=o;~_?~y ?e=1>(s[y]-=_[s])?t:*s&&++b>8e5?s[memcpy(3[ g],6[s]+s,25<<16),b=SDL_UpdateWindowSurface (w)]=4*e,*s/4:e:e:SDL_PollEvent(V)?y[s]=6[V ]*(1537-2**V):0)_^64||timespec_get(s+_,1);}

That is the entire thing. It's 366 bytes long.

Yes, it does depend on the SDL libraries so it can display graphics, but even so, we hope you will agree that's pretty remarkable.

The demonstration video shows it generating a full-color Mandelbrot set, at a fairly reasonable speed, and then playing a game of Pong, before demonstrating Subleq running Linux and a few apps. When you watch this, try to remember that you could hand-write the source code on a postcard with plenty of room for the address and a stamp. It's nine lines long.

A slightly more readable version of the code is still just 91 lines long.

Nick Craig-Wood's hat-trick

To go with the Best imaginary emulator, there is also a winning Best real emulator. Nick Craig-Wood offers a working emulator for the original Nintendo Game Boy in a remarkable 66 lines of C, which he formatted to look like the console for the contest.

His other winner is the Best fractional emulator: an unbelievably tiny combination of a Commodore 64 emulator (it says here) emulated in John Conway's FRACTRAN language.

And he also won for the Best use of Unicode, which implements a version of Forth, and in the C code, contains a Forth program that generates a spinning Mandelbrot zoom.

2025/endoh1 – Most likely to dazzle

The first of Yusuke Endoh's three winning entries is a Nixie tube simulator. When The Reg FOSS desk was young, this was how electronic calculators (and some petrol pumps) displayed numbers. A Nixie tube is a tiny electrical tube with filaments in the shapes of all the digits stacked one on top of another, and it displays the desired digit by making just that filament glow. You can still buy new Nixie tubes today – a small Czech company run by Dalibor Farny hand-makes them.

Like many IOCCC entries, Endoh's source code is formatted to look like the thing it simulates. But for this entry, this is not just a fun afterthought: the program highlights the digits in its own source code in color to simulate the output of a Nixie tube. The source code itself is also the output mechanism.

We were also charmed by Endoh's second entry, voted Most likely to shock, which generates Lichtenberg figures in remarkably little space. Around the time that the IOCCC started, this vulture attempted to implement this himself, and never did get it working right.

Endoh's third winning entry, the Most resilient winner, repeatedly patches its own code, then rebuilds itself, so that it can output… the source code to the diff tool it used to do it. It is mind-bending – to this vulture at least – and it represents a remarkable and record-breaking 23rd win for the Japanese programmer.

After being shocked and dazzled by the first and second, the judges praised Tomoya Ishida's Most soothing award winner, which in just 36 lines of code – containing the message to RELAX – generates a WAV file containing a five-minute ambient tune, complete with synthetic seashore sounds.

2025/uellenberg – Ping pong prize

We thought Endoh's self-reformatting C code to output a Nixie tube from its own source was amazing, but then we saw Jonah Uellenberg's entry. His Pong game is a quine: a program that, when executed, generates its own source code as its output. As the original Wiki site C2 explains, this is substantially harder than it sounds.

Uellenberg's program goes further than we had ever imagined. As with many other IOCCC entries, it contains a message in its own source listing. If you squint a bit, you can see a Pong screen in the whitespace – two paddles and a ball.

Compile it and run it, and it takes a keystroke to move one of the paddles… then it reformats its own source code and outputs a new, slightly different version, showing the updated game screen. You play the game by repeatedly compiling the output from the previous run. Each run outputs the source code for the next game. The frames of the game are its own changing source code.

For more conventional gaming fun, the three-person Most likely to teleport winner is relatively straightforward: a roguelike game, in just 54 lines of cute code.

For Doctor Who fans, the Who won award winner by a Taiwanese coder known only as "jingp49" looks like the TARDIS and outputs – we have no idea how – an ASCII-animated version of the TV show's title sequence.

We've only highlighted a few of the winning entries here. They are all legitimately amazing for a variety of reasons. For instance, Gil Dogon's Consistently constant award winner outputs many digits of Euler's constant, but does it with just a single variable in the code – which is, naturally, named e. For added value, both the judges and the entrant explain the program in verse.

For letting us know about the contest, The Register thanks Landon Curt Noll and Reg reader Anthony C Howe. We should note that Howe did have a certain vested interest: he won the Most likely to invade award, for a truly tiny but playable game, which reminded us of a certain type of 1980s PC game that was designed to look innocent so you could play it at work.

Bootnote

The Obfuscated C Contest is not to be confused with the Underhanded C Contest, which took this sort of twisted genius and applied it to devious ends rather than fun shenanigans. ®


Originally published on The Register

Related Articles