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

generateTsunagifunction

One level for any board, proved to have exactly one answer, or null where this seed found none in its tries. Null is an honest answer: nothing here returns a board it could not prove.

Import it

import { generateTsunagi } from "@johnmorrisdotca/tsunagi";

Definition

function generateTsunagi(board: TsunagiBoard, random: Random, options?: GeneratorOptions): LinkCandidate | null

Parameters

NameTypeDescription
boardTsunagiBoard

The board as a graph (squareBoard, oblongBoard, hexagonBoard, tallHexagonBoard, shapedBoard).

randomRandom

A reproducible random source returning values in [0,1).

options (optional)GeneratorOptions

How its lines run, what the proof may spend, and the twists to plant.

Returns

LinkCandidate | null

A candidate proved to have one answer, or null.

Examples

import { generateTsunagi, seededRandom, squareBoard } from "@johnmorrisdotca/tsunagi";

console.log(generateTsunagi(squareBoard(5),seededRandom(42))?.layout);
ABCD....B.A.C..D.........

What it prints (run when this page was built)

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