
Harary's generalized tic-tac-toe is an even broader generalization of tic-tac-toe. The game can be generalized to an m, n, k-game, in which two players alternate placing stones of their own color on an m-by- n board with the goal of getting k of their own color in a row. If played optimally by both players, the game always ends in a draw, making tic-tac-toe a futile game. It is straightforward to write a computer program to play tic-tac-toe perfectly or to enumerate the 765 essentially different positions (the state space complexity) or the 26,830 possible games up to rotations and reflections (the game tree complexity) on this space. Hence, tic-tac-toe is often played by young children who may not have discovered the optimal strategy.īecause of the simplicity of tic-tac-toe, it is often used as a pedagogical tool for teaching the concepts of good sportsmanship and the branch of artificial intelligence that deals with the searching of game trees. Players soon discover that the best play from both parties leads to a draw.

There is no universally agreed rule as to who plays first, but in this article the convention that X plays first is used. In the following example, the first player ( X) wins the game in seven steps: Tic-tac-toe is played on a three-by-three grid by two players, who alternately place the marks X and O in one of the nine spaces in the grid. While the term nought is now less commonly used, the name "noughts and crosses" is still preferred over the American name "tic-tac-toe" in these countries. This name derives from the shape of the marks in the game (i.e the X and O) "nought" is an older name for the number zero, while "cross" refers to the X shape. In Commonwealth English (particularly British, South African, Australian and New Zealand English), the game is known as "noughts and crosses". In American English, the game is known as "tic-tac-toe". It is a solved game, with a forced draw assuming best play from both players. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row is the winner.

Tic-tac-toe ( American English), noughts and crosses ( Commonwealth English), or Xs and Os ( Canadian or Irish English) is a paper-and-pencil game for two players who take turns marking the spaces in a three-by-three grid with X or O.
