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

drawTsunagiCodefunction

A level's layout code drawn, or an empty string for a code that is no layout at that size.

Import it

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

Definition

function drawTsunagiCode(givens: string, size: number, options?: TsunagiDrawOptions): string

Parameters

NameTypeDescription
givensstring

The original native layout code.

sizenumber

The number of cells on each side of the board.

options (optional)TsunagiDrawOptions

Native drawing, geometry, game or mount settings.

Returns

string

A level's layout code drawn, or an empty string for a code that is no layout at that size.

Examples

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

const givens = TSUNAGI_4[0][0];
console.log(drawTsunagiCode(givens,4).startsWith("<svg"));
true

What it prints (run when this page was built)

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