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:


and so on

my question is :

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

Recommended Answers

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.