Skip to content

Commit

Permalink
fix: limit max sudoku fill level by 50
Browse files Browse the repository at this point in the history
  • Loading branch information
cheatsnake committed Jul 9, 2023
1 parent 9087af1 commit 307120c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/sudoku/constants.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package sudoku

const maxFillFactor = 50

var basicGrid [9][9]int = [9][9]int{
{1, 2, 3, 4, 5, 6, 7, 8, 9},
{4, 5, 6, 7, 8, 9, 1, 2, 3},
Expand Down
2 changes: 1 addition & 1 deletion pkg/sudoku/preparation.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package sudoku
import "github.com/cheatsnake/shadify/internal/helpers"

func prepare(grid [9][9]int, fillFactor int) [9][9]int {
if fillFactor > 99 {
if fillFactor > maxFillFactor {
return grid
}
if fillFactor < 0 {
Expand Down

0 comments on commit 307120c

Please sign in to comment.