Summary
Encapsulates information given to
Constraint implementations (in a call to
Constraint.Process(SolverState)) during the puzzle solving algorithm.
Instance methods
bool | AllSame<T>(int cell, Func<int, T> predicate, out T result) |
Determines if all values that are still possible in the specified cell have the same value
when projected through the specified predicate. For example, this can be used to determine
if all the values still possible are the same parity, or all primes/non-primes, etc. |
bool | |
Determines if a specific value in a specific cell has already been
marked impossible or is out of range. |
void | |
Marks a specific value in a specific cell as no longer possible. |
void | |
Marks values in a specific cell as no longer possible that satisfy the given predicate
isImpossible. |
int | | Returns the largest value that is still possible within the specified cell. |
int | | Returns the smallest value that is still possible within the specified cell. |
void | |
Marks a specific cell as having to contain a specific value. |
Instance properties
int | | Returns the size of the puzzle being solved. |
int? | |
Exposes read-only access to the incomplete solution at the current point during the algorithm. |
int? | |
If not null , Constraint.Process(SolverState) was called immediately after placing a
value in the cell given by this index. (This value may be tentative; if the algorithm finds it to be
impossible, it will backtrack.) The implementation may examine deductions from just that one value. If
null , the method may have been called (a) at the very start of the algorithm before placing any values;
(b) after this constraint was returned from another constraint’s Constraint.Process(SolverState) call to replace it; or (c) if the constraint has Constraint.CanReevaluate and one of its affected cells has changed. In these cases, implementations
should examine the whole set of affected cells for possible deductions. |
int | |
Returns the value stored in the cell given by SolverState.LastPlacedCell (see there for details). Throws an
exception if SolverState.LastPlacedCell is null . |
int | | The maximum value that squares can have in this puzzle. For standard Sudoku, this is 9. |
int | | The minimum value that squares can have in this puzzle. For standard Sudoku, this is 1. |