Question: 8.2.8 Tic Tac Toe Methods Please complete the code in Java public class TicTacToeTester { public static void main(String[] args) { //This is to help
8.2.8 Tic Tac Toe Methods
Please complete the code in Java

![class TicTacToeTester { public static void main(String[] args) { //This is to](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3c554571ce_79566f3c55389e91.jpg)
public class TicTacToeTester { public static void main(String[] args) { //This is to help you test your methods. Feel free to add code at the end to check //to see if your checkWin method works! TicTacToe game = new TicTacToe(); System.out.println("Initial Game Board:"); game.printBoard(); //Prints the first row of turns taken for(int row = 0; row
public class TicTacToe { //copy over your constructor from the Tic Tac Toe Board activity in the previous lesson! private int turn; //this method returns the current turn public int getTurn() { } /*This method prints out the board array on to the console */ public void printBoard() { } //This method returns true if space row, col is a valid space public boolean pickLocation(int row, int col) { } //This method places an X or O at location row,col based on the int turn public void takeTurn(int row, int col) { } //This method returns a boolean that returns true if a row has three X or O's in a row public boolean checkRow() { } //This method returns a boolean that returns true if a col has three X or O's public boolean checkCol() { } //This method returns a boolean that returns true if either diagonal has three X or O's public boolean checkDiag() { } //This method returns a boolean that checks if someone has won the game public boolean checkWin() { }
}
Status: Not Submitted 8.2.8: Tic Tac Toe Methods Save Submit + Continue RUN CODE | TEST CASES ASSIGNMENT DOCS | GRADE | MORE 7 points Status: Not Submitted FILES For this exercise, you will complete the Tictactoe Board that we started in the 2D Arrays Lesson. We will add a couple of methods to the Tictactoe class. TicTacToeTester.java TicTacToe.java To track whose turn it is, we will use a counter turn. This is already declared as a private instance variable. Create a getTurn method that returns the value of turn. Other methods to implement: 1 public class TicTacToeTester 2-{ 3 public static void main(String[] args) 4- { 5 //This is to help you test your methods. Feel free to add code at the end to check 6 //to see if your checkWin method works! 7 TicTacToe game = new TicTacToe(); 8 System.out.println("Initial Game Board:"); 9 game.printBoard(); 10 11 //Prints the first row of turns taken 12 for(int row = 0; row
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
