Skip to content

Commit

Permalink
Adding random int into cells
Browse files Browse the repository at this point in the history
  • Loading branch information
kbca committed Mar 16, 2022
1 parent df2ceaa commit dc30c05
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion domain/board.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package domain

import "math/rand"

type cell struct {
coordX int
coordY int
Expand All @@ -12,6 +14,6 @@ type Board struct {

func (board *Board) RandomizeBoard() {
for i := range board.cells {
board.cells[i].number = 1
board.cells[i].number = rand.Intn(9) + 1
}
}

0 comments on commit dc30c05

Please sign in to comment.