Generation

generate functionSat, 04 Feb 2023

tic tac toe game with user playing

public class TicTacToe { public static void main(String[] args) { String[][] board = new String[3][3]; drawBoard(board); System.out.println("First Player is X"); System.out.println("Second Player is O"); for (int i = 0; i < 9; i++) { if (i % 2 == 0) { System.out.println("Player 1, Enter row and column"); int row = in.nextInt(); int col = in.nextInt(); board[row][col] = "X"; drawBoard(board); if (isGameOver(board)) { System.out.println("Player 1 WINS"); break; } } else { System.out.println("Player 2, Enter row and column"); int row = in.nextInt(); int col = in.nextInt(); board[row][col] = "O"; drawBoard(board); if (isGameOver

Want to kickstart your project?Use the new AI Studio to create your code