Author:
- Name: Yusuke Endoh
Location: JP - Japan
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
- The maximum width and height of the input text must be strictly less than
9*8+20*24/12*20-2-8*93. For a perfectly clear explanation of this threshold, please refer to Line 9 of the source code. - This program makes the bold assumption that you are using ASCII. Do not attempt to run it on an EBCDIC platform, unless you enjoy undefined behavior more than most.
- Speaking of which: behavior is undefined if the input contains anything other than a newline (10) or printable ASCII characters (32-126).
Inventory for 2025/endoh1
Primary files
- prog.c - entry source code
- Makefile - entry Makefile
- prog.alt.c - alternate source code
- prog.orig.c - original source code
- clock.sh - display a 24 hour Nixie tube clock
- colon.txt - clock colon
- digits.sh - display the digits 0 thru 9
- spaces.txt - clock space
- timer.sh - countdown timer
- try.alt.sh - script to try alternate code
- try.sh - script to try entry
Secondary files
- 2025_endoh1.tar.bz2 - download entry tarball
- README.md - markdown source for this web page
- .entry.json - entry summary and manifest in JSON
- .gitignore - list of files that should not be committed under git
- .path - directory path from top level directory
- .date-range - copyright date range for this directory
- index.html - this web page
Jump to: top
