Documentation ¶
Overview ¶
Package nhstrats provides strategies for naked/hidden doubles-quads and hidden singles (naked singles are handles by the solver package)
Package nhstrats provides strategies for naked/hidden doubles-quads and hidden singles (naked singles are handles by the solver package)
Index ¶
- func HiddenPairs(sol *solver.Solver) (changed bool)
- func HiddenQuads(sol *solver.Solver) (changed bool)
- func HiddenSingles(sol *solver.Solver) (changed bool)
- func HiddenTriples(sol *solver.Solver) (changed bool)
- func NakedPairs(sol *solver.Solver) (changed bool)
- func NakedQuads(sol *solver.Solver) (changed bool)
- func NakedTriples(sol *solver.Solver) (changed bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HiddenPairs ¶
HiddenPairs is a strategy that searches for hidden pairs in rows, columns and boxes (in that order). As soon as one is found, returns true. If none are found, returns false. Note: A hidden pair occurs when a pair of values is restricted to the same 2 cells in a row, column, or box.
func HiddenQuads ¶
HiddenQuads is a strategy that searches for hidden quadruples in rows, columns and boxes (in that order). As soon as one is found, returns true. If none are found, returns false. Note: A hidden quadruple occurs when four values are restricted to (a subset of) the same 4 cells in a row, column, or box.
func HiddenSingles ¶
HiddenSingles finds the hidden singles in the provided sudoku candidates. The first time one is found, change the candidates and return true, if none are found, return false. Order of priority is rows, then columns, then boxes. Note: hidden singles are the digits that can only appear in one spot in a row/column/box.
func HiddenTriples ¶
HiddenTriples is a strategy that searches for hidden triples in rows, columns and boxes (in that order). As soon as one is found, returns true. If none are found, returns false. Note: A hidden triple occurs when three values are restricted to (a subset of) the same 3 cells in a row, column, or box.
func NakedPairs ¶
NakedPairs is a strategy that searches for naked pairs in rows, columns and boxes (in that order). As soon as one is found, returns true. If none are found, returns false. Note: A naked pair occurs when two cells that see each other can each have only two values, which allows us to remove those two values from the rest of the row/column/box.
func NakedQuads ¶
NakedQuads is a strategy that searches for naked quadruples in rows, columns and boxes (in that order). As soon as one is found, returns true. If none are found, returns false. Note: A naked quadruple occurs when four cells that see each other can each have (some of) only four values, which allows us to remove those three values from the rest of the row/column/box. Similar to naked triples, the four cells need not have the same candidates.
func NakedTriples ¶
NakedTriples is a strategy that searches for naked triples in rows, columns and boxes (in that order). As soon as one is found, returns true. If none are found, returns false. Note: A naked triple occurs when three cells that see each other can each have (some of) only three values, which allows us to remove those three values from the rest of the row/column/box. Unlike naked pairs, the three cells need not have the same candidates (e.g. we can have cells with candidates 12, 13, and 23, and that would still be a valid 123 naked triple).
Types ¶
This section is empty.