Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Class: PuzzleSolvers.SandwichUniquenessConstraint

Summary

Describes a “sandwich” constraint: the numbers sandwiched between two specific numbers must sum up to a specified total. This constraint implies a uniqueness constraint. The two specified numbers can be in any order.

Remarks

Warning: This constraint is very memory-intensive. It is implemented as a CombinationsConstraint with all of the possible number combinations for the specified set of cells. Avoid using this on oversized puzzles.

Constructors

SandwichUniquenessConstraint(int value1, int value2, int sum, IEnumerable<int> affectedCells, int minValue = 1, int maxValue = 9)
Constructor.

Static methods

int?[][]
GenerateCombinations(int minValue, int maxValue, int value1, int value2, int sum, int numAffectedCells)
Returns a collection containing all combinations of numAffectedCells cells of values between minValue and maxValue in which the sum of the digits sandwiched between value1 and value2 is sum.
int
TranslateCoordinate(string str, int gridWidth = 9)
Converts a convenient coordinate notation into a puzzle-grid index.
IEnumerable<int>
TranslateCoordinates(string str, int gridWidth = 9)
Converts a convenient coordinate notation into puzzle-grid indices.

Instance methods

ConstraintResultRefer to the documentation for Constraint.Process.
stringOverride.

Instance properties

int[]The group of cells affected by this constraint, or null if it affects all of them.
boolRefer to the documentation for Constraint.CanReevaluate.
int?[][]The set of combinations allowed for the specified set of cells.
int?Refer to the documentation for Constraint.NumCombinations.
intThe total that the sandwiched numbers must sum up to.
intOne of the numbers that form the edges of the sandwich (the other is SandwichUniquenessConstraint.Value2).
intOne of the numbers that form the edges of the sandwich (the other is SandwichUniquenessConstraint.Value1).