Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Tic Tac Toe

grid[][]
row/col 0 1 2
frame
0 0 [0][0] 1 [0][1] 2 [0][2]
0
frame
1 3 [1][0] 4 [1][1] 5 [1][2]
1
frame
2 6 [2][0] 7 [2][1] 8 [2][2]
2

button references from 0-8 = row*3+col


convert 2-D indexes to 1-D index

https://en.wikipedia.org/wiki/Tic-tac-toe

Tic-tac-toe (American English), noughts and crosses (Commonwealth English), or Xs and Os (Canadian or
Irish English) is a paper-and-pencil game for two players who take turns marking the spaces in a three-by-
three grid with X or O. The player who succeeds in placing three of their marks in a horizontal, vertical, or
diagonal row is the winner. It is a solved game, with a forced draw assuming best play from both players.

Tic-tac-toe is played on a three-by-three grid by two players, who alternately place the marks X and O in
one of the nine spaces in the grid.

Players soon discover that the best play from both parties leads to a draw. Hence, tic-tac-toe is often played
by young children who may not have discovered the optimal strategy.

win lose draw tie


Both "tie" and "draw" are universally understood and are mostly interchangeable when speaking about a
final score.
A team, say X, can win or lose. Then we say X won or X lost.
Sometimes it happens that both teams end up even, i.e. in a draw or tie.
During a game you may speak of two teams or players "tied", but only "drawn" once the game has ended.
"It was a draw/tie."
"They drew/tied."
"The teams have drawn".
"In the event of a draw..."

https://www.rd.com/article/how-to-win-tic-tac-toe/#:~:text=When%20you're%20the%20first,win%2C
%20but%20it%20can%20happen.

How to Win Tic-Tac-Toe: The Strategies You Need to Master

Tic tac toe is a classic game. It can be played virtually anywhere and on anything, from a bar napkin to a
computer screen to a chic wooden set.

However, while the game may appear simple, that is deceptive. How to win tic tac toe requires strategic
thinking and planning to win the game or force a draw. To do this, however, there are certain strategies you
need to master. Another deceptive game?

How to win tic tac toe when you go first


When you’re the first one up, there is a simple strategy on how to win tic tac toe: put your ‘X’ in any corner.
This move will pretty much send you to the winner’s circle every time, so long as your opponent doesn’t
put their first ‘O’ in the center box. This can make it harder to win, but it can happen.

How to win tic tac toe when you go second


If you’re the second to go, it may be harder to win the game. If your opponent takes the center space,
counteract that by placing your letter in a corner. If your opponent takes a corner space, take the middle
space. This will force a draw in both cases. Winning is almost impossible unless a major mistake is made by
your opponent.

But, if your opponent starts on an edge that is not a corner, you can win. There is an exact science on how
to win tic tac toe if this is the case: Put your first letter in the center. You can only claim victory if your
opponent puts their letter on the other edge. If not, you will have to settle for a draw.

How to win tic tac toe every time


It’s actually difficult to win at tic tac toe every time. While the board is small, there are many variables that
depend on the opponent’s placement. Playing the more advanced game of Scrabble? These 30 words can
help you win every time.
Does it matter if you’re “X” or “O”?
Whether you’re first up or the second one to go, how to win tic tac toe doesn’t depend on your sequence.
So, no, it doesn’t matter if you’re the “X” or the “O,” but it does matter where you play your letters.

What if the center is taken?


There is still a possibility of winning the game if the center box has been taken. One way is to simply wait
for your opponent to make a mistake and capitalize on that. However, if possible, occupy two opposing
corners. This can allow you to win if your opponent places their letter in another corner.

Symmetry is your friend


If you’re not sure what the next move is, experts point out that symmetry is always the best bet, so when
contemplating a move, look for the one that will make the board as symmetrical as possible. Not only will it
make your board look nice, but it will also block your opponent from being able to run away with a victory.

Is a tie as good as a win?


While a straight-up win may feel more satisfying, being able to force a draw requires skill and strategy. If
your opponent takes the middle square with an “X” or “O, ” the next move to ensure a tie is to place your
letter in any of the corners. This way, there is no move that will allow them to win.

You might also like