Tic-tac-toe (also known as X-O game) is a paper-and-pencil game for two players, X and O, who take turns marking the spaces in a 3×3 grid, 4×4 grid or 5×5 grid. The player who succeeds in placing three, four or five of their marks in a horizontal, vertical, or diagonal row wins the game.