Question: Create a program named Tictactoe.java then implements the followimg methods: Part 1 public static void print(String board) it takes a string (1D) representing a TicTacToe(TTT)

 Create a program named Tictactoe.java then implements the followimg methods: Part

Create a program named Tictactoe.java then implements the followimg methods: Part 1

public static void print(String board) it takes a string (1D) representing a TicTacToe(TTT) board and display 2D representation of the board.

for example, ...xo.x.. then display the board as follows : . . . X 0 . X . .

Part 2(10 points):

Create a program named TicTacToe.java then implements the following methods: public static void print(String board) It takes a string (1D) representing a TicTacToe (TTT) board and display 2D representation of the board. for example, ...xo.x.. then display the board as follows: . . . X O . X . . Part 2 public static String winner(String board) It takes 1D and determines if there is a winner then return the winner symbol, if tie, return null Part 3 public static int[] possibleMove(String board) It returns all possible moves that the player can take. Use the following index for each location: 0, 1, 2 3, 4, 5 6, 7, 8 Part 4 public static String move(String board) This method uses possibleMove(board) then randomly move to one of the possible moves, the return the updated board. Part 5: Complete the main method to play the game until there is winner or tie. 

Max Points 30

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!