Giter Club home page Giter Club logo

printf-tac-toe's People

Contributors

carlini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

printf-tac-toe's Issues

not turing complete

You printf() program is not Turing complete as it require an external while() loop to work. It would be turing complete if this control structure was embedded inside the printf() arguments.

game has a bug

this is super interesting!!

although i don't completely understand how this works, i just found a bug โ€” if your opponent places their letter on position already taken by you they just win automatically.

Doesn't work via PuTTY

Before reading my issue, please know that I'm very impressed with this, and I got a lot out of reading the README - thank you / really well done!


I'm using PuTTY v0.73 to access an Ubuntu 18.04 machine, compiled as per the README.

Step 1: Run, empty board is presented:

image

Step 2: Enter 5 and press Return:

image

Step 3: Enter 1 and press Return:

image


It turns out that the string PuTTY is sent to stdin... I've never quite figured out what causes these to occur, and I've seen them in the past too - mainly when accidentally writing binary data to stdout.

If I remove the PuTTY input with 5x Backspace then I can play the game... if I'm lucky...


However, I also notice that playing the following game, results in some "invisible" characters in the input buffer, allowing me to press backspace, and get the cursor to wrap back on to the previous line:

5, 1, 7, 3

image

If I do clear this "invisible" input, then the following game runs to completion:

5, 1, 7, 3, 2, 8, 4, 6, 9

image

If I don't clear this "invisible" intput (i.e: I only press 5x Backspace to remove the PuTTY, or multiple thereof), then the game goes wonky... it may run to the end, or it may make wrong statements.

image


I suspect that this "invisible" input is also related to PuTTY, hence putting all of this in a single issue.

About README

You wrote

Computing the NOT of a single value is also easy:

printf("%1$255d%1$s%hhn", a, b)

will compute

*b = (strlen(a)+255)%256 = strlen(a)-1

and again, because strlen(x) is either 1 or 0 we have

*c = !b

Well,in *c=!b ,where does c come from? Do you mean *b=!a ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.