con4lib.c
int count_char(const struct connect4* game, int x, int y, int dx, int dy, int len, char piece) {
    int i, res = 0;
    for (i=0; i<len; i++)
        if (game->board[x+dx*i][y+dy*i] == piece)
            res++;
    return res;
}
// Returns the number of items in the game board in the set of squares,
// starting at row y, column x moving in the direction (dx, dy) for len
// number of squares, that are equal to piece.
Returns the number of items in the game board in the set of squares,
starting at row y, column x moving in the direction (dx, dy) for len
number of squares, that are equal to piece.
Returns the number of items in the game board in the set of squares starting at row y column x moving in the direction ( dx dy ) for len number of squares that are equal to piece .
int count_char(const struct connect4* game, int x, int y, int dx, int dy, int len, char piece) {
    int i, res = 0;
    for (i=0; i<len; i++)
        if (game->board[x+dx*i][y+dy*i] == piece)
            res++;
    return res;
}
int count_char ( const struct connect4 * game , int x , int y , int dx , int dy , int len , char piece ) { int i , res = 0 ; for ( i = 0 ; i < len ; i ++ ) if ( game -> board [ x + dx * i ] [ y + dy * i ] == piece ) res ++ ; return res ; }
Returns the number of items in the game board in the set of squares,
starting at row y, column x moving in the direction (dx, dy) for len
number of squares, that are equal to piece.
Returns the number of items in the game board in the set of squares starting at row y column x moving in the direction ( dx dy ) for len number of squares that are equal to piece .