The International Obfuscated C Code Contest is back for 2024
(2025/08/09)
- Reference: 1754731685
- News link: https://www.theregister.co.uk/2025/08/09/ioccc_2024/
- Source link:
The IOCCC, as it's familiarly known, is back after a four-year gap, giving the entrants more time to come up with some remarkably devious code.
This week, the results for the [1]IOCCC 2024 were announced, with a record 23 winners. It's the first IOCCC in four years, but you shouldn't take that to imply it's as regular as the Olympics. In fact, almost nothing about the IOCCC is regular: this was the 28th edition of the event, and celebrated its 40th anniversary.
We confess that we have not yet studied the source of all the winners closely, but we have already got some personal favorites. [2]Adrian Cable won the [3]"Prize in murky waters" for this magnificent effort: #include
unsigned int *salmon = U" is very yummy";
#define grill ;while(putchar(*salmon++))
#undef grill
#define grill
#undef grill
int main() {
for (int i = 1; i
Dr Cable offered this [4]23 second Youtube clip by way of explanation. The chances are that you may already be familiar with it, but if not, it won't take you long. We also confidently predict that it will not help in any way.
Whatever you think the code does when run, you're wrong, but you're not going to believe what it actually does generate. Don't try to copy and paste it from the above, because as well as flagrant abuse of the C programming language, it also contains flagrant abuse of Unicode encoding. The IOCCC organizers have their own explanation, which will show you what this infernal masterpiece does in fact do.
[5]
[6]Youtube Video
[7]
[8]
We were also profoundly impressed by one of [9]Ilya Kurdyukov 's entries, which won the [10]"Prize in phased periodicity." Its code is barely longer but arguably more decorative: #include
#include
a,b=44,x,
y,z;main() {!a
?a=2551443,x= -b
,y=2-b,z=((time (
0)-592531)%a8]),y b?0
:main();}
Formatted to look like a quarter-illuminated moon, its 295 characters of code draw the Earth's moon in its current phase on your console. For extra amusement value, it doesn't use any floating point. Instructions are provided how to amend a few characters to get the view from the southern hemisphere, or for more pleasing results if your terminal isn't bright-on-dark.
[11]Youtube Video
It reminds us of probably the [12]most famous code comment of all time, by Dennis Ritchie in Sixth Edition UNIX: /* You are not expected to understand this */
We also call out two more entries for honorable mentions. The main [13]program file of Nicholas Carlini's [14]"Prize in perfect timing" is only 14 lines long and contains 4.88 kB of code, but via various bits of skullduggery, it implements a complete Intel 4004 emulator, including the [15]Busicom 141-pf calculator for which this first ever microprocessor was designed. Including its drum printer.
[16]Youtube Video
[17]
Another goes to [18]Anthony C. Howe , not so much for his prize in the [19]"Nice accent eh-ward" category, but for the fact that this is his [20]seventh win covering a remarkable four decades.
The IOCCC celebrates highly irregular code. It started with a [21]flame on USENET , stating:
winning entries will be posted to net.lang.c after April 12, 1894. (thats the prize folks)
It was on the net.lang.c newsgroup because Tim Berners-Lee hadn't got round to inventing the World Wide Web yet, but it wasn't quite as early as the date there suggests. In 1894, the state of the computing art was one of [22]George Grant's Difference Engines .
This typo in the date started a long tradition of typos, and general word-play, in the contest itself. If it were not already apparent, this includes the names of the prize-winning categories.
[23]FFmpeg 6.1 drops a Heaviside dose of codec magic
[24]Toaster-friendly alternative web protocol Gemini attracts criticism for becoming exclusive clique
[25]The Pi who loved me: Licensed to SSL
[26]C++ Futures: Lambda Functions
The contest's [27]Readme on Github contains a history of the competition, including its origins in attempting to debug some of the original Unix [28]Bourne Shell C source code. Why that was an exercise in frustration may not be apparent if you've never looked at the sh [29]BSD source code . Thanks to some [30]very strange macros , the source code looks more like ALGOL than C: /* check for meta chars */
BEGIN
REG BOOL slash; slash=0;
WHILE !fngchar(*cs)
DO IF *cs++==0
THEN IF rflg ANDF slash THEN break; ELSE return(0) FI
ELIF *cs=='/'
THEN slash++;
FI
OD
END
Yes, that really is C. You may be able to see how it would drive an innocent coder to despair, even madness.
The [31]same two judges have been assessing the contest for four decades, and these days have embraced [32]social media . Even if you are a healthy well-adjusted techie who wouldn't touch C if you were paid to, we think it's well worth a look.
Bootnote
Our thanks to Reg reader Yann G. for telling us that the contest was back – and the results were in.
Get our [33]Tech Resources
[1] https://www.ioccc.org/2024/index.html
[2] https://www.linkedin.com/in/adrian-cable-91730221/
[3] https://www.ioccc.org/2024/cable2/index.html
[4] https://www.youtube.com/watch?v=T8XeDvKqI4E
[5] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2aJccO9EybkErEIMKXX67iQAAAQg&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0
[6] https://www.youtube.com/watch?v=RMI5oT9U4vc
[7] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44aJccO9EybkErEIMKXX67iQAAAQg&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[8] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33aJccO9EybkErEIMKXX67iQAAAQg&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[9] https://www.linkedin.com/in/ilya-kurdyukov-a7304119b/
[10] https://www.ioccc.org/2024/kurdyukov1/index.html
[11] https://www.youtube.com/watch?v=b2WfQdGJS8s
[12] https://web.archive.org/web/20040206202840/http://cm.bell-labs.com/cm/cs/who/dmr/odd.html
[13] https://github.com/ioccc-src/winner/blob/master/2024/carlini/prog.c
[14] https://www.ioccc.org/2024/carlini/index.html
[15] http://www.vintagecalculators.com/html/busicom_141-pf.html
[16] https://www.youtube.com/watch?v=r6wUZUaaJBY
[17] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44aJccO9EybkErEIMKXX67iQAAAQg&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[18] http://www.snert.com/
[19] https://www.ioccc.org/2024/howe/index.html
[20] https://www.ioccc.org/authors.html#Anthony_C_Howe
[21] https://groups.google.com/g/net.lang.c/c/lx-TAuEyeRI/m/HdOOnNx6LC0J?hl=en
[22] http://www.computer-timeline.com/timeline/george-grant/
[23] https://www.theregister.com/2023/11/24/ffmpeg_6_1/
[24] https://www.theregister.com/2022/01/27/gemini_protocol/
[25] https://www.theregister.com/2019/07/16/verity_stob_column_july/
[26] https://www.theregister.com/2006/09/22/cplusplus-lambda-future/
[27] https://github.com/ioccc-src/winner
[28] https://en.wikipedia.org/wiki/Bourne_shell#Features_of_the_original_version
[29] https://github.com/dank101/4.2BSD/tree/708b3890ac0c2f034f2840b5ee9125b3c83a05bc/bin/sh
[30] https://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/sh/mac.h
[31] https://www.ioccc.org/judges.html
[32] https://www.ioccc.org/social.html
[33] https://whitepapers.theregister.com/
This week, the results for the [1]IOCCC 2024 were announced, with a record 23 winners. It's the first IOCCC in four years, but you shouldn't take that to imply it's as regular as the Olympics. In fact, almost nothing about the IOCCC is regular: this was the 28th edition of the event, and celebrated its 40th anniversary.
We confess that we have not yet studied the source of all the winners closely, but we have already got some personal favorites. [2]Adrian Cable won the [3]"Prize in murky waters" for this magnificent effort: #include
unsigned int *salmon = U" is very yummy";
#define grill ;while(putchar(*salmon++))
#undef grill
#define grill
#undef grill
int main() {
for (int i = 1; i
Dr Cable offered this [4]23 second Youtube clip by way of explanation. The chances are that you may already be familiar with it, but if not, it won't take you long. We also confidently predict that it will not help in any way.
Whatever you think the code does when run, you're wrong, but you're not going to believe what it actually does generate. Don't try to copy and paste it from the above, because as well as flagrant abuse of the C programming language, it also contains flagrant abuse of Unicode encoding. The IOCCC organizers have their own explanation, which will show you what this infernal masterpiece does in fact do.
[5]
[6]Youtube Video
[7]
[8]
We were also profoundly impressed by one of [9]Ilya Kurdyukov 's entries, which won the [10]"Prize in phased periodicity." Its code is barely longer but arguably more decorative: #include
#include
a,b=44,x,
y,z;main() {!a
?a=2551443,x= -b
,y=2-b,z=((time (
0)-592531)%a8]),y b?0
:main();}
Formatted to look like a quarter-illuminated moon, its 295 characters of code draw the Earth's moon in its current phase on your console. For extra amusement value, it doesn't use any floating point. Instructions are provided how to amend a few characters to get the view from the southern hemisphere, or for more pleasing results if your terminal isn't bright-on-dark.
[11]Youtube Video
It reminds us of probably the [12]most famous code comment of all time, by Dennis Ritchie in Sixth Edition UNIX: /* You are not expected to understand this */
We also call out two more entries for honorable mentions. The main [13]program file of Nicholas Carlini's [14]"Prize in perfect timing" is only 14 lines long and contains 4.88 kB of code, but via various bits of skullduggery, it implements a complete Intel 4004 emulator, including the [15]Busicom 141-pf calculator for which this first ever microprocessor was designed. Including its drum printer.
[16]Youtube Video
[17]
Another goes to [18]Anthony C. Howe , not so much for his prize in the [19]"Nice accent eh-ward" category, but for the fact that this is his [20]seventh win covering a remarkable four decades.
The IOCCC celebrates highly irregular code. It started with a [21]flame on USENET , stating:
winning entries will be posted to net.lang.c after April 12, 1894. (thats the prize folks)
It was on the net.lang.c newsgroup because Tim Berners-Lee hadn't got round to inventing the World Wide Web yet, but it wasn't quite as early as the date there suggests. In 1894, the state of the computing art was one of [22]George Grant's Difference Engines .
This typo in the date started a long tradition of typos, and general word-play, in the contest itself. If it were not already apparent, this includes the names of the prize-winning categories.
[23]FFmpeg 6.1 drops a Heaviside dose of codec magic
[24]Toaster-friendly alternative web protocol Gemini attracts criticism for becoming exclusive clique
[25]The Pi who loved me: Licensed to SSL
[26]C++ Futures: Lambda Functions
The contest's [27]Readme on Github contains a history of the competition, including its origins in attempting to debug some of the original Unix [28]Bourne Shell C source code. Why that was an exercise in frustration may not be apparent if you've never looked at the sh [29]BSD source code . Thanks to some [30]very strange macros , the source code looks more like ALGOL than C: /* check for meta chars */
BEGIN
REG BOOL slash; slash=0;
WHILE !fngchar(*cs)
DO IF *cs++==0
THEN IF rflg ANDF slash THEN break; ELSE return(0) FI
ELIF *cs=='/'
THEN slash++;
FI
OD
END
Yes, that really is C. You may be able to see how it would drive an innocent coder to despair, even madness.
The [31]same two judges have been assessing the contest for four decades, and these days have embraced [32]social media . Even if you are a healthy well-adjusted techie who wouldn't touch C if you were paid to, we think it's well worth a look.
Bootnote
Our thanks to Reg reader Yann G. for telling us that the contest was back – and the results were in.
Get our [33]Tech Resources
[1] https://www.ioccc.org/2024/index.html
[2] https://www.linkedin.com/in/adrian-cable-91730221/
[3] https://www.ioccc.org/2024/cable2/index.html
[4] https://www.youtube.com/watch?v=T8XeDvKqI4E
[5] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2aJccO9EybkErEIMKXX67iQAAAQg&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0
[6] https://www.youtube.com/watch?v=RMI5oT9U4vc
[7] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44aJccO9EybkErEIMKXX67iQAAAQg&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[8] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33aJccO9EybkErEIMKXX67iQAAAQg&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0
[9] https://www.linkedin.com/in/ilya-kurdyukov-a7304119b/
[10] https://www.ioccc.org/2024/kurdyukov1/index.html
[11] https://www.youtube.com/watch?v=b2WfQdGJS8s
[12] https://web.archive.org/web/20040206202840/http://cm.bell-labs.com/cm/cs/who/dmr/odd.html
[13] https://github.com/ioccc-src/winner/blob/master/2024/carlini/prog.c
[14] https://www.ioccc.org/2024/carlini/index.html
[15] http://www.vintagecalculators.com/html/busicom_141-pf.html
[16] https://www.youtube.com/watch?v=r6wUZUaaJBY
[17] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44aJccO9EybkErEIMKXX67iQAAAQg&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[18] http://www.snert.com/
[19] https://www.ioccc.org/2024/howe/index.html
[20] https://www.ioccc.org/authors.html#Anthony_C_Howe
[21] https://groups.google.com/g/net.lang.c/c/lx-TAuEyeRI/m/HdOOnNx6LC0J?hl=en
[22] http://www.computer-timeline.com/timeline/george-grant/
[23] https://www.theregister.com/2023/11/24/ffmpeg_6_1/
[24] https://www.theregister.com/2022/01/27/gemini_protocol/
[25] https://www.theregister.com/2019/07/16/verity_stob_column_july/
[26] https://www.theregister.com/2006/09/22/cplusplus-lambda-future/
[27] https://github.com/ioccc-src/winner
[28] https://en.wikipedia.org/wiki/Bourne_shell#Features_of_the_original_version
[29] https://github.com/dank101/4.2BSD/tree/708b3890ac0c2f034f2840b5ee9125b3c83a05bc/bin/sh
[30] https://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/sh/mac.h
[31] https://www.ioccc.org/judges.html
[32] https://www.ioccc.org/social.html
[33] https://whitepapers.theregister.com/