Board.java
/*
     * Description: a helper function that has a base case for if the input cell is
     * a mine. If the cell that depends on the input location (i and j) is empty 
     * (number is 0) and it is covered, number of covered cells left is reduced by 
     * 1 before that cell is uncovered, and then the function recurses on each of 
     * the surrounding 8 locations to continue opening empty cells. When recursion 
     * reaches cells with numbers that aren't 0, the cell is uncovered, number of 
     * covered cells left is reduced, and the function returns (base case).
     * Input: a Cell[][] cells, which is a field of the Board object being used, and
     * int i and j, the indices/coordinates of a specific cell in the Board's
     * Cell[][].
     * Output: N/A, no explicit outputs, only changes states of some cells in the
     * Board's Cell[][].
     */
a helper function that has a base case for if the input cell is
a mine. If the cell that depends on the input location (i and j) is empty
(number is 0) and it is covered, number of covered cells left is reduced by
1 before that cell is uncovered, and then the function recurses on each of
the surrounding 8 locations to continue opening empty cells. When recursion
reaches cells with numbers that aren't 0, the cell is uncovered, number of
covered cells left is reduced, and the function returns (base case).
Input: a Cell[][] cells, which is a field of the Board object being used, and
int i and j, the indices/coordinates of a specific cell in the Board's
Cell[][].
Output: N/A, no explicit outputs, only changes states of some cells in the
Board's Cell[][].
a helper function that has a base case for if the input cell is a mine . If the cell that depends on the input location ( i and j ) is empty ( number is 0 ) and it is covered number of covered cells left is reduced by 1 before that cell is uncovered and then the function recurses on each of the surrounding 8 locations to continue opening empty cells . When recursion reaches cells with numbers that aren ' t 0 the cell is uncovered number of covered cells left is reduced and the function returns ( base case ) . Input : a Cell [] [] cells which is a field of the Board object being used and int i and j the indices / coordinates of a specific cell in the Board ' s Cell [] [] . Output : N / A no explicit outputs only changes states of some cells in the Board ' s Cell [] [] .
private void emptyAdjacents(Cell[][] cells, int i, int j) {
        if (cells[i][j].mineGet()) {
            return;
        }
        if (cells[i][j].numberGet() != 0) {
            if (cells[i][j].coveredGet()) {
                this.subLeft();
            }
            cells[i][j].uncover();
            return;
        }
        if (cells[i][j].numberGet() == 0 && cells[i][j].coveredGet()) {
            this.subLeft();
        }
        cells[i][j].uncover();
            if (i + 1 < cells.length && cells[i + 1][j].coveredGet()) {
                emptyAdjacents(cells, i + 1, j);
            }
            if (i + 1 < cells.length && j + 1 < cells[0].length && 
                cells[i + 1][j + 1].coveredGet()) {
                emptyAdjacents(cells, i + 1, j + 1);
            }
            if (j + 1 < cells[0].length && cells[i][j + 1].coveredGet()) {
                emptyAdjacents(cells, i, j + 1);
            }
            if (i > 0 && cells[i - 1][j].coveredGet()) {
                emptyAdjacents(cells, i - 1, j);
            }
            if (i > 0 && j > 0 && cells[i - 1][j - 1].coveredGet()) {
                emptyAdjacents(cells, i - 1, j - 1);
            }
            if (j > 0 && cells[i][j - 1].coveredGet()) {
                emptyAdjacents(cells, i, j - 1);
            }
            if (i > 0 && j + 1 < cells[0].length && 
                cells[i - 1][j + 1].coveredGet()) {
                emptyAdjacents(cells, i - 1, j + 1);
            }
            if (i + 1 < cells.length && j > 0 && 
                cells[i + 1][j - 1].coveredGet()) {
                emptyAdjacents(cells, i + 1, j - 1);
            }
    }
private void emptyAdjacents ( Cell [ ] [ ] cells , int i , int j ) { if ( cells [ i ] [ j ] . mineGet ( ) ) { return ; } if ( cells [ i ] [ j ] . numberGet ( ) != 0 ) { if ( cells [ i ] [ j ] . coveredGet ( ) ) { this . subLeft ( ) ; } cells [ i ] [ j ] . uncover ( ) ; return ; } if ( cells [ i ] [ j ] . numberGet ( ) == 0 && cells [ i ] [ j ] . coveredGet ( ) ) { this . subLeft ( ) ; } cells [ i ] [ j ] . uncover ( ) ; if ( i + 1 < cells . length && cells [ i + 1 ] [ j ] . coveredGet ( ) ) { emptyAdjacents ( cells , i + 1 , j ) ; } if ( i + 1 < cells . length && j + 1 < cells [ 0 ] . length && cells [ i + 1 ] [ j + 1 ] . coveredGet ( ) ) { emptyAdjacents ( cells , i + 1 , j + 1 ) ; } if ( j + 1 < cells [ 0 ] . length && cells [ i ] [ j + 1 ] . coveredGet ( ) ) { emptyAdjacents ( cells , i , j + 1 ) ; } if ( i > 0 && cells [ i - 1 ] [ j ] . coveredGet ( ) ) { emptyAdjacents ( cells , i - 1 , j ) ; } if ( i > 0 && j > 0 && cells [ i - 1 ] [ j - 1 ] . coveredGet ( ) ) { emptyAdjacents ( cells , i - 1 , j - 1 ) ; } if ( j > 0 && cells [ i ] [ j - 1 ] . coveredGet ( ) ) { emptyAdjacents ( cells , i , j - 1 ) ; } if ( i > 0 && j + 1 < cells [ 0 ] . length && cells [ i - 1 ] [ j + 1 ] . coveredGet ( ) ) { emptyAdjacents ( cells , i - 1 , j + 1 ) ; } if ( i + 1 < cells . length && j > 0 && cells [ i + 1 ] [ j - 1 ] . coveredGet ( ) ) { emptyAdjacents ( cells , i + 1 , j - 1 ) ; } }
Description: a helper function that has a base case for if the input cell is
 a mine.
Description : a helper function that has a base case for if the input cell is a mine .
// base case for mine
 // base case for non-empty square
 // reduce cells left when uncovering number
 // reduce number of cells left when uncovering empty
 // uncover and recurse until reach base case above
