Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions cell.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ type cell struct {

// checkState determines the state of the cell for the next tick of the game.
func (c *cell) checkState(cells [][]*cell) {
c.alive = c.nextState
c.nextState = c.alive

liveCount := c.liveNeighbors(cells)
if c.alive {
// 1. Any live cell with fewer than two live neighbours dies, as if caused by underpopulation.
Expand Down Expand Up @@ -97,6 +94,7 @@ func (c *cell) liveNeighbors(cells [][]*cell) int {

// draw draws the cell if it is alive.
func (c *cell) draw() {
c.alive = c.nextState
if !c.alive {
return
}
Expand Down