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 · SVG board

tsunagiDrawingfunction

A board as pieces, for a page that keeps its drawing in a framework's tree and writes only what changed: the same drawing as drawTsunagi, which is this written out.

Import it

import { tsunagiDrawing } from "@johnmorrisdotca/tsunagi/draw";

Definition

function tsunagiDrawing(layout: LinkLayout, options?: TsunagiDrawOptions): TsunagiDrawing

Parameters

NameTypeDescription
layoutLinkLayout

The decoded native board and its rule settings.

options (optional)TsunagiDrawOptions

Native drawing, geometry, game or mount settings.

Returns

TsunagiDrawing

The <svg>'s attributes, the custom properties its board sets, and its groups in painting order.

Examples

import { TSUNAGI_4 } from "@johnmorrisdotca/tsunagi/levels-4";
import { decodeLayout } from "@johnmorrisdotca/tsunagi";
import { tsunagiDrawing } from "@johnmorrisdotca/tsunagi/draw";

const layout = decodeLayout(TSUNAGI_4[0][0],4)!;
console.log(tsunagiDrawing(layout,{surface:true}).pieces.length);
10

What it prints (run when this page was built)

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