I need to write a program that does the following...
The TicTacToe class contains a 3x3 two-dimensional array of integers. The constructor should initialize the empty board to all zeros. It should have a method playerMove that accepts two integers as parameters, the first is the player (1 or 2) and the second is the actual move (1-9). If it is a valid move it changes the value of that square to 1 or 2 (depending on whose turn it is and returns the Boolean value true to indicate a valid move has been completed). If it is not a valid move the board does not change and it returns a Boolean value of false to indicate an invalid move. TicTacToe should also have the method displayBoard that will display the current state of the board. The last method should be determineWinner which returns a 1 if player one won, a 2 if player 2 won, a 0 if it?s a ?cat?s game?, and -1 if there is no winner yet and the game is not over. TicTacToeGame is another program that uses a TicTacToe object to actually play a two human player game of Tic-Tac-Toe. Using the NetBeans design tool also create a sequence diagram for this game.
Any help would be greatly appreciated!!!
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.