Skip to content

Commit

Permalink
refactor: Updated getRandomBool assist
Browse files Browse the repository at this point in the history
  • Loading branch information
cheatsnake committed Sep 23, 2022
1 parent 9b7a861 commit 8f54755
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/helpers/assists.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func IndexOf[T int | string](element T, data []T) int {
}

func GetRandomBool(chance int) bool {
return rand.Intn(100) < chance
return rand.Intn(1000) < chance
}

func SliceContains[T int | string](a []T, x T) bool {
Expand Down
2 changes: 1 addition & 1 deletion pkg/takuzu/generation.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func prepareField(field [][]string, fillFactor int) ([][]string, error) {
for i, row := range field {
preparedRow := []string{}
for j := range row {
randBool := helpers.GetRandomBool(fillFactor)
randBool := helpers.GetRandomBool(fillFactor * 10)
if randBool {
preparedRow = append(preparedRow, string(field[i][j]))
} else {
Expand Down

0 comments on commit 8f54755

Please sign in to comment.