Summary
Describes a constraint in a number placement puzzle in which cells that are a knight’s move away from each other
cannot contain the same value.
Constructors
AntiKnightConstraint(int gridWidth, int gridHeight, int[] affectedValues = null, IEnumerable<int> enforcedCells = null, bool toroidal = false) |
Describes a constraint in a number placement puzzle in which cells that are a knight’s move away from each other
cannot contain the same value. |
Static methods
| IEnumerable<int> | KnightsMoves(int cell, int gridWidth, int gridHeight, bool toroidal) |
Returns the set of cells that are a knight’s move away from the specified cell. |
Instance methods
Instance properties
| bool | |
If true, the constraint considers the grid to be toroidal, meaning that it wraps around the left/right
and top/bottom edges. Thus, in a Sudoku-sized grid, A1 would be a knight’s move away from B8 and H2. If
false, the knight’s move cannot extend beyond the bounds of the grid. |