Tic-Tac-Toe Implemented In Single Call To Printf():
[Nicholas Carlini] programmed a C implementation of two-player Tic Tac Toe, and he did it in a single call to printf(). The arguments for that single function call get mind-bendingly complex, so it may come as no surprise that it was written for The International Obfuscated C Code Contest (IOCCC).
Most of us are aware that printf() is one of those functions that is considerably more complex under the hood, and capable of far more, than it may appear to be. But did you know that it is capable of Turing-complete computation?
Can't wait to see the version that can play checkers and chess!
(Score: 1, Insightful) by Anonymous Coward on Saturday June 06 2020, @04:36PM (3 children)
With properly initialized variables, I can reduce the contents of my entire hard drive or even the whole internet to the same line of code.
This is going to be a huge breakthrough for data compression.
(Score: 4, Funny) by sgleysti on Sunday June 07 2020, @02:39AM (1 child)
How else do you think the big bang happened?
(Score: 0) by Anonymous Coward on Sunday June 07 2020, @04:36PM
In sufficient number that all parameters could be set randomly at runtime, eliminating the need for any inputs.
(Score: 0) by Anonymous Coward on Sunday June 07 2020, @01:24PM
Exactly. The code is actually dozens of lines long. Calling it "1 line" is like saying MS Word is only 1 line because all you need to type is word.exe.