IOCCC image by Matt Zucker

The International Obfuscated C Code Contest

2025/endoh1 - Most likely to dazzle

Nixie tube display

Author:

Award: Most likely to dazzle

To build:

    make all

Try:

    ./try.sh

    ./timer.sh 15

    ./clock.sh

Alternate code:

The 2025/endoh1/prog.alt.c is C code “identical” to 2025/endoh1/prog.c with the simple addition of trailing whitespace to make each line of source 42 characters wide. I.e., this prints nothing:

    diff -w prog.c prog.alt.c

Alternate build:

    make alt

Alternate use:

    ./try.alt.sh

Judges’ remarks:

To best appreciate this interesting IOCCC winner, it helps to be familiar with Nixie tubes.

Look at the 2025/endoh1/prog.c source code. What else lies below the surface of the source code? That is a significant challenge, even if you clang-format to view the code.

Running the 2025/endoh1/try.sh shell script may give your a hint. :-)

A fun challenge

Create a second alternative form of prog.c (i.e., prog.alt2.c) that also works with UPPER CASE LETTERS. You would certainly have to embiggen the tube size to better distinguish individual letters and digits. Such code would be a cromulent addition to 2025/endoh1.

The above fun challenge is still open. See the “Fun challenge Info” section for details.

Author’s remarks:

This program selectively illuminates specified characters within a text stream.

Assuming you possess a terminal capable of rendering 256 colors, compile and run it as follows:

    make
    ./prog X < some-file

You will observe that every ‘X’ is now glowing – not merely highlighted, but radiating a warm bloom that fades into the surrounding darkness, much like a heated filament.

You may also specify multiple characters simultaneously, should a single glowing letter be insufficient for your needs.

Consider as a suitable “some-file”, the contents of 2025/endoh1/prog.c:

    ./prog CIO < prog.c
    ./prog 025 < prog.c

This program is heavily inspired by the Nixie tube.

A real Nixie tube is a glass envelope containing ten wire-mesh cathodes, each shaped like a digit 0 through 9, all stacked inside a single tube. When voltage is applied to one cathode, that digit alone glows in neon orange while the others remain dark.

Naturally, the source code itself is shaped like one. At the top sits a rounded glass bulb, labeled “IOCCC” with “MMXXV” stamped below it like a manufacturer’s date code. At the bottom, a row of pins extends downward, ready to be socketed into a circuit board.

And it is not merely decorative – it actually functions as one. All ten digit shapes are layered within the same glass tube of C code. Try feeding the source to itself:

    ./prog 0 < prog.c
    ./prog 1 < prog.c
    ./prog 2 < prog.c
    ...
    ./prog 9 < prog.c

Each digit (0-9) within the code is strategically placed so that, when illuminated, the glowing characters form the exact shape of the requested number.

You can even light up all cathodes at once, just as a Nixie tube is tested before shipping:

    ./prog 0123456789 < prog.c

To achieve this effect, the source code had to be written under severe typographic constraints. Every numeric literal in the program serves double duty: it must evaluate to the correct value for the computation, and it must sit at the precise position required to draw its own shape.

Caveats

Inventory for 2025/endoh1

Primary files

Secondary files


 Jump to: top