There is a problem with the rules of life implemented here.
I experimented with setting up initial patterns, and they are not evolving as expected.
For example, creating three cells
cell[5][5].alive, cell[5][5].nextState = true, true
cell[5][6].alive, cell[5][6].nextState = true, true
cell[5][7].alive, cell[5][7].nextState = true,true
(and all other cells turned off) should create a "blinker" that has a period 2 oscillation
I also could not create a "glider".
I suspect there is a mistake with the lines
c.alive = c.nextState
c.nextState = c.alive
It is changing the alive/dead state of the cells at the same time as it is reading them to decide which cells live and which die.
There is a problem with the rules of life implemented here.
I experimented with setting up initial patterns, and they are not evolving as expected.
For example, creating three cells
(and all other cells turned off) should create a "blinker" that has a period 2 oscillation
I also could not create a "glider".
I suspect there is a mistake with the lines
It is changing the alive/dead state of the cells at the same time as it is reading them to decide which cells live and which die.