Skip to content

Commit 9a35d99

Browse files
committed
🐛 (sudoku): fix out of range error
1 parent fc43710 commit 9a35d99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/layout/number-buttons.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ func (gameLayout *GameLayout) detectNumberButtonHandler() {
115115
// detect range
116116
if xPos >= 0 && xPos <= 3*cellSize &&
117117
yPos >= 0 && yPos <= 3*cellSize {
118-
row := (yPos / cellSize) % cellSize
119-
col := (xPos / cellSize) % cellSize
118+
row := (yPos / cellSize) % game.BoxSize
119+
col := (xPos / cellSize) % game.BoxSize
120120
gameLayout.handleNumberButtonClick(row, col)
121121
}
122122
return

0 commit comments

Comments
 (0)