Tic Tac Toe game Solution.ZIP

Tic Tac Toe game Solution

Make a Tic Tac Toe game. In this game, two players alternate placing Xs and O into a gred until on play as three matching symbols in a row horizontally, vertically or diagonally. Make a game in which the user is presented with a three by three grid containing the digits through 9. When the user chooses a position by typing a number place an X in the appropriate spot. Generate a random number for the position where the computer will place an O. Do no allow the player or computer to place a symbol where one has already been placed. When either the player or computer has three symbols in a row, declare a winner; if all position has been exhausted and no has three symbols in a row declare a tie.

part b. In the Tic Tac Toe application, the computer’s selection is chosen randomly, improve the Tic Tac Toe game so that when the computer has two Os in any row, colum or diagonal it selects the winning position for the next move rather than selecting a position randomly Save this as TicTacToe 2

Please if you could create it to there are gui interface.

it display a grid with numbers 1 through 9 for each square and when the user press a number it fill in the square.

Criteria

For a properly formatted program (HINT: You can select “Source - Format”) from the IDE menu to get the formatting corect)

Using a 3×3 array (Your program should have a two dimensional array to represent the 3×3 tic tac toe board)

Correctly funtioning program

Program must detect when the game is over: either some one wins or there are no board positions left)

For correctly displaying the board after each turn

For ensuring that illegal moves cannot be made by the user or by the computer

NOTE: This assignment does not require you to have the computer intelligently selecting the next square. The computer is just randomly selecting a square.
Powered by