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

LINK_EMPTYconstant

TSUNAGI, WRITTEN DOWN: a level's layout and a finished grid, as the strings every puzzle travels as (puzzleCode.ts is the spelling of the number grids; this is the spelling of this one).

A LAYOUT is row-major, one character a cell: . for an empty cell, a capital letter for a stone (PAIR_LETTERS: after Z the digits, then small letters and some marks, for a board of dozens of pairs) — each letter exactly twice, the two ends of one line — # for a blocked cell no line may enter, and + for a BRIDGE: a cell two different lines cross, one straight across and one straight down, neither turning on it (John, 2026-09-26; Flow Free's bridges). The letters are named in the order their first stone is met reading left to right, top to bottom, so one layout has one spelling.

WALLS come after the cells, behind a |: the edges between two neighbouring cells no line may cross, each as its two cells a-b (a before b), in order, comma-separated — A..A|1-2,5-9. A layout with no walls has no |, so every layout written before walls existed is still the same string, and the same board (solves are kept by it).

A bridge sits away from the edge, never beside another bridge, and no wall touches it: it always has its four ways across.

A WAYPOINT is a pair's letter in lower case on an empty cell: a ring of that colour its line must pass through (John, 2026-09-26). WRAP comes last, as the segment wrap after the walls (or after the cells where there are none): the left and right edges join, and so do the top and bottom, so a line leaving one side comes back in on the other, as the wrapping gomoku does.

A HEXAGON (hex, first of the words after the walls) is Hexversi's honeycomb: an odd square of side 2R + 1 with every row slid half a cell along, so each cell has six neighbours — the four around it and the two diagonals along the slant, up-right and down-left (rules/hexagon.ts). The cells outside the hexagon of radius R are #, off the board, and a hexagon has no walls, bridges or wrap.

PORTALS (portals<a>-<b>,…, after wrap) are pairs of cells inside the board, each named by its two cells, the smaller first, the pairs by their smaller cell: a line that steps into one comes out of the other, going on the same way, so portals3-40 makes a line stepping right into cell 3 reappear moving right out of cell 40, in the cell beyond it. Both cells of a portal are on that line, and a portal is used by exactly one line, once, so the cells are filled like any other. A portal is an empty cell: never a stone, a waypoint, a bridge or blocked, never beside another portal, and a board with portals has no bridges and is no hexagon.

sparse says the board has few, long lines — at most sparseMost — and is refused on a board with more; strokes<N> (last of all) gives the player N strokes to solve it in, every lift that changed the board spending one.

AN ANSWER is the grid of cells with every open cell carrying the letter of the line through it, # where the layout has one, and + on a bridge: the two lines over it are the ones either side of it.

Imports carry their .ts so the level script (scripts/tsunagi-levels.ts) can run this under plain node.

Import it

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

Definition

const LINK_EMPTY: "." = "."

Examples

import { LINK_EMPTY } from "@johnmorrisdotca/tsunagi";
console.log(LINK_EMPTY);
.

What it prints (run when this page was built)

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