# Tic Tac Toe

**Tic-tac-toe** is a $2$-player combinatorial game, where the players $X$ and $O$ take turns filling a $3 \times 3$ grid. Whoever places three respective marks in a vertical, horizontal, or diagonal manner will be the winner of the game. A draw is obtained whenever nobody wins.

Like chess, a player needs good observation, tactics, and strategy to win a game of tic tac toe, which this wiki page will emphasize on.

## Gameplay

Two players play. They have a symbol assigned to them; traditionally one gets X and the other gets O. One player starts, traditionally the X player. Each player, in turn, places their symbol on an empty square on a $3 \times 3$ grid, trying to be the first one that creates a line of three of their symbols (either horizontal, vertical, or diagonal). The first one to do so wins; in case the grid is filled without any result, it is a draw.

## Strategy

On playing tic-tac-toe, tactics and strategy are a must in order to win.

The simplest tactic is to complete a three-in-a-row: if you have two of your symbols lined up in a row (either horizontal, vertical, or diagonal) and the remaining square is empty, play on it, giving you the win. If you have two of your symbols lined up, and the last square is empty, this is called a **threat**.

The above tactic gives rise to **blocking**: if the opponent has two of their symbols lined up and the remaining square is empty, you must block it by playing on the last remaining square.

Given the blocking tactic, it's pretty natural to consider creating two different threats so that the opponent cannot block both at the same time. This is called a **fork** (as it has two (or more) directions, like a dining fork splitting from one handle to several tines; also compare with fork in chess, which is to make a threat in multiple directions).

Okay! Now it's time to play the game:

Assume that you are playing a tic-tac-toe game with an opponent. You play as $X$ while your opponent plays as $O$.

The game is played as follows:

Find all the possible grid tiles where you can put an $X$-mark that will help you guarantee a win under best play.

A player can prevent the opponent from making a fork if he

- places his mark on a grid tile where a fork can be made, or
- forces the opponent by blocking his threat instead of making a fork, or
- places at the center if vacant, which blocks most of the forks.

You are playing a game of tic-tac-toe. You play as $O$ while your opponent plays as $X$. The game plays as shown:

Where should you put your next $O$ in order to save yourself from losing?

Let's play one more time:

$\color{#D61F06} X$ or $\color{#3D99F6}O$. We do not know who started first.

Two amateur people are playing a game of tic-tac-toe. Each person places his/her mark, eitherAfter the first player has placed his/her second mark, the players will always place his or her mark in a line that already contains

**(a)** two of his/her own marks,

**(b)** two of his/her opponent's marks,

**(c)** giving priority to (a) over (b).

Only the last mark to be placed in the game shown in the figure has not been given. Who will win the game, $\color{#D61F06} X$ or ${\color{#3D99F6}O}?$