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

wrappedStepfunction

The cell beside at one step by (-1, +1, -size, +size) on a board that wraps: off one edge and in at the other.

Import it

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

Definition

function wrappedStep(size: number, at: number, by: number): number

Parameters

NameTypeDescription
sizenumber

The number of cells on each side of the board.

atnumber

The zero-based cell index.

bynumber

The signed cell-index step.

Returns

number

The cell beside at one step by (-1, +1, -size, +size) on a board that wraps: off one edge and in at the other.

Examples

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

console.log(wrappedStep(4,3,1));
0

What it prints (run when this page was built)

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