Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There is something weird in the implementation...

> Try adding two X's in a row. It will not work. It's waiting for an O, and once that is triggered it waits for an X and so on.

If you try to make a move out of turn it seems like the illegal move is still "queued up" somehow. So as soon as you make a legal move the previously attempted illegal one occurs, as it's now legal.

In fact, this resulted in an interesting game where both sides won:

    { type: "X", payload: 0 }
    { type: "O", payload: 8 }
    { type: "X", payload: 1 }
    { type: "O", payload: 2 }
    { type: "X", payload: 3 }
    { type: "O", payload: 6 }
    { type: "X", payload: 7 }
    { type: "O", payload: 5 }
    { type: "X", payload: 4 }
    { type: "XWins" }
    { type: "OWins" }
I guess it needs a few more behaviours...


Which version outputs this behavior? The earlier ones are on purpose buggy. As the computer bthread is added there's no way for it to start at tile 8.

The point was to show how by adding new bthreads the system gets smarter and less buggy.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: