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
|
|
@ -1,5 +1,6 @@
|
|||
#include "cell.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
|
||||
Cell::Cell()
|
||||
|
|
@ -15,3 +16,7 @@ void Cell::Restrict(uint8_t value) {
|
|||
assert(value >= 1 && value <= 9);
|
||||
possibilities_[value - 1] = false;
|
||||
}
|
||||
|
||||
uint8_t Cell::NumPossibilities() {
|
||||
return std::count(possibilities_.begin(), possibilities_.end(), true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue