Declaration
public BattlefieldUniquenessConstraint(
int clue,
IEnumerable<int> affectedCells,
int minValue = 1,
int maxValue = 9
)Summary
Describes a “battlefield” constraint: the first and last number in the region represent the sizes of two armies, who
march inward; the clue specifies the sum of the digits that are sandwiched between the armies or that are within the
armies’ overlap. This constraint implies a uniqueness constraint.
Parameters
| int | clue |
The sum of the digits sandwiched or overlapped. |
| 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. |
| int | minValue |
The minimum value of numbers in the grid for this puzzle. |
| int | maxValue |
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. (At
time of writing, this is only feasible for up to 11 cells, which uses about 2 GB of RAM for each constraint.)