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

TsunagiPiecetype

ONE GROUP OF A DRAWING: what tsunagiDrawing hands a page instead of one long string, so that a page keeping its drawing in a framework's own tree writes only the groups whose text changed. A piece is a <g> with these attributes, holding either its SVG text or more pieces (a pair's washes, its line and its little marbles are a piece each, so a finger moving through a cell changes one or two pairs and not the thousands of elements of a 30×30 board).

Import it

import type { TsunagiPiece } from "@johnmorrisdotca/tsunagi/draw";

Definition

type TsunagiPiece = {
    key: string;
    attributes: Readonly<Record<string, string>>;
    html?: string;
    pieces?: readonly TsunagiPiece[];
};

Members

NameTypeDescription
keystring

Stable from one drawing of a board to the next.

attributesReadonly<Record<string, string>>
html (optional)string | undefined

Its SVG text, unless it holds pieces.

pieces (optional)readonly TsunagiPiece[] | undefined

Examples

import type { TsunagiPiece } from "@johnmorrisdotca/tsunagi/draw";

const value: TsunagiPiece = {key:"ground",attributes:{class:"tsu-ground"},html:""};
console.log(value);
{ key: 'ground', attributes: { class: 'tsu-ground' }, html: '' }

What it prints (run when this page was built)

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