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

pressAtfunction

A press: the lines after it, and the pair now being drawn, or null where the press draws nothing.

Import it

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

Definition

function pressAt(layout: LinkLayout, lines: Lines, cell: number): { lines: Lines; drawing: number | null; }

Parameters

NameTypeDescription
layoutLinkLayout

The decoded native board and its rule settings.

linesLines

The native cell lists for every pair.

cellnumber

The zero-based pointer target cell.

Returns

{ lines: Lines; drawing: number | null; }

The lines and drawing pair; drawing is null when the press starts no line.

Examples

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

const givens = TSUNAGI_4[0][0];
const layout = decodeLayout(givens,4)!;
const lines = noLines(layout);
console.log(pressAt(layout,lines,layout.ends[0][0]));
{ lines: [ [ 0 ], [], [], [] ], drawing: 0 }

What it prints (run when this page was built)

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