From 0ec95831f4c2377d0801fc8784ef140f81a17df2 Mon Sep 17 00:00:00 2001 From: Juan P Date: Fri, 23 Feb 2024 18:20:46 +0000 Subject: [PATCH] Upgraded Randomg source --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 16e9f00..15c17f0 100644 --- a/main.go +++ b/main.go @@ -47,12 +47,13 @@ func createBoard(rows int, columns int) [][]uint8 { func ramdomInitialization(rows uint32, columns uint32, seed int64) [][]uint8 { var board [][]uint8 = make([][]uint8, rows) - rand.Seed(seed) + + random := rand.New(rand.NewSource(seed)) for row := range board { board[row] = make([]uint8, columns) for column := range board[row] { - randomValue := rand.Float64() + randomValue := random.Float64() if randomValue >= 0.5 { board[row][column] = ALIVE } else {