-
-
Save jezinka/b17330bdf196d08fc2dd034ab82a4846 to your computer and use it in GitHub Desktop.
step
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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