You probably already know how to play TicTacToe
. It's a really simple game for two players!
Its does'nt really matter who goes first, whether X
or O
TicTacToe
involves thinking ahead and trying to figure out what the person playing against you might do next.
If you always pay attention and think ahead, you'll never lose a game of TicTacToe. You may not win, but at least you'll tie.
-
The game is played on a grid that's 3 squares by 3 squares.
-
You are
X
, your friend (or the computer in this case) isO
. Players take turns putting their marks in empty squares. -
The first player to get 3 marks in a row (up, down, across, or diagonally) is the winner.
-
When all 9 squares are full, the game is over. If no player has 3 marks in a row, the game ends in a tie.
A combinatorics
study of the game shows that when "X" makes the first move every time, the game outcomes are as follows:
- 91 distinct positions are won by (X)
- 44 distinct positions are won by (O)
- 3 distinct positions are drawn (often called a "cat's game"[15])
- Fork the the project
- Create your feature branch
- Make required changes and commit
- Push to the branch
- Create new Pull Request
- You can open an issue for support or suggestions