6/7/2026 at 6:35:18 AM
The GameBoy emulator's code also looks like the GameBoy. Slow clap this is insane, definitely my favorite entry.https://github.com/ioccc-src/winner/blob/master/2025/ncw1/pr...
The author, Nick Craig-Wood, is the creator of rclone!
by haunter
6/7/2026 at 8:48:47 AM
Glad you enjoyed it :-)If you want to see how the sausage was made, here is the source:
https://github.com/ncw/ioccc-gameboy
You'll find an unobfuscated version (kind-of) there too. This the the one I actually worked on then I had a program squash all the variable names and squeeze it into the gameboy shape
The size limit for the entry was the killer. You are allowed 2503 non white space characters (a simplification - the rules are complicated) in IOCCC entries and 4K total code size. This isn't a lot to fit a Z80 processor and a GameBoy hardware emulator in!
I first wrote a full Gameboy emulator in C. It started out at about 6000 non white space characters. I then spent about about 100 hours work trying to get it to fit into the 2503 limit. For a long time I wasn't sure it was going to fit.
I decided making the emulator play Tetris (which is a fairly simple game) was the target so I stripped out features like the half carry flag in the Z80 emulator and the windowing system in the Gameboy emulation which Tetris didn't need. I also abused the C code terribly doing things with implicit int I can never un-see. I also got creative with the IOCCC rules which are implemented in a C program which checks your source and I spent some time reverse engineering that looking for loopholes! I discovered that the operators defined in <iso646.h> only count for one token which was very useful.
Once I had it small enough I had to supply some games to run with it. I created 4, a test program written in z80 assembler, a pi calculator (written in assembler), a 3d tic tac toe game (written in C with gbdk-2020) and a chess program also written in C. I discovered that quite a few open source games ran on the emulator too so I added a downloader for those where I could. Apparently not many games use BCD arithmetic - who would have thought!
It was a fun project.
by nickcw
6/7/2026 at 10:05:37 PM
Very cool! Clearly I had a long way to go with mine to get it under the IOCCC requirements :) Though my goal was specifically Pokémon... curious how much more you would need to be able to run that.by binji
6/7/2026 at 8:53:43 AM
Uh... is this supposed to be valid standalone C?GCC says there are a bunch of undefined symbols, first one being "R" right in the beginning:
typedef unsigned char u;
u w,X,T,D[1<<16],t[]=R,U=255;
by kees99
6/7/2026 at 8:55:34 AM
That's defined in Makefileby dezgeg
6/7/2026 at 9:08:05 AM
That is correct. It is cheating, but the judges let a small amount of it slide, especially if you come up with an amusing enough justification. I could not get it to fit otherwise!by nickcw
6/7/2026 at 8:37:03 PM
I'm not a judge or a competitor, but I feel like a little bit of cheating on the rules is within the spirit of the game. Especially if it a) it makes it more obfuscated and b) it wouldn't have fit otherwise.by toast0
6/7/2026 at 7:46:21 PM
"The best kind of correct." -No. 1.0, How Hermes Got his Groove Back, Futuramaby ncr100
6/8/2026 at 11:57:20 AM
Considering that one historical entry (winner maybe?) consisted of a source file that simply contained the character ‘c’, plus a makefile, I’d say it’s in the ball park.by taneq
6/7/2026 at 6:52:44 AM
Damn, that is cool! Looking at me typing css & php...by sourcecodeplz
6/7/2026 at 5:31:31 PM
https://github.com/ncw/ccforthby 1vuio0pswjnm7
6/7/2026 at 5:26:15 PM
It's an overdone trope in obfuscated programming contests - to make the code look like a picture.by trumpdong
6/7/2026 at 5:37:16 PM
It's a trope, I would not say it's overdone! :)by qingcharles
6/7/2026 at 8:25:43 PM
There’s a company that’s become very successful selling basic sponges shaped like smiley faces.by Waterluvian