Tic-Tac-Toe
Tic-Tac-Toe is a classic two-player game played on a 3-by-3 grid where players alternate marking cells with an X or an O, aiming to align three of their marks in a row—horizontally, vertically, or diagonally. Commonly enjoyed by children, the game has a straightforward structure, yet it has limited possibilities, making it relatively easy for the first player to adopt a winning strategy. While traditional Tic-Tac-Toe can become predictable, variations exist that increase complexity and challenge; these include multi-dimensional versions played on cubes or even in four dimensions, where players must navigate more cells to achieve a winning alignment.
Additionally, Tic-Tac-Toe serves as an entry point for concepts in game theory due to its manageable number of positions and plays. Its influence extends to other games, such as Nine-Men's Morris, which incorporates similar mechanics of forming lines. As technology has advanced, digital adaptations of Tic-Tac-Toe have emerged, allowing players to compete against each other or against artificial intelligence, which employs algorithms to optimize gameplay. Overall, Tic-Tac-Toe remains a foundational game that reflects both simplicity and strategic depth, appealing to a wide range of players.
Subject Terms
Tic-Tac-Toe
SUMMARY: Traditional Tic-Tac-Toe has a limited number of possible games, which can lead players to quickly discover an unbeatable strategy as long as they move first.
Tic-tac-toe is a famous game often played by children. It requires a playing board of a 3-by-3 arrangement of square cells, usually quickly drawn by making two vertical lines cross two horizontal lines and imagining an outer border. Two players alternate marking cells with either an X (usually the first player) or an O (the second player). Each attempts to put three of their marks in a straight line, while trying to block the attempts of the other. The winner is the player who first makes the three-in-a-row line. Unfortunately, for the challenge of the game, the first player can always win by putting an X in the center cell and playing carefully. Children often learn this strategy, and the game can become mundane if this strategy is always employed.
![Tic tac toe. A typical game of tic tac toe. By Symode09 (Own work) [Public domain], via Wikimedia Commons 94982076-91629.jpg](https://imageserver.ebscohost.com/img/embimages/ers/sp/embedded/94982076-91629.jpg?ephost1=dGJyMNHX8kSepq84xNvgOLCmsE2epq5Srqa4SK6WxWXS)

Play Possibilities
However, tic-tac-toe is simple enough that it can serve as a fairly easy example of game analysis (or game theory), where all possible positions and plays are determined. Most other games are so complex that such analyses are overwhelmingly complex.
Ignoring symmetric patterns, there are three possible first plays—a corner, a side, or the center. The second play patterns are based on these three openings. Again, ignoring symmetries, the corner opening leads to five possible second moves, the side opening also allows five possible second moves, but following a center opening there are only two possible second plays. Hence, there are a total of twelve noncongruent, nonsymmetrical second plays. Similar exploration of the possibilities shows a total of sixty-six possible third moves, though twenty-six are duplications, so there are only forty noncongruent arrangements after the third play. Then, it becomes much more complicated because of overlaps of first- and third-move Xs and second- and fourth-move Os. This fact demonstrates that even in such a simple game as tic-tac-toe, the full analysis becomes quite complex.
Variations
The 3-by-3 magic square (with numbers 1–9 arranged in the cells so that each row, column, and diagonal sums to 15) looks like a tic-tac-toe board with numbers. A game can be played where players take turns choosing numbers 1–9 (without repeats), trying to reach a sum of 15 with three numbers. Playing this game and placing the numbers onto the 3-by-3 magic square turns out to follow the same general games strategies as tic-tac-toe.
Tic-tac-toe can become a much more interesting—and challenging—game by expanding the board to three dimensions. If the game is played on a stack of three 3-by-3 boards (a cube of 27 cells), any row of three is a win. Some have suggested that a 4-by-4-by-4 cube, with a line of four to win, is a smoother game. Winning lines can lie entirely on a horizontal level, drop vertically from top to bottom, slant along a vertical plane, or go from one corner to the opposite corner along the body diagonal. New players often have difficulty even noticing winning lines! For even more complexity, the game can be played in four dimensions, usually displayed as a two-dimensional array of two-dimensional boards, assuming the boards can be stacked in any of the horizontal, vertical, or diagonal ways, with winning lines in any of the stacks according to the three-dimensional patterns, a variation that can be either 3-by-3-by-3-by-3 or 4-by-4-by-4-by-4.
Alternatively, the traditional board can be imaged to extend infinitely, allowing more possibilities for winning lines. One version keeps the traditional board but assumes the left column wraps to be next to the right column, so a line of three can be the upper center, the right center, and the left bottom corner. Similarly, the top and bottom rows can be considered as wrapping around to be next to each other.
Tic-tac-toe has also evolved as technology and gaming applications have developed. Many applications, or apps, feature simple downloads that allow for two-player games or single-player games versus artificial intelligence (AI) or a computer. The computer uses a minimax algorithm, or a backtracking algorithm, in which the computer uses decision-making predictions in order to make an optimal move.
Nine-Men’s Morris
Many games from around the world take from the concepts of tic-tac-toe, especially the goal of making three (or more) counters in a row. Probably the most famous is called Nine-Men’s Morris in English (also called “mill” or, in French, merelles or morelles); some suggest early versions were even played in ancient Egypt. The board is three concentric squares connected in the middles of the sides, with each junction and corner marked with a dot. Two players each have nine counters, marked to distinguish those of each player. They take turns playing their counters onto the dots of the board, trying to get three in a row, which is called a “mill.” After players use up the nine counters each, play continues by sliding already-played counters along the lines on the board. Anytime a row of three is made by one player, the player is allowed to remove one of the other player’s counters (but they cannot take a counter that is already in a mill). Eventually, one player either has no counters left or cannot move any remaining counters, and the other player wins.
Bibliography
Garg, Sneha, et al. "The Winning Strategy of Tic Tac Toe Game Model by Using Theoretical Computer Science." 2017 International Conference on Computer, Communications and Electronics (Comptelix), 2017, pp. 89-95. IEEE Xplore, doi.org/10.1109/COMPTELIX.2017.8003944. Accessed 5 Oct. 2024.
József, Beck. Combinatorial Games: Tic-Tac-Toe Theory. Cambridge University Press, 2011.
Masters, James. “Nine Mens Morris, Mill—Online Guide.” TradGames, www.tradgames.org.uk/games/Nine-Mens-Morris.htm. Accessed 4 Oct. 2024. Pan, Junan. "Move First, and Become Unbeatable: Strategy Study of Different Tic-Tac-Toe." ArXiv, 2022, arxiv.org/abs/2208.06795. Accessed 5 Oct. 2024.
Swaminathan, B., et al. “Analysis of Minimax Algorithm Using Tic-Tac-Toe.” ResearchGate, 2020, www.researchgate.net/publication/346813363‗Analysis‗of‗Minimax‗Algorithm‗Using‗Tic-Tac-Toe. Accessed 5 Oct. 2024.
Zaslavsky, Claudia. Tic Tac Toe: And Other Three-In-A Row Games From Ancient Egypt to the Modern Computer. Toronto: Crowell, 1982.