Stories
Slash Boxes
Comments

SoylentNews is people

posted by martyb on Saturday June 06 2020, @04:06PM   Printer-friendly
from the your-move dept.

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!


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 1, Interesting) by Anonymous Coward on Saturday June 06 2020, @07:21PM (2 children)

    by Anonymous Coward on Saturday June 06 2020, @07:21PM (#1004280)

    What do you mean? *d is initially 1, so the while loop would be infinite unless there is an assignment of 0 to d[0] at some point, which is probably this obfuscated vm's version of exit().

    Starting Score:    0  points
    Moderation   +1  
       Interesting=1, Total=1
    Extra 'Interesting' Modifier   0  

    Total Score:   1  
  • (Score: 2) by RS3 on Saturday June 06 2020, @09:00PM (1 child)

    by RS3 (6367) on Saturday June 06 2020, @09:00PM (#1004323)

    I was joking. Can you see the :) smiley? Maybe you're not aware of smileys?

    • (Score: 4, Funny) by sgleysti on Sunday June 07 2020, @02:41AM

      by sgleysti (56) Subscriber Badge on Sunday June 07 2020, @02:41AM (#1004396)

      I was joking. Can you see the smiley? Maybe you're not aware of smileys?

      Unfortunately, I have no idea what you're referring to. :(