Koden för spelet i livet med en turbo C?

Koden för spelet i livet med en turbo C?

#include
#include

#define NUM_ROWS 100
#define NUM_COLS 100

int gol (int [h] [NUM_COLS], int rader, int col);

int main)
{
int en [NUM_ROWS] [NUM_COLS] = {{0, 0, 0, 0, 0, 0, 0},
{0, 0, 1, 0, 1, 0, 0},
{0, 1, 0, 1, 0, 1, 0},
{0, 0, 1, 0, 1, 0, 0},
{0, 1, 0, 1, 0, 1, 0},
{0, 0, 1, 0, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 0}};
int num_rows = 7.
int num_cols = 7.
int life_test;

life_test = game_of_life (en, num_rows, num_cols);

printf ("%d", & life_test);

Return 0;
}

int gol (int [h] [NUM_COLS], int rader, int col)

{
int i, j.
int en = 5;

för (jag = 2; jag< row;="">
för (j = 2, j< col;="">

om (h[i][j-1]==0)
a ++;
annat
om (h[i-1][j-1]==0)
a ++;
annat
IF(h[i-1][j]==0)
a ++;
annat
om (h[i-1][j+1])==0)
a ++;
{

om (en == 4)
h [i] [j] = 1;
annat
h [i] [j] = 0; }
returnera h [i] [j];
}