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

Getting started

Getting started

Install Tsunagi and check a bundled level's answer.

Join each pair with its own line and fill every playable cell. Tsunagi has fixed levels, native board codes, pure rules, bounded solvers and separate SVG/playable-board entries.

Install

npm install @johnmorrisdotca/tsunagi

The typed ES modules run in Node 22 or later or modern browsers. The root does not need a DOM. Load one fixed-size collection when you need its boards and answers.

Check a fixed answer

import {TSUNAGI_4} from "@johnmorrisdotca/tsunagi/levels-4";
import {decodeLayout,checkTsunagiAnswer} from "@johnmorrisdotca/tsunagi";
const [givens,answer] = TSUNAGI_4[0];
console.log(decodeLayout(givens,4)?.ends.length);
console.log(checkTsunagiAnswer(4,givens,answer));
4
{ ok: true }

Levels are one-based in the public ladder and zero-based in the imported array. checkTsunagiAnswer validates the lines in linear time; it does not prove the supplied layout belongs to the published level collection. Keep the original givens when checking a submitted answer.

Next steps

Level collections, pure gameplay, drawing/embedding, solving/generation, daily ladders and the reference cover the APIs.

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