import java.util.Scanner; public class TicTacToe { static Scanner scan = new Scanner(System.in); public static void main(String[] args) { System.out.println("\nLet's play tic tac toe"); //Task 1: Create an array with three rows of '_' characters. //Task 2: Call the function printBoard(); /* { Task 3: Loop through turns. if (X) turn { Task 4: call askUser(). Task 5: populate the board using askUser's return value. } else { Task 4: call askUser(). Task 5: populate the board using askUser's return value. Then, print it. } Task 6 - Call the function. if return value == 3 { print: X wins and break the loop } else if return value == -3 { print: O wins and break the loop } } */ scan.close(); } /** Task 2 - Write a function that prints the board. * Function name - printBoard() * @param board (char[][]) * * Inside the function: * 1. print a new line. * 2. print the board. * • separate each row by two lines. * • each row precedes a tab of space * • each character in the grid has one space from the other character */ /** Task 4 - Write a function that lets the user choose a spot * Function name – askUser * @param board (char[][] board) * @return spot (int[]) * * Inside the function * 1. Asks the user: - pick a row and column number: * 2. Check if the spot is taken. If so, let the user choose again. * 3. Return the row and column in an int[] array. * */ /** Task 6 - Write a function that determines the winner * Function name - checkWin * @param board (char[][]) * @return count (int) * * Inside the function: * 1. Make a count variable that starts at 0. * 2. Check every row for a straight X or straight O (Task 7). * 3. Check every column for a straight X or straight O (Task 8). * 4. Check the left diagonal for a straight X or straight O (Task 9). * 5. Check the right diagonal for a straight X or straight O (Task 10). */ }