main.c
/*
 * Function: count
 * ---------------
 * Count how many living neighbors there are around a cell
 *
 */
count

Count how many living neighbors there are around a cell
count Count how many living neighbors there are around a cell
int count(int x, int y) {
    int count = 0;
    int n, m;
    for (n = -1; n <= 1; n++) {
        for (m = -1; m <= 1; m++) {
            if (n == 0 && m == 0) {
                continue;
            }
            count += board[y + n][x + m];
        }
    }
    return count;
}
int count ( int x , int y ) { int count = 0 ; int n , m ; for ( n = -1 ; n <= 1 ; n ++ ) { for ( m = -1 ; m <= 1 ; m ++ ) { if ( n == 0 && m == 0 ) { continue ; } count += board [ y + n ] [ x + m ] ; } } return count ; }
Function: count
Function : count
//Ignore the cell himself