# Tic-tac-toe

Tic-tac-toe

Tic-Tac-Toe or three wins (also circle and cross , dodel chess) is a classic, simple two-person strategy game , the history of which goes back to the 12th century BC. Can be traced back.

## Course of the game

On a square 3 × 3 field, the two players take turns placing their mark (one player crosses, the other circle) in a free field. The first player to put three characters in a row, column or diagonal wins. However, if both players play optimally, neither can win and it will be a draw. This means that all nine fields are filled without a player being able to place the required characters in a row, column or diagonal.

## Sample games

Animation of the first example game

First player (X) wins because player two (O) makes a mistake on the first move:

${\ displaystyle {\ begin {array} {c | c | c} \, \, & \, \, & \! \ color {green} \ times \! \\\ hline \, \, & \, \, & \, \, \\\ hline \, \, & \, \, & \, \, \\\ end {array}} \ quad {\ begin {array} {c | c | c} \! \ color {green} \ circ \! & \, \, & \! \ times \! \\\ hline \, \, & \, \, & \, \, \\\ hline \, \, & \, \, & \, \, \\\ end {array}} \ quad {\ begin {array} {c | c | c} \! \ circ \! & \, \, & \! \ times \! \\\ hline \, \, & \, \, & \, \, \\\ hline \! \ color {green} \ times \! & \, \, & \, \, \\\ end {array}} \ quad { \ begin {array} {c | c | c} \! \ circ \! & \, \, & \! \ times \! \\\ hline \, \, & \! \ color {green} \ circ \! & \, \, \\\ hline \! \ times \! & \, \, & \, \, \\\ end {array}} \ quad {\ begin {array} {c | c | c} \! \ circ \! & \, \, & \! \ times \! \\\ hline \, \, & \! \ circ \! & \, \, \\\ hline \! \ times \! & \, \ , & \! \ color {green} \ times \! \\\ end {array}} \ quad {\ begin {array} {c | c | c} \! \ circ \! & \, \, & \! \ times \! \\\ hline \, \, & \! \ circ \! & \! \ color {green} \ circ \! \\\ hline \! \ times \! & \, \, & \! \ times \! \\\ end {array}} \ quad {\ begin {array} {c | c | c} \! \ circ \! & \, \, & \! \ times \! \\\ hline \, \, & \! \ circ \! & \! \ circ \! \\\ hline \! \ times \! & \! \ color {green} \ times \! & \! \ times \! \\\ end { array}}}$

First player (X) wins because player two (O) makes a mistake on the first move:

${\ displaystyle {\ begin {array} {c | c | c} \, \, & \, \, & \, \, \\\ hline \, \, & \! \ color {green} \ times \! & \, \, \\\ hline \, \, & \, \, & \, \, \\\ end {array}} \ quad {\ begin {array} {c | c | c} \, \, & \! \ color {green} \ circ \! & \, \, \\\ hline \, \, & \! \ times \! & \, \, \\\ hline \, \, & \, \, & \, \, \\\ end {array}} \ quad {\ begin {array} {c | c | c} \! \ color {green} \ times \! & \! \ circ \! & \, \ , \\\ hline \, \, & \! \ times \! & \, \, \\\ hline \, \, & \, \, & \, \, \\\ end {array}} \ quad { \ begin {array} {c | c | c} \! \ times \! & \! \ circ \! & \, \, \\\ hline \, \, & \! \ times \! & \, \, \\\ hline \, \, & \, \, & \! \ color {green} \ circ \! \\\ end {array}} \ quad {\ begin {array} {c | c | c} \! \ times \! & \! \ circ \! & \, \, \\\ hline \! \ color {green} \ times \! & \! \ times \! & \, \, \\\ hline \, \ , & \, \, & \! \ circ \! \\\ end {array}} \ quad {\ begin {array} {c | c | c} \! \ times \! & \! \ circ \! & \, \, \\\ hline \! \ times \! & \! \ times \! & \, \, \\\ hline \! \ color {green} \ circ \! & \, \, & \! \ circ \! \\\ end {array}} \ quad {\ begin {array} {c | c | c} \! \ times \! & \! \ circ \! & \, \, \\\ hline \! \ times \! & \! \ times \! & \! \ color {green} \ times \! \\\ hline \! \ circ \! & \, \, & \! \ circ \! \\\ end { array}}}$

First player (X) loses because he makes a mistake on move two:

