Skip to the content

Tsunagi繋ぎ

Join each pair with a separate line and fill the board, through fixed levels or seeded puzzles.

Tsunagi means joining in Japanese. About the name

Contents

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

NameTypeDescription
sizenumber

The number of cells on each side of the board.

givensstring

The original native layout code.

answerstring

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)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/tsunagi 1.7.0.