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

layoutNeighboursfunction

Each cell's neighbours a line may step to on this board: the four around it, less any across a wall. A bridge is a neighbour like any cell; what a line does on one (go straight over) is the caller's to know.

Import it

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

Definition

function layoutNeighbours(layout: LinkLayout): number[][]

Parameters

NameTypeDescription
layoutLinkLayout

The decoded native board and its rule settings.

Returns

number[][]

Each cell's neighbours a line may step to on this board: the four around it, less any across a wall. A bridge is a neighbour like any cell; what a line does on one (go straight over) is the caller's to know.

Examples

import { TSUNAGI_4 } from "@johnmorrisdotca/tsunagi/levels-4";
import { decodeLayout, layoutNeighbours } from "@johnmorrisdotca/tsunagi";

const givens = TSUNAGI_4[0][0];
const layout = decodeLayout(givens,4)!;
console.log(layoutNeighbours(layout)[0]);
[ 1, 4 ]

What it prints (run when this page was built)

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