To set a value, select a cell and type a number.
To add a line or region constraint, select and drag; or shift-click.
To add other outside clue constraints, select a row or column arrow outside the grid.
For more information, see the help page.
Create a constraint between two cells by providing a custom JavaScript function.
The function takes the two cell values as input and should return true or false to indicate if the pair of values is valid.
Example: a < b will emulate a thermometer constraint.
a < b
(a,b) =>
Define an finite-state machine using JavaScript transition and accept functions. The cells in the constraint will processed in order, and the constraint will be satisfied if the accept function returns true for the final state. The state-machine can be non-deterministic, meaning that a given state and cell value can transition to multiple next states.
// The initial state(s). States can be any
// JSON-serializable value, except arrays.
startState = (
);
// transition returns a next state, or an array
// of states based on the current state and the
// cell value. Returns undefined or the empty
// array to reject a value.
function transition(state, value) {
}
// accept returns true when the state is a valid
// final state.
function accept(state) {