Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

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

Declaration

public IndexingConstraint(
    IEnumerable<int> affectedCells,
    int position,
    int value,
    int offset = 1
)

Summary

Describes a constraint in a number-placement puzzle that requires a cell’s value to indicate the position of another value within a specified run of cells.

Parameters

IEnumerable<int>affectedCells The set of cells affected by this constraint (the “run”).
intposition The index of the cell within affectedCells to which the constraint applies.
intvalue The value that must be assigned to the cell at the specified position for the constraint to be satisfied.
intoffset The discrepancy between the 0-based indexing used by affectedCells and the value to be placed in the targeted cell. In a typical 9×9 indexing Sudoku, the value to be placed is 1-based, so the offset would be 1.

Remarks

Examples of this include row/column indexing Sudoku. In a column indexing Sudoku, a digit on an indexing cell in column X indicates the column in which X is placed in its row. For example, if R3C1 is a column indexing cell, a 4 in it would indicate that R3C4 is 1. In this example, the set of affected cells would be the whole row; IndexingConstraint.Position would be 0 (the column number, but counting from 0), and IndexingConstraint.Value would be 1 (the value to be placed).