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

orderByDifficultyfunction

The order to play a size's levels in: easiest first, by score, and among equal scores by their order in levels so the ranking is the same every time it is made. Returns indexes into levels.

Import it

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

Definition

function orderByDifficulty(levels: readonly (readonly [string, string])[], size: number): number[]

Parameters

NameTypeDescription
levelsreadonly (readonly [string, string])[]

Layout/answer rows in their current order.

sizenumber

The number of cells on each side of the board.

Returns

number[]

The order to play a size's levels in: easiest first, by score, and among equal scores by their order in levels so the ranking is the same every time it is made. Returns indexes into levels.

Examples

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

console.log(orderByDifficulty([TSUNAGI_4[0]],4));
[ 0 ]

What it prints (run when this page was built)

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