package project;

import java.util.Scanner;

public class TicTacToe
{
    static char winner;
    static char currentPlayer;
    static Board board = new Board();

    public static void main( String[] args )
    {
        char human1 = 'X';
        char human2 = 'O';
        char winner = '-';

        Scanner userInput = new Scanner(System.in);

        currentPlayer = 'X';

        while((winner == '-') && !board.isFull()) {

            int row = Integer.parseInt(userInput.next());
            int column = Integer.parseInt(userInput.next());

            if(board.isEmpty(row, column)){
                board.set(currentPlayer, row, column);
                board.display();
                if(board.hasWinner()){
                    winner = currentPlayer;
                } else {
                    currentPlayer = nextPlayer();
                }

             } else {
                System.out.println("Invalid input");
            }
        }
        if(winner != '-') {
            System.out.println("Winner is:" + winner);
        } else {
            System.out.println("It's a draw.");
        }
    }

    static char nextPlayer() {
        return currentPlayer == 'O' ? 'X' : 'O';
    }
}

@@ -63,26 +63,28 @@
 acToe%0A%7B%0A
+%0A
     
-static
+private
  char wi
@@ -89,30 +89,31 @@
 winner;%0A    
-static
+private
  char curren
@@ -125,22 +125,23 @@
 er;%0A    
-static
+private
  Board b
@@ -176,48 +176,24 @@
 lic 
-static void main( String%5B%5D args )%0A   
+void start()
  %7B%0A
+%0A
     
@@ -839,33 +839,32 @@
  %7D%0A%0A            
- 
 %7D else %7B%0A       
@@ -1095,23 +1095,145 @@
   %7D%0A
+%0A
     %7D%0A%0A
+%0A
     
-stat
+public static void main( String%5B%5D args )%0A    %7B%0A        TicTacToe ttt = new TicTacToe();%0A        ttt.start();%0A    %7D%0A%0A    publ
 ic c

remove static