group3.c
int g3_is3WinDirection(const struct connect4 *game, int row, int col, int dir, char piece) {
    const int DX[] = {-1, -1, -1, 0, 0, 1, 1, 1};
    const int DY[] = {-1, 1, 0, -1, 1, 0, -1, 1};

    //Count in the direction and the direction's inverse the number of pieces in a row around your blank
    int check3 = g3_countOutwards(game, row, col, DX[dir], DY[dir], piece) +
            g3_countOutwards(game, row, col, -DX[dir], -DY[dir], piece);

    //If you managed to get more than 3 in a row, its a valid play
    return check3 >= 3;
}
/* Given a direction and an original position, it will tell you if you win there */
Given a direction and an original position, it will tell you if you win there
Given a direction and an original position it will tell you if you win there
int g3_is3WinDirection(const struct connect4 *game, int row, int col, int dir, char piece) {
    const int DX[] = {-1, -1, -1, 0, 0, 1, 1, 1};
    const int DY[] = {-1, 1, 0, -1, 1, 0, -1, 1};
    int check3 = g3_countOutwards(game, row, col, DX[dir], DY[dir], piece) +
            g3_countOutwards(game, row, col, -DX[dir], -DY[dir], piece);
    return check3 >= 3;
}
int g3_is3WinDirection ( const struct connect4 * game , int row , int col , int dir , char piece ) { const int DX [ ] = { -1 , -1 , -1 , 0 , 0 , 1 , 1 , 1 } ; const int DY [ ] = { -1 , 1 , 0 , -1 , 1 , 0 , -1 , 1 } ; int check3 = g3_countOutwards ( game , row , col , DX [ dir ] , DY [ dir ] , piece ) + g3_countOutwards ( game , row , col , - DX [ dir ] , - DY [ dir ] , piece ) ; return check3 >= 3 ; }
Given a direction and an original position, it will tell you if you win there
Given a direction and an original position it will tell you if you win there
//Count in the direction and the direction's inverse the number of pieces in a row around your blank //If you managed to get more than 3 in a row, its a valid play