main.c
/*
 * Function: apply
 * ---------------
 * Make one move in the game by his rules
 *
 */
apply

Make one move in the game by his rules
apply Make one move in the game by his rules
void apply(void) {
    int neighbors[BOARD_SIZE][BOARD_SIZE] = {{0}};
    int x, y;
    for (y = 1; y <= BOARD_SIZE; y++) {
        for (x = 1; x <= BOARD_SIZE; x++) {
            neighbors[y-1][x-1] = count(x, y);
        }
    }
    for (y = 1; y <= BOARD_SIZE; y++) {
        for (x = 1; x <= BOARD_SIZE; x++) {
            if (board[y][x] == 0) {
                if (neighbors[y-1][x-1] == 3) {
                    board[y][x] = 1;
                }
            } else {
                if (neighbors[y-1][x-1] < 2 || neighbors[y-1][x-1] > 3) {
                    board[y][x] = 0;
                }
            }
        }
    }
}
void apply ( void ) { int neighbors [ BOARD_SIZE ] [ BOARD_SIZE ] = { { 0 } } ; int x , y ; for ( y = 1 ; y <= BOARD_SIZE ; y ++ ) { for ( x = 1 ; x <= BOARD_SIZE ; x ++ ) { neighbors [ y - 1 ] [ x - 1 ] = count ( x , y ) ; } } for ( y = 1 ; y <= BOARD_SIZE ; y ++ ) { for ( x = 1 ; x <= BOARD_SIZE ; x ++ ) { if ( board [ y ] [ x ] == 0 ) { if ( neighbors [ y - 1 ] [ x - 1 ] == 3 ) { board [ y ] [ x ] = 1 ; } } else { if ( neighbors [ y - 1 ] [ x - 1 ] < 2 || neighbors [ y - 1 ] [ x - 1 ] > 3 ) { board [ y ] [ x ] = 0 ; } } } } }
Function: apply
Function : apply
//Map the board for each cell by his neighbors count