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: 4, Funny) by Anonymous Coward on Saturday June 06 2020, @04:12PM (4 children)

    by Anonymous Coward on Saturday June 06 2020, @04:12PM (#1004216)

    Poettering reads this article and decides to implement printf() in SystemD.

    Starting Score:    0  points
    Moderation   +4  
       Funny=3, Underrated=1, Total=4
    Extra 'Funny' Modifier   0  

    Total Score:   4  
  • (Score: 2) by RS3 on Saturday June 06 2020, @06:43PM

    by RS3 (6367) on Saturday June 06 2020, @06:43PM (#1004272)

    Poettering reads this article and decides to implement printf() in SystemD. decries "Hey, someone pirated my systemd code!"

  • (Score: 3, Informative) by DECbot on Saturday June 06 2020, @11:09PM

    by DECbot (832) on Saturday June 06 2020, @11:09PM (#1004359) Journal

    printfctl --turn=x --tictactoe=TOP-LEFT | systemctl reload tictactoed | journalctl -u tictactoed.service && systemctl --minesweeper=fair restart networking

    --
    cats~$ sudo chown -R us /home/base
  • (Score: 0) by Anonymous Coward on Sunday June 07 2020, @04:24AM (1 child)

    by Anonymous Coward on Sunday June 07 2020, @04:24AM (#1004409)

    You're not as clever as you think you are.

    • (Score: 1, Touché) by Anonymous Coward on Sunday June 07 2020, @11:17AM

      by Anonymous Coward on Sunday June 07 2020, @11:17AM (#1004468)

      +4 up-votes say otherwise, Lennart.