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

LevelMeasuretype

What is measured of one level.

Import it

import type { LevelMeasure } from "@johnmorrisdotca/tsunagi";

Definition

type LevelMeasure = {
    pairs: number;
    turns: number;
    longest: number;
    empties: number;
    forcedShare: number;
    nodes: number;
    branches: number;
};

Members

NameTypeDescription
pairsnumber
turnsnumber

Turns over every line of the answer.

longestnumber

The longest line, in cells.

emptiesnumber

Cells with no marble on them.

forcedSharenumber

The share of empty cells the forced moves alone fill, 0 to 1.

nodesnumber

Positions the solver looked at to prove the one answer.

branchesnumber

Positions where it had to try more than one way.

Examples

import { TSUNAGI_4 } from "@johnmorrisdotca/tsunagi/levels-4";
import { measureSolved } from "@johnmorrisdotca/tsunagi";
import type { LevelMeasure } 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})!;
const value: LevelMeasure = measure;
console.log(value);
{
  pairs: 4,
  turns: 0,
  longest: 4,
  empties: 8,
  forcedShare: 1,
  nodes: 1,
  branches: 0
}

What it prints (run when this page was built)

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