nhstrats

package
v0.0.0-...-af16e0c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2022 License: BSD-2-Clause Imports: 2 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func HiddenPairs

func HiddenPairs(sol *solver.Solver) (changed bool)

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

func HiddenQuads(sol *solver.Solver) (changed bool)

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

func HiddenSingles(sol *solver.Solver) (changed bool)

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

func HiddenTriples(sol *solver.Solver) (changed bool)

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

func NakedPairs(sol *solver.Solver) (changed bool)

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

func NakedQuads(sol *solver.Solver) (changed bool)

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

func NakedTriples(sol *solver.Solver) (changed bool)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL