So I built an algorithm that tries to lose tictactoe no matter what. If you'd like to battle your algorithm against mine, I think it would be fun. This is the spec of what your server should accept & return. If you built an algorithm that can beat it, please tweet me @bunsen.
Your server should accept GET requests with the following parameters:
row
col
mark
grid
- will be a url encoded array, like this:[["x",%20"x",%20nil],%20[nil,%20nil,%20"o"],%20[nil,%20"o",%20nil]]
It should return JSON that looks like this:
{
"row": 1,
"col": 0,
"grid": [
["x", "x", null],
["o", "x", "o"],
[null, "o", null]
]
}
Where row
& col
are your response moves & grid
is how the game looks to you after your move.