Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Class: PuzzleSolvers.SkyscraperUniquenessConstraint

Summary

Describes a “skyscraper” constraint: the numbers in the grid represent the height of a skyscraper; taller skyscrapers obscure the view of smaller ones behind them; and the clue specifies how many skyscrapers are visible from the direction of the clue. This constraint implies a uniqueness constraint.

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.)

Constructors

SkyscraperUniquenessConstraint(int clue, IEnumerable<int> affectedCells, int minValue = 1, int maxValue = 9)
Describes a “skyscraper” constraint: the numbers in the grid represent the height of a skyscraper; taller skyscrapers obscure the view of smaller ones behind them; and the clue specifies how many skyscrapers are visible from the direction of the clue. This constraint implies a uniqueness constraint. (see also remarks)

Static methods

int
CalculateSkyscraperClue(IEnumerable<int> values)
Calculates what the Skyscraper clue would be for a given row of numbers.

Instance methods

ConstraintResultRefer to the documentation for Constraint.Process.
stringOverride.

Instance properties

intThe number of skyscrapers visible.