Question: I don't know if somethingwrong but I cannot print out the TicTacToe table as expected. I'm using Java. Thanks package tictactoe: 9import java . util
I don't know if somethingwrong but I cannot print out the TicTacToe table as expected. I'm using Java. Thanks




package tictactoe: 9import java . util . Scanner; 10 11public class TicTacToe 12 13 14 15 16 17 18 19 20 21 public static int row, col; public static Scanner scan = new scanner (Systen.in); public static char [][] board= new char [3] [3]; public static char playerTurn 'X'; public static void Play) boolean playing = true ; System.out.println(" Player X's turn to play! "); while (playing) 23 24 25 26 27 28 29 30 31 32 System.out.println ("nEnter row and column") row-scan.nextInt ) col-scan. next Int ( ) ; board[row] [col]- playerTurn; if (GameOver(row, col)) playing false; System.out.println("Game over! player "+playerTurn + " wins!" PrintBoard) if (playerTurn == 'X') 34 35 36 playerTurn = 'O' ; playerTurn = 'X' ; System.out.println(" Player X's turn to play! "); else 38 if (playerTurn == 'X') 39 else '0') if System.out.println(" Player o's turn to play "): (playerTurn=- public static void PrintBoard ) 47 for (int i = 0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
