Skip to content

Instantly share code, notes, and snippets.

@jezinka
Last active May 24, 2020 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jezinka/b17330bdf196d08fc2dd034ab82a4846 to your computer and use it in GitHub Desktop.
Save jezinka/b17330bdf196d08fc2dd034ab82a4846 to your computer and use it in GitHub Desktop.
step
void step() {
if (isFixedNumber["$rowIndex$columnIndex" as String]) {
nextCell()
} else {
int cell = board[rowIndex][columnIndex]
int value = ++cell
if (value <= 9) {
board[rowIndex][columnIndex] = value
if (this.isValid()) {
nextCell()
}
} else {
board[rowIndex][columnIndex] = 0
do {
previousCell()
} while (isFixedNumber["$rowIndex$columnIndex" as String])
}
}
printTable()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment