concerning john conway life of death , a grid ,in which there alive cells, form a pattern .
This pattern is in the positioning 0 which is called generation 0 . a loop begins and the status of cells , in each generation , change so that the pattern change during each generation.

for example :

generation | numbers of alive cells

loop gives:

0=45
1=60
2=55
3=80
4=90
.....
....

and so on

my question is :

how to know ****the numbers of alive cells** at each generation while the loop goes??**

Recommended Answers

I'm not quite sure I understand the question. You're simulating the game of life, so, at each step, you have a grid containing the live and dead cells, right? So just iterate over that grid and count the cells that are alive.

Jump to Post

All 2 Replies

I'm not quite sure I understand the question. You're simulating the game of life, so, at each step, you have a grid containing the live and dead cells, right? So just iterate over that grid and count the cells that are alive.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.