Stories
Slash Boxes
Comments

SoylentNews is people

SoylentNews is powered by your submissions, so send in your scoop. Only 16 submissions in the queue.
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: 0) by Anonymous Coward on Saturday June 06 2020, @05:54PM (3 children)

    by Anonymous Coward on Saturday June 06 2020, @05:54PM (#1004259)

    He doesn't explain move-evaluation as far as I can tell.

    From TFS:

    it may come as no surprise that it was written for The International Obfuscated C Code Contest [ioccc.org] (IOCCC).

  • (Score: 2) by looorg on Saturday June 06 2020, @06:18PM (1 child)

    by looorg (578) on Saturday June 06 2020, @06:18PM (#1004265)

    Yes. I did read that to. But considering that he explained a lot of other things he did one could perhaps expect or wonder how he evaluated moves in the game. Considering that is a fairly important aspect of tic-tac-toe.

    • (Score: 0) by Anonymous Coward on Saturday June 06 2020, @07:51PM

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

      A fair point.

      I focused on the "obfuscated" part. :)

  • (Score: 0) by Anonymous Coward on Sunday June 07 2020, @01:26PM

    by Anonymous Coward on Sunday June 07 2020, @01:26PM (#1004492)

    That's not exactly an explanation now is it?