Skip to content

Commit

Permalink
Upgraded Randomg source
Browse files Browse the repository at this point in the history
  • Loading branch information
qjuanp committed Feb 23, 2024
1 parent c184291 commit 0ec9583
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0ec9583

Please sign in to comment.