Tic-tac-toe possible grids

86 Views Asked by At

Let's consider the tic-tac-toe game, with two players and a natural number n of rows and columns (X starts; the winning player is the first who fills up a row, a column, the diagonal or the antidiagonal). Is it true that all the possible grids that may occur during the game are exactly those in which the difference between the X's and the O's is 0 or 1?

EDIT: Thanks to the helpful comments I've realised that that condition is necessary but not sufficient. Even so, is there any "easy" necessary and sufficient condition to establish whether a grid is a reachable game state?