Question

I am working on a side project, Conway's Game of life in canvas and Javascript. Technically everything is going smoothly but I have a problem about one of the rules.

One rule states that "Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.".

Currently I keep track of all living and dead cells, so these are only cells that have been drawn onto the grid previously. But I am unsure if the rule stated above also applies on a cell that is not draw yet.

So when is a cell considered "dead" or is a cell that has not been alive previously also considered dead?

Was it helpful?

Solution

Yes, cells in Game of Life may only be 'alive' or 'dead'. If they have never been alive, they are dead.

OTHER TIPS

One rule states that "Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.".

By that terminology, yes, any cell that is not alive is dead. There are only two states for the cells, dead or alive.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top