answersLogoWhite

0


Best Answer

#include<stdio.h>

#include<stdio.h>

#define NUM_ROWS 100

#define NUM_COLS 100

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

int main()

{

int a[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(a, num_rows, num_cols);

printf ("%d", &life_test);

return 0;

}

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

{

int i, j;

int a=5;

for( i = 2; i < row; i++)

for( j = 2; j < col; j++)

if (h[i][j-1]==0)

a++;

else

if (h[i-1][j-1]==0)

a++;

else

if(h[i-1][j]==0)

a++;

else

if (h[i-1][j+1])==0)

a++;

{

if (a==4)

h[i][j]= 1;

else

h[i][j]=0; }

return h[i][j];

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Code of game of life using a turbo C?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the unlock code for hp game of The Game of Life?

life38419


What is the bank code for The Game of Life?

figger out yourself


What is the unlock code for the life game?

LHJP-RLAT-KNBP This is for The Game Of Life for Wild Tangent Games/HP


What is the unlock code for the game of life?

LHJP-RLAT-KNBP This is for The Game Of Life for Wild Tangent Games/HP


WHAT is the code for wildtangent game of life?

There is none, but there is other codes.


What is the unlock code for hp game of life on hp games?

life38419


What is the code to unlock special cards in spongebob game of life?

Vgghwf3478rb238


What is the unlock code for Military Life tank simulator?

for free game


What is the unlock code for wildtangent game of life?

There is none, but there is other codes.


What are cheat codes for worlds hardest game?

the cheat code is get a life


What are cheats code for Game Boy Advance SP emerald game?

The cheat to Game boy Advance Sp emerald is: Get a life...


How can you get half life source?

The Half-Life source is proprietary. There is no way to legally obtain the source code, unless you work for Valve.To get the game Half-Life: Source, install Steam, , buy the game for $10, then install the game.