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

difficultyScoresfunction

Each level's score, 0 (easiest) to 100 (hardest), as the blend of its four percentiles among measures — one size's levels. A percentile is the share of the other levels strictly below it, so ties share a place and the score of a set of one is 0.

Import it

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

Definition

function difficultyScores(measures: readonly LevelMeasure[], size: number): number[]

Parameters

NameTypeDescription
measuresreadonly LevelMeasure[]

Native level measures to compare within this size.

sizenumber

The number of cells on each side of the board.

Returns

number[]

Each level's score, 0 (easiest) to 100 (hardest), as the blend of its four percentiles among measures — one size's levels. A percentile is the share of the other levels strictly below it, so ties share a place and the score of a set of one is 0.

Examples

import { TSUNAGI_4 } from "@johnmorrisdotca/tsunagi/levels-4";
import { difficultyScores, measureSolved } from "@johnmorrisdotca/tsunagi";

const givens = TSUNAGI_4[0][0];
const answer = TSUNAGI_4[0][1];
const measure = measureSolved(givens,answer,4,{nodes:1,branches:0})!;
console.log(difficultyScores([measure],4));
[ 0 ]

What it prints (run when this page was built)

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