Tic-tac-toe, also called 'wick wack woe' in some Asian countries and 'noughts and crosses' in the UK, Australia, New Zealand, South Africa, India and the rest of the British Commonwealth countries, is a game for two players, X and O, who take turns marking the spaces in a 3×3 grid. The X player usually goes first. The player who succeeds in placing three respective marks in a horizontal, vertical, or diagonal row wins the game.
♥ It is time for Tic Tac Toe ! ♥
Despite its apparent simplicity, Tic-tac-toe requires detailed analysis to determine even some elementary combinatory facts, the most interesting of which are the number of possible games and the number of possible positions. A position is merely a state of the board, while a game usually refers to the way a terminal position is obtained.
A naive count of the number of positions leads to 19,683 possible board layouts, and a similar count of the number of games leads to 362,880 different sequences for placing the Xs and Os on the board. However, this doesn't take into account the fact that the game ends when three-in-a-row is obtained. Many of the 19,683 positions are unreachable in an actual game. The complete analysis is further complicated by the definitions used when setting the conditions, like board symmetries.