group3.c
int g3_isSafe(const struct connect4 *game, int row, int col, char piece) {
    //Copies over the board
    struct connect4 * testBoard = copy(game);

    //Adds in your piece in the location listed
    testBoard->board[row][col] = piece;

    //Find out if they have a win if you put your piece in the location listed
    char them = other(piece);
    // Assume safe if the opponent cannot play above us. Otherwise, check for 3-win
    int ret = !inbounds(row+1, col) ? 1 : !g3_is3Win(testBoard, row + 1, col, them);

    //free the copy of the board and return
    free(testBoard);

    return ret;
}
/* Checks to see if placing a piece down causes a loss in the game */
Checks to see if placing a piece down causes a loss in the game
Checks to see if placing a piece down causes a loss in the game
int g3_isSafe(const struct connect4 *game, int row, int col, char piece) {
    struct connect4 * testBoard = copy(game);
    testBoard->board[row][col] = piece;
    char them = other(piece);
    int ret = !inbounds(row+1, col) ? 1 : !g3_is3Win(testBoard, row + 1, col, them);
    free(testBoard);
    return ret;
}
int g3_isSafe ( const struct connect4 * game , int row , int col , char piece ) { struct connect4 * testBoard = copy ( game ) ; testBoard -> board [ row ] [ col ] = piece ; char them = other ( piece ) ; int ret = ! inbounds ( row + 1 , col ) ? 1 : ! g3_is3Win ( testBoard , row + 1 , col , them ) ; free ( testBoard ) ; return ret ; }
Checks to see if placing a piece down causes a loss in the game
Checks to see if placing a piece down causes a loss in the game
//Copies over the board //Adds in your piece in the location listed //Find out if they have a win if you put your piece in the location listed // Assume safe if the opponent cannot play above us. Otherwise, check for 3-win //free the copy of the board and return