TIC – TAC – TOE
Tic-tac-toe (or Noughts and crosses, Xs and Os) is a paper-and-pencil game for two players, X and O, who take turns marking the spaces in a 3×3 grid. The player who succeeds in placing three respective marks in a horizontal, vertical, or diagonal row wins the game.
Tic-tac-toe is a computer game in which a human player and the computer make alternative moves on a 3×3 square. A move consists of marking previously unmarked square. The player who first places three consecutive marks along a straight line on the square (i.e. along a row, column, or diagonal) wins the game.
As soon as either of the human player or the computer wins, a message congratulating the winner should be displayed. If neither player manages to get three consecutive marks along a straight line,and all the squares on the board are filled up, then the game is drawn. The computer always tries to win a game.
Players soon discover that best play from both parties leads to a draw (often referred to as cat or cat's game). Hence, Tic-tac-toe is most often played by young children.
Because of the simplicity of Tic-tac-toe, it is often used as a pedagogical tool for teaching the concepts of good sportsmanship and the branch of artificial intelligence that deals with the searching of game trees. It is straightforward to write a computer program to play Tic-tac-toe perfectly, to enumerate the 765 essentially different positions (the state space complexity), ace.
The game can be generalized to an m,n,k-game in which two players alternate placinor the 26,830 possible games up to rotations and reflections (the game tree complexity) on this spg stones of their own color on an m×n board, with the goal of getting k of their own color in a row. Tic-tac-toe is the (3,3,3)-game.
Combinatorics
The first two plies of the game tree for Tic-tac-toe. Once rotations and reflections are eliminated, there are only three opening moves – a corner, a side or the middle.
Despite its apparent simplicity, Tic-tac-toe requires detailed analysis to determine even some elementary combinatory facts, the most interesting of which are the number of possible games and the number of possible positions. A position is merely a state of the board, while a game usually refers to the way a terminal position is obtained.
Naive counting leads to 19,683 possible board layouts (39 since each of the nine spaces can be X, O or blank), and 362,880 (i.e. 9!) possible games (different sequences for placing the Xs and Os on the board). However, two matters much reduce these numbers:
The game ends when three-in-a-row is obtained.
The number of Xs is always either equal to or exactly 1 more than the number of Os (if X starts).
The complete analysis is further complicated by the definitions used when setting the conditions, like board symmetries.
Number of terminal positions
When considering only the state of the board, and after taking into account board symmetries (i.e. rotations and reflections), there are only 138 terminal board positions. Assuming that X makes the first move every time:
91 unique positions are won by (X)
44 unique positions are won by (O)
3 unique positions are drawn
Strategy
A player can play a perfect game of Tic-tac-toe (to win or, at best, draw) if they choose the first available move from the following list, each turn, as used in Newell and Simon's 1972 tic-tac-toe program.
1. Win: If the player has two in a row, they can place a third to get three in a row.
2. Block: If the opponent has two in a row, the player must play the third themselves to block the opponent.
3. Fork: Create an opportunity where the player has two threats to win (two non-blocked lines of 2).
4. Blocking an opponent's fork:
Option 1: The player should create two in a row to force the opponent into defending, as long as it doesn't result in them creating a fork. For example, if "X" has a corner, "O" has the center, and "X" has the opposite corner as well, "O" must not play a corner in order to win. (Playing a corner in this scenario creates a fork for "X" to win.)
Option 2: If there is a configuration where the opponent can fork, the player should block that fork.
5. Center: A player marks the center. (If it is the first move of the game, playing on a corner gives "O" more opportunities to make a mistake and may therefore be the better choice; however, it makes no difference between perfect players.)
6. Opposite corner: If the opponent is in the corner, the player plays the opposite corner.
7. Empty corner: The player plays in a corner square.
8. Empty side: The player plays in a middle square on any of the 4 sides.
The first player, who shall be designated "X", has 3 possible positions to mark during the first turn. Superficially, it might seem that there are 9 possible positions, corresponding to the 9 squares in the grid. However, by rotating the board, we will find that in the first turn, every corner mark is strategically equivalent to every other corner mark. The same is true of every edge mark. For strategy purposes, there are therefore only three possible first marks: corner, edge, or center. Player X can win or force a draw from any of these starting marks; however, playing the corner gives the opponent the smallest choice of squares which must be played to avoid losing.[6]
The second player, who shall be designated "O", must respond to X's opening mark in such a way as to avoid the forced win. Player O must always respond to a corner opening with a center mark, and to a center opening with a corner mark. An edge opening must be answered either with a center mark, a corner mark next to the X, or an edge mark opposite the X. Any other responses will allow X to force the win. Once the opening is completed, O's task is to follow the above list of priorities in order to force the draw, or else to gain a win if X makes a weak play.
To guarantee a draw for O, however:
If X does not play center opening move (playing a corner is the best opening move), take center, and then a side middle. This will stop any forks from happening. If O plays a corner, a perfect X player has already played the corner opposite their first and proceeds to play a 3rd corner, stopping O's 3-in-a-row and making their own fork.
1. If X plays center opening move, O should pay attention and not allow a fork. X should play a corner first.
2. If O takes center (best move for them), X should take the corner opposite the original, and proceed as detailed above.
3. If O plays a corner or side-middle first, X is guaranteed to win:
If corner, X simply takes any of the other 2 corners, and then the last, a fork.
If O plays a side-middle, X takes the only corner that O's blocking won't make 2 in a row. O will block, but the best of the other two will be seen by X, and O is forked. The only way that X must lose is if O plays middle and then a side-middle.
Screen Shots
Observation: Tic Tac Toe (or Noughts and crosses, Xs and Os) is one of the mini games around the world that requires a player or players to have their own strategy. For our own observation, this game is not totally hard because all you need to do is to think all the possible turn to create a three consecutive marks along a straight line on the square (i.e. along a row, column, or diagonal) wins the game. But before you win the game you must be the first to create a three consecutive marks before the computer create it. This is also one of the games that have its own simplicity. But besides on its simplicity it requires also analysis on how you make your own turn to make the computer think on how to block it or how to win the game. But as I said earlier, this game is not totally hard although the computer always wants to win the game , you only need to think, analyze, create strategy, think all possible turn and most especially, you must enjoy on playing this game!
You May Also Find These Documents Helpful
-
b. Does the result of your answer change if the game is played an infinite number of times? Why or why not. Properly use game theoretic terminology in your answer.…
- 298 Words
- 2 Pages
Satisfactory Essays -
Every program is made up of sets of algorithms. These are the individual chunks of code which each carry out a process. When the algorithms are combined the whole game is formed. A common algorithm in games creation is a game loop. This is code which controls the actions that are carried out when there is no input from the user. Ordinary programs like a word processor will not do anything when there is no user input; they will just wait for the next command, but a game must keep running constantly, therefore a game loop runs constantly in the background of a game and is established when there is a pause in the input. This could just be to keep the environment active, such as a waterfall that keeps flowing; some involve the character making a reminder movement to the user.…
- 529 Words
- 3 Pages
Good Essays -
5. You can be creative. The game does not have to be exactly like the wireframes, but it does have to be obvious that the game is Tic Tac Toe.…
- 293 Words
- 2 Pages
Satisfactory Essays -
The first person to make it all the way around the board wins. You need the exact number to finish.…
- 119 Words
- 1 Page
Satisfactory Essays -
Two men play 7 games of checkers each win the same amount of games but there is no ties?…
- 316 Words
- 2 Pages
Satisfactory Essays -
Choose a game (something other than Monopoly!) that has been around for at least 25 years and research its history to answer the following in COMPLETE SENTENCES:…
- 404 Words
- 2 Pages
Satisfactory Essays -
After the betting is completed, one card is placed face down this is called the burn card, three cards are then dealt face up in the center of the table, which is called the board. The first three cards in Texas Holdem are called the flop. These cards “community cards” meaning everyone can (and will) use them in combination with their own hole cards to make the best hand.…
- 393 Words
- 2 Pages
Good Essays -
Solution. So while playing the game my partner had won every game. I could see she had a great strategy and we had took turns like if she went first then I would go first the next round. Then I saw that if we played 10 marks I had crossed out 2 she would cross out 3 then 5 were left over so I couldn’t cross out 4 or 5 only 1,2 or 3 . So I cross out 2 and she would cross out the rest. But when we played 15 I could see that if there were 5 left and I have crossed out 1 she could cross out the other 4.…
- 336 Words
- 2 Pages
Satisfactory Essays -
Scatter wins are multiplied by the total bet staked and are added to pay line wins…
- 512 Words
- 3 Pages
Satisfactory Essays -
Take turns rolling the dice, moving around the board, and answering questions. More than 1 person can be on a circle.…
- 150 Words
- 1 Page
Satisfactory Essays -
Another one of Dr. Turing professional developments was the Turing test. He used the game of chess to show that a computer could be viewed as an artificial brain. He began his work in a time when computing machines were not capable of performing complex calculations and people that worked on computing machines were called computers. The beginning of his Turing test were on paper and he would play chess using a printed version of his code. Dr. Turing’s program–Turbochamp–was capable of playing a human in chess, but not winning. Dr. Turing died before he could see his programming completed on a…
- 471 Words
- 2 Pages
Good Essays -
In this POW, we had to play a game called Linear Nim. In this game, we drew 10 lines on a paper, and we had to take turns crossing out 1, 2, or 3 of the marks. The person that crossed out the last mark was the winner. The first task of this POW was to find a winning strategy for this game. After we found this out, we were supposed to make variations to the game, for instance starting with more or less marks, or allowing a player to cross out more or less marks. We were supposed to consider a variety of examples and look for generalizations in strategies.…
- 937 Words
- 4 Pages
Good Essays -
The second most popular type of game is the real-time strategy. There are hundreds of games that fit in this category, but only a small handful that fit the overall criteria. For some there is only one, Rome: Total War. It is the epitome of a game that provides knowledge, that is demanding, and allows for a withdrawal from the real world. It takes gamers to a whole different level of…
- 642 Words
- 3 Pages
Satisfactory Essays -
This game is a fun game that was really popular in the Victorian era and is still very popular today. All you need is paper a pen/pencil and at least four people. You take your paper and write any moves sports or object you can act out (every one in the group must know about that subject). Put them all your cards together and randomly selected one. After you have done that put the players into two teams. The team that go`s first must try to act out what they have on there card. If the other team gets it, it is there tern. If not the next player on the same team skill. Charades, process continues until a certain point goal is reached. The first person to reach the goal wins. Charades is a fun group game that can definitely cure 2009, http://www.victorianschool.co.UK/parlour%20games.html,…
- 1058 Words
- 5 Pages
Good Essays -
To play the game you need a regular 6-sided die. Each turn of the game consists of one or more rolls of the die. You keep rolling until you get a 1 or decide to stop. You may choose to stop rolling at any time. If you stop rolling before you get a 1 your score for that turn, your score is the sum of all of the numbers you rolled that turn (e.g. if you roll a 4, 6, 3, and 2 your score is 15 pts.). But, if you roll a 1 in that turn your turn is over and you receive 0 pts. for that turn. The central problem in the unit is finding strategies for several different probability games.…
- 642 Words
- 3 Pages
Satisfactory Essays