Reference · Number-puzzle engines
kazuRefusalfunction
A refusal: { ok: false }, the English reason (the clause of the code with the values in its gaps), the code
and the values.
Import it
import { kazuRefusal } from "@johnmorrisdotca/kazu";
Definition
function kazuRefusal(code: KazuCheckCode, values?: KazuCheckValues): Extract<KazuCheck, { ok: false; }>
Parameters
| Name | Type | Description |
|---|---|---|
code | "no-kind-at" | "no-check" | "givens-not-grid" | "givens-not-regions" | "givens-not-cages" | "givens-not-marks" | "givens-not-clues" | "regions-not-sound" | "answer-not-grid" | "answer-has-empty-cells" | "given-changed" | "row-repeats" | "column-repeats" | "box-repeats" | "region-repeats" | "diagonal-repeats" | "cage-repeats" | "cage-sum-wrong" | "mark-not-true" | "clue-sees-wrong" | Why the answer is not taken. |
values (optional) | Readonly<Record<string, string | number>> | undefined | What fills the clause's gaps, where it has any. |
Returns
{ ok: false; reason: string; code: KazuCheckCode; values?: KazuCheckValues; }
The refusal checkKazu gives.
Examples
import { kazuRefusal } from "@johnmorrisdotca/kazu";
console.log(kazuRefusal("row-repeats", { n: 3 }));{
ok: false,
reason: 'row 3 repeats a number',
code: 'row-repeats',
values: { n: 3 }
}What it prints (run when this page was built)