diff --git a/conway.go b/conway.go index 816db99..9429b85 100644 --- a/conway.go +++ b/conway.go @@ -61,11 +61,12 @@ func initGrid(width, height int, parent ...[][]Cell) ([][]Cell, error) { var grid [][]Cell -func setup(callback func([][]Cell), width, height, FPS int) chan bool { +func setup(callback func([][]Cell), width, height int, FPS time.Duration) chan bool { + // Initialize grid grid, _ = initGrid(width, height) // Prepare ticker and finishing flag - ticker := time.NewTicker(time.Second / time.Duration(FPS)) + ticker := time.NewTicker((1000 / FPS) * time.Millisecond) done := make(chan bool) // Run game loop