Tic-tac-toe: a classic game if there ever was one

Tic-tac-toe, also known as three in a row and tatetí in Spanish, is a very popular and fun game that can be played with pencil and paper, or with any other material that allows making marks, digital boards included. The game consists of making a 3×3 grid of squares and two players, one will be using the symbol Ο and another the symbol Χ, taking turns placing their marks, trying to form a line of three of their symbols, either horizontal, vertical, or diagonal. The player who achieves it first wins the game. If all the squares are filled without anyone making a line of three, the game ends in a tie.

Tic-tac-toe is a very simple game, but also very interesting from a mathematical and logical point of view. It has been shown that if both players play optimally, the game will always end in a tie, regardless of the first player’s move. That is why it is a good game to practice strategy, tactics, and observation. In addition, there are many variants of tic-tac-toe, such as three-in-a-row 3x3x3, which is played on a three-dimensional board of 27 squares, or the m,n,k game, which is played on a board of m x n squares and the objective is to make a line of k squares.

Tic-tac-toe board. Game over!
Tic-tac-toe board. Game over!

The very simplicity of the game makes it ideal as a pedagogical tool to teach the concepts of game theory and the branch of artificial intelligence that deals with the search for game trees.

“Do you dare to play a Tic-tac-toe game?”

Special characters: Ο, Χ