${\ displaystyle {\ begin {array} {c | c | c} \, \, & \! \ color {green} \ times \! & \, \, \\\ hline \, \, & \, \, & \, \, \\\ hline \, \, & \, \, & \, \, \\\ end {array}} \ quad {\ begin {array} {c | c | c} \, \, & \! \ times \! & \, \, \\\ hline \, \, & \! \ color {green} \ circ \! & \, \, \\\ hline \, \, & \, \, & \, \, \\\ end {array}} \ quad {\ begin {array} {c | c | c} \, \, & \! \ times \! & \, \, \\\ hline \, \, & \! \ circ \! & \, \, \\\ hline \, \, & \! \ color {green} \ times \! & \, \, \\\ end {array}} \ quad { \ begin {array} {c | c | c} \, \, & \! \ times \! & \, \, \\\ hline \, \, & \! \ circ \! & \, \, \\ \ hline \! \ color {green} \ circ \! & \! \ times \! & \, \, \\\ end {array}} \ quad {\ begin {array} {c | c | c} \, \, & \! \ times \! & \! \ color {green} \ times \! \\\ hline \, \, & \! \ circ \! & \, \, \\\ hline \! \ circ \ ! & \! \ times \! & \, \, \\\ end {array}} \ quad {\ begin {array} {c | c | c} \! \ color {green} \ circ \! & \! \ times \! & \! \ times \! \\\ hline \, \, & \! \ circ \! & \, \, \\\ hline \! \ circ \! & \! \ times \! & \ , \, \\\ end {array}} \ quad {\ begin {array} {c | c | c} \! \ circ \! & \! \ times \! & \! \ times \! \\\ hline \, \, & \! \ circ \! & \, \, \\\ hline \! \ circ \! & \! \ times \! & \! \ color {green} \ times \! \\\ end { array}} \ q uad {\ begin {array} {c | c | c} \! \ circ \! & \! \ times \! & \! \ times \! \\\ hline \! \ color {green} \ circ \! & \! \ circ \! & \, \, \\\ hline \! \ circ \! & \! \ times \! & \! \ times \! \\\ end {array}}}$

Neither player wins, as both play flawlessly:

${\ displaystyle {\ begin {array} {c | c | c} \, \, & \! \ color {green} \ times \! & \, \, \\\ hline \, \, & \, \, & \, \, \\\ hline \, \, & \, \, & \, \, \\\ end {array}} \ quad {\ begin {array} {c | c | c} \, \, & \! \ times \! & \, \, \\\ hline \, \, & \! \ color {green} \ circ \! & \, \, \\\ hline \, \, & \, \, & \, \, \\\ end {array}} \ quad {\ begin {array} {c | c | c} \, \, & \! \ times \! & \! \ color {green} \ times \ ! \\\ hline \, \, & \! \ circ \! & \, \, \\\ hline \, \, & \, \, & \, \, \\\ end {array}} \ quad { \ begin {array} {c | c | c} \! \ color {green} \ circ \! & \! \ times \! & \! \ times \! \\\ hline \, \, & \! \ circ \! & \, \, \\\ hline \, \, & \, \, & \, \, \\\ end {array}} \ quad {\ begin {array} {c | c | c} \! \ circ \! & \! \ times \! & \! \ times \! \\\ hline \, \, & \! \ circ \! & \, \, \\\ hline \, \, & \, \ , & \! \ color {green} \ times \! \\\ end {array}} \ quad {\ begin {array} {c | c | c} \! \ circ \! & \! \ times \! & \! \ times \! \\\ hline \, \, & \! \ circ \! & \! \ color {green} \ circ \! \\\ hline \, \, & \, \, & \! \ times \! \\\ end {array}} \ quad {\ begin {array} {c | c | c} \! \ circ \! & \! \ times \! & \! \ times \! \\\ hline \! \ color {green} \ times \! & \! \ circ \! & \! \ circ \! \\\ hline \, \, & \, \, & \! \ times \! \\\ end { array}} \ q uad {\ begin {array} {c | c | c} \! \ circ \! & \! \ times \! & \! \ times \! \\\ hline \! \ times \! & \! \ circ \ ! & \! \ circ \! \\\ hline \! \ color {green} \ circ \! & \, \, & \! \ times \! \\\ end {array}} \ quad {\ begin {array } {c | c | c} \! \ circ \! & \! \ times \! & \! \ times \! \\\ hline \! \ times \! & \! \ circ \! & \! \ circ \! \\\ hline \! \ circ \! & \! \ color {green} \ times \! & \! \ times \! \\\ end {array}}}$

## Strategy and tactics

There are 255,168 different game courses for Tic-Tac-Toe, of which 131,184 end with a win for the first player, 77,904 with a win for the second player and 46,080 with a draw. (With these figures, the first configuration with three Xs or three O's in a row, column or diagonal or a completely filled playing field, but not already the situation from which the outcome is determined, is considered to be the end of the game.)

Many game courses are the same in the sense that they can be transformed into one another by rotating or mirroring the playing field. Summarizing the same courses, the number of different game courses is reduced to one eighth: a total of 31,896, whereby 16,398 are won by the first and 9,738 by the second player and 5,760 are drawn. (From each course of the game you get seven further courses of the game through rotations and reflections, because since at least five fields are always occupied at the end, no course of the game is symmetrical with regard to a rotation or reflection.)

There are 5,478 different game situations, without rotation or mirroring 765. Compared to games like go , checkers or chess , the number of game courses and game situations is negligible. Because of this low level of complexity, it's easy to show that both players can force a tie.

The first player cannot lose on the first move. The second player only holds a tie in 24 of the 72 possibilities for the first two moves.

First player (X) starts, second player (O) holds a tie (mirrored and rotated options are not shown):

${\ displaystyle {\ begin {array} {c | c | c} \! \ times \! & \, \, & \, \, \\\ hline \, \, & \! \ circ \! & \, \, \\\ hline \, \, & \, \, & \, \, \\\ end {array}} \ qquad \ quad {\ begin {array} {c | c | c} \, \, & \, \, & \! \ circ \! \\\ hline \, \, & \! \ times \! & \, \, \\\ hline \, \, & \, \, & \, \, \ \\ end {array}} \ qquad \ quad {\ begin {array} {c | c | c} \, \, & \! \ times \! & \, \, \\\ hline \, \, & \ ! \ circ \! & \, \, \\\ hline \, \, & \, \, & \, \, \\\ end {array}} \ qquad \ quad {\ begin {array} {c | c | c} \, \, & \! \ times \! & \, \, \\\ hline \, \, & \, \, & \, \, \\\ hline \, \, & \! \ circ \! & \, \, \\\ end {array}} \ qquad \ quad {\ begin {array} {c | c | c} \, \, & \! \ times \! & \! \ circ \! \\\ hline \, \, & \, \, & \, \, \\\ hline \, \, & \, \, & \, \, \\\ end {array}}}$

There are 16 tie positions that can be obtained from the following three by mirroring or rotating:

${\ displaystyle {\ begin {array} {c | c | c} \! \ times \! & \! \ times \! & \! \ circ \! \\\ hline \! \ circ \! & \! \ times \! & \! \ times \! \\\ hline \! \ times \! & \! \ circ \! & \! \ circ \! \\\ end {array}} \ qquad \ quad {\ begin { array} {c | c | c} \! \ times \! & \! \ times \! & \! \ circ \! \\\ hline \! \ circ \! & \! \ circ \! & \! \ times \! \\\ hline \! \ times \! & \! \ times \! & \! \ circ \! \\\ end {array}} \ qquad \ quad {\ begin {array} {c | c | c} \! \ times \! & \! \ times \! & \! \ circ \! \\\ hline \! \ circ \! & \! \ circ \! & \! \ times \! \\\ hline \! \ times \! & \! \ circ \! & \! \ times \! \\\ end {array}}}$

Usually the first player (X) places in the middle. The second player must put in the corner to force a draw, otherwise player 1 can easily achieve a victory:

${\ displaystyle {\ begin {array} {c | c | c} \, \, & \! \ circ \! & \, \, \\\ hline \, \, & \! \ times \! & \, \, \\\ hline \, \, & \, \, & \, \, \\\ end {array}} \ qquad \ quad {\ begin {array} {c | c | c} \! \ times \ ! & \! \ circ \! & \, \, \\\ hline \, \, & \! \ times \! & \, \, \\\ hline \, \, & \, \, & \! \ circ \! \\\ end {array}} \ qquad \ quad {\ begin {array} {c | c | c} \! \ times \! & \! \ circ \! & \, \, \\\ hline \! \ circ \! & \! \ times \! & \, \, \\\ hline \! \ times \! & \, \, & \! \ circ \! \\\ end {array}} \ qquad \ quad {\ begin {array} {c | c | c} \! \ times \! & \! \ circ \! & \! {\ boldsymbol {\ times}} \! \\\ hline \! \ circ \ ! & \! {\ boldsymbol {\ times}} \! & \, \, \\\ hline \! {\ boldsymbol {\ times}} \! & \, \, & \! \ circ \! \\\ end {array}}}$

## Further information

In 1960, the British computer scientist and AI researcher Donald Michie developed MENACE (“Machine Educable Noughts And Crosses Engine”), a “computer” based on hundreds of matchboxes that could learn tic-tac-toe. In the boxes, each representing a possible score, the possible moves were stored by different colored beads. Depending on whether a game was lost or won, the corresponding pearls were removed or the same color added. As a result, the system learned successful moves and was invincible after a few hundred games.

Tic-Tac-Toe was also one of the first games to appear on computers (even before Tennis for Two , 1958) ( OXO game on an EDSAC computer, 1952).

Tic-Tac-Toe also plays a decisive role in the film WarGames .

Tic-Tac-Toe ran as a daily game show on RTL in 1992 . Michael Förster was the moderator . Behind each of the fields was a question that could be answered in four seconds; The winner was whoever was the first to capture a row of three fields.

The game was also the basis for the US game show Hollywood Squares , which ran in Germany in the 1990s as XXO - Fritz and Co on Sat.1.

You can play it in the browser on several different levels of difficulty or against a friend.