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

offBoardCellsfunction

The cells of a square that are off the board on a board with a shape: every # that reaches the square's edge through other # cells, by a square's four steps or a honeycomb's six.

Import it

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

Definition

function offBoardCells(grid: string, size: number, hex: boolean): Set<number>

Parameters

NameTypeDescription
gridstring

The cells of the layout, one character each.

sizenumber

The number of cells on each side of the board.

hexboolean

Whether to use hexagonal neighbours.

Returns

Set<number>

The cells of the square that are off the board.

Examples

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

console.log([...offBoardCells("A.#A.#####",3,false)]);
[ 8, 2, 7, 5, 6 ]

What it prints (run when this page was built)

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