Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Constructor: SandwichUniquenessConstraint(int, int, int, IEnumerable<int>, int, int)

Declaration

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

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.

Parameters

intvalue1 One of the numbers that form the edges of the sandwich.
intvalue2 The other number that forms the edge of the sandwich.
intsum The total that the sandwiched numbers must sum up to.
IEnumerable<int>affectedCells The set of cells affected by this constraint. This is usually a row or column in a grid, but it can be any subset of grid points.
intminValue The minimum value of numbers in the grid for this puzzle.
intmaxValue The maximum value of numbers in the grid for this puzzle.

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.