Reference · Pipes, rules and solving
SuidoChecktype
What a check says: solved, or the first reason it is not.
Import it
import type { SuidoCheck } from "@johnmorrisdotca/suido";
Definition
type SuidoCheck = {
ok: true;
} | {
ok: false;
reason: string;
};
Examples
import { SUIDO_5X5 } from "@johnmorrisdotca/suido/levels-5x5";
import { levelAnswer } from "@johnmorrisdotca/suido/levels";
import type { SuidoCheck } from "@johnmorrisdotca/suido";
import { checkSuidoAnswer } from "@johnmorrisdotca/suido";
const row = SUIDO_5X5[0];
const code = row[0];
const answer = levelAnswer(row)!;
const value: SuidoCheck = checkSuidoAnswer(code,answer);
console.log(value);{ ok: true }What it prints (run when this page was built)