Update Sudoku Solver to check for naked singles.
This commit is contained in:
parent
bcc5b5097e
commit
3dc9f04650
5 changed files with 40 additions and 0 deletions
|
|
@ -6,6 +6,11 @@ int main(int argc, char** argv) {
|
|||
Puzzle puzzle = Puzzle::FromString(
|
||||
"3..4.162.1...8.4....5.2.83..578........7..5.3..29.4..748.53..1.2.3.9...."
|
||||
".7...6.9.");
|
||||
while (puzzle.ApplyNextStep())
|
||||
;
|
||||
if (!puzzle.IsSolved()) {
|
||||
std::cout << "Error! Couldn't Solve" << std::endl;
|
||||
}
|
||||
std::cout << "https://tiramisu.one/sudoku.html?p=" << puzzle.CurrentState()
|
||||
<< "&m=" << puzzle.PencilMarkState() << std::endl;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue