public void play() throws IOException {
        boolean turn = true;
        do {
            visualizeBoard();
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            String input = br.readLine();
            if(input.equals("q")){
                System.out.println("The game is over");
                return;
            }
            if(!checkInput(input)) {
                System.out.println("Invalid input. Insert new coordinates");
                continue;
            }
            
            int x = Integer.parseInt(input.split(" ")[0]);
            int y = Integer.parseInt(input.split(" ")[1]);
            
            try {
                markUnit(x, y, checkTurn(turn));
            } catch (IncorrectMarkingException e) {
                System.out.println("This unit is already marked! Insert new coordinates!");
                continue;
            } catch (OutOfBoardException e) {
                System.out.println("The coordinates are out of the board! Insert new coordinates!");
                continue;
            }
            
            turn = changeTurn(turn);
        } while (!isFinished());
        
        if (winner.equals("")) {
            if (board[last[0]][last[1]].getMark() == 'O') {
                winner = "The winner is Player 1";
            } else {
                winner = "The winner is Player 2";
            }
        }
        System.out.println(winner);
    }