diff --git a/conway.go b/conway.go index 9429b85..f1ce95c 100644 --- a/conway.go +++ b/conway.go @@ -2,6 +2,7 @@ package main import ( "errors" + "math/rand" "time" ) @@ -53,6 +54,8 @@ func initGrid(width, height int, parent ...[][]Cell) ([][]Cell, error) { // If specified, copy state from parent if exists { cells[i][j].live = parent[0][i][j].live + } else { + cells[i][j].live = rand.Intn(2) == 1 } } }