Projects in C/Connect 4 Game/Connect4Game.c
int checkForWinner(int theGrid[][MAX_COLS], int rows, int cols)
{
    int winner = 0;  
    winner = checkForVerticalWinner(theGrid, rows, cols);
    if(winner == 0)
    {
        winner = checkForHorizontalWinner(theGrid, rows, cols);
    }
    if(winner == 0)
    {
        winner = checkForRightDiagonalWinner(theGrid, rows, cols);
    }
    if(winner == 0)
    {
        winner = checkForLeftDiagonalWinner(theGrid, rows, cols);
    }
    return winner; 
}
/*
    return 0, 1 or 2
    0 no winner
*/
return 0, 1 or 2
0 no winner
return 0 1 or 2 0 no winner
int checkForWinner(int theGrid[][MAX_COLS], int rows, int cols)
{
    int winner = 0;  
    winner = checkForVerticalWinner(theGrid, rows, cols);
    if(winner == 0)
    {
        winner = checkForHorizontalWinner(theGrid, rows, cols);
    }
    if(winner == 0)
    {
        winner = checkForRightDiagonalWinner(theGrid, rows, cols);
    }
    if(winner == 0)
    {
        winner = checkForLeftDiagonalWinner(theGrid, rows, cols);
    }
    return winner; 
}
int checkForWinner ( int theGrid [ ] [ MAX_COLS ] , int rows , int cols ) { int winner = 0 ; winner = checkForVerticalWinner ( theGrid , rows , cols ) ; if ( winner == 0 ) { winner = checkForHorizontalWinner ( theGrid , rows , cols ) ; } if ( winner == 0 ) { winner = checkForRightDiagonalWinner ( theGrid , rows , cols ) ; } if ( winner == 0 ) { winner = checkForLeftDiagonalWinner ( theGrid , rows , cols ) ; } return winner ; }
return 0, 1 or 2
0 no winner
return 0 1 or 2 0 no winner