Reference · Rules, solvers and generation
checkTsunagiAnswerfunction
Validate that an answer fills this board with legal, separate lines connecting every pair.
Import it
import { checkTsunagiAnswer } from "@johnmorrisdotca/tsunagi";
Definition
function checkTsunagiAnswer(size: number, givens: string, answer: string): TsunagiCheck
Parameters
| Name | Type | Description |
|---|---|---|
size | number | The number of cells on each side of the board. |
givens | string | The original native layout code. |
answer | string | The native complete answer string or solved lines specified by the signature. |
Returns
TsunagiCheck
Validate that an answer fills this board with legal, separate lines connecting every pair.
Examples
import { TSUNAGI_4 } from "@johnmorrisdotca/tsunagi/levels-4";
import { checkTsunagiAnswer } from "@johnmorrisdotca/tsunagi";
const givens = TSUNAGI_4[0][0];
const answer = TSUNAGI_4[0][1];
console.log(checkTsunagiAnswer(4,givens,answer));{ ok: true }What it prints (run when this page was built)