Skip to content
Tech News
← Back to articles

Klondike Solitaire game for curses in 5k of C

read original get Klondike Solitaire C Game → more articles

Klondike Solitaire for curses in 5k

by Oscar Toledo G. Jun/07/2026

I had some free time, and I noticed the 29th IOCCC started. So I decided to code an entry for the contest. If you haven't heard about the International Obfuscated C Code Contest , it is a contest running since 1984 and created by Landon Curt Noll. The objective of this contest is writing an obfuscated C program under certain size limitations specified by the rules.

You can see my previous winning entries for the IOCCC in the Contests section

This year the maximum size is 4993 bytes (a little less than 5 kilobytes), and the number of printable characters is 2503. As there are some special rules for printable characters, there is now a tool called iocccsize for checking this.

Whenever I say obfuscated C, it is the way of writing C code in a form that does the objective but it isn't clear. For example, a simple loop counting from 1 to 10 is written like this:

#include <stdio.h> int main(void) { int c; for (c = 1; c <= 10; c++) printf("%d

", c); }

But using a small fraction of the C syntax power, we can do it this way:

#include <stdio.h> int main(void) {int c=1;while(printf("%d

... continue reading