src/gui/GUI.java
public static void makeMove(int col) {
        board.setOverflow(false);

        int previousRow = board.getLastMove().getRow();
        int previousCol = board.getLastMove().getColumn();
        int previousLetter = board.getLastPlayer();

        if (board.getLastPlayer() == Constants.P2) {
            board.makeMove(col, Constants.P1);
        } else {
            board.makeMove(col, Constants.P2);
        }

        if (board.isOverflow()) {
            board.getLastMove().setRow(previousRow);
            board.getLastMove().setColumn(previousCol);
            board.setLastPlayer(previousLetter);

            undoBoards.pop();
        }

    }
// It finds which player plays next and makes a move on the board.
It finds which player plays next and makes a move on the board.
It finds which player plays next and makes a move on the board .
public static void makeMove(int col) {
        board.setOverflow(false);
        int previousRow = board.getLastMove().getRow();
        int previousCol = board.getLastMove().getColumn();
        int previousLetter = board.getLastPlayer();
        if (board.getLastPlayer() == Constants.P2) {
            board.makeMove(col, Constants.P1);
        } else {
            board.makeMove(col, Constants.P2);
        }
        if (board.isOverflow()) {
            board.getLastMove().setRow(previousRow);
            board.getLastMove().setColumn(previousCol);
            board.setLastPlayer(previousLetter);
            undoBoards.pop();
        }
    }
public static void makeMove ( int col ) { board . setOverflow ( false ) ; int previousRow = board . getLastMove ( ) . getRow ( ) ; int previousCol = board . getLastMove ( ) . getColumn ( ) ; int previousLetter = board . getLastPlayer ( ) ; if ( board . getLastPlayer ( ) == Constants . P2 ) { board . makeMove ( col , Constants . P1 ) ; } else { board . makeMove ( col , Constants . P2 ) ; } if ( board . isOverflow ( ) ) { board . getLastMove ( ) . setRow ( previousRow ) ; board . getLastMove ( ) . setColumn ( previousCol ) ; board . setLastPlayer ( previousLetter ) ; undoBoards . pop ( ) ; } }
It finds which player plays next and makes a move on the board.
It finds which player plays next and makes a move on the board .