con4lib.c
struct connect4* copy(const struct connect4* game) {
    struct connect4* res = malloc(sizeof(struct connect4));
    int i,j;
    for (i=0; i<NUM_ROWS; i++)
        for (j=0; j<NUM_COLS; j++)
            res->board[i][j] = game->board[i][j];
    res->whoseTurn = game->whoseTurn;
    return res;
}
// Returns a pointer to a deep copy of game.
Returns a pointer to a deep copy of game.
Returns a pointer to a deep copy of game .
struct connect4* copy(const struct connect4* game) {
    struct connect4* res = malloc(sizeof(struct connect4));
    int i,j;
    for (i=0; i<NUM_ROWS; i++)
        for (j=0; j<NUM_COLS; j++)
            res->board[i][j] = game->board[i][j];
    res->whoseTurn = game->whoseTurn;
    return res;
}
struct connect4 * copy ( const struct connect4 * game ) { struct connect4 * res = malloc ( sizeof ( struct connect4 ) ) ; int i , j ; for ( i = 0 ; i < NUM_ROWS ; i ++ ) for ( j = 0 ; j < NUM_COLS ; j ++ ) res -> board [ i ] [ j ] = game -> board [ i ] [ j ] ; res -> whoseTurn = game -> whoseTurn ; return res ; }
Returns a pointer to a deep copy of game.
Returns a pointer to a deep copy of game .