本文へ移動

Tsunagi繋ぎ

同じ印の2つを別々の線で結び、盤を埋めます。収録された問題やシード付きの問題で遊べます。

「つなぎ」は、物をつなぐことを表す言葉です。 名前について(英語)

目次

リファレンス · 遊べる盤

TsunagiMountOptions型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

The puzzle, native display choices, controls and event callbacks for mounting a board.

インポート

import type { TsunagiMountOptions } from "@johnmorrisdotca/tsunagi/play";

定義

type TsunagiMountOptions = TsunagiLook & {
    size: number;
    givens: string;
    answer?: string;
    level?: number;
    set?: TsunagiSet;
    lines?: Lines;
    explosions?: TsunagiExplosionChoice;
    cheats?: boolean;
    controls?: boolean;
    chips?: boolean;
    zoom?: "auto" | "on" | "off";
    language?: TsunagiLanguage;
    onChange?: (detail: TsunagiEventDetail) => void;
    onStroke?: (detail: TsunagiEventDetail) => void;
    onExplosion?: (detail: TsunagiEventDetail) => void;
    onSolve?: (detail: TsunagiEventDetail) => void;
};

メンバー

名前型説明
marks (省略可)TsunagiMarks | undefined
fill (省略可)TsunagiFill | undefined
colours (省略可)"marble" | "bright" | "colour-blind" | "soft" | readonly TsunagiColour[] | undefined
board (省略可)"paper" | "wood" | "green" | "blue" | "red" | "black" | TsunagiBoardLook | undefined
coordinates (省略可)boolean | undefined
sizenumber

The board's size: how many cells across.

givensstring

The level's layout code.

answer (省略可)string | undefined

The level's one answer, as a code. With it a solve must be that answer, and Cheat can be offered.

level (省略可)number | undefined

Which level of its size this is, to show its difficulty and its place in its block.

set (省略可)TsunagiSet | undefined

Which set of levels level is in: classic (the default) or portals.

lines (省略可)Lines | undefined

Lines to start from, to carry on a game kept half played.

explosions (省略可)TsunagiExplosionChoice | undefined

Explosions as made (the default), softened or off.

cheats (省略可)boolean | undefined

Offer Cheat, which draws one unfinished line. Needs answer. Default false.

controls (省略可)boolean | undefined

The buttons and the lines of words under the board. Default true.

chips (省略可)boolean | undefined

A row of chips under the board: the level's difficulty and each challenge on it, each with the line that explains it when pressed. Default false.

zoom (省略可)"on" | "off" | "auto" | undefined

auto (the default): the zoom and move pad from 10×10 up. off: never. on: always.

language (省略可)TsunagiLanguage | undefined

The language the words are in. Left out, the host's own lang, or the page's, and it follows the page's.

onChange (省略可)((detail: TsunagiEventDetail) => void) | undefined
onStroke (省略可)((detail: TsunagiEventDetail) => void) | undefined
onExplosion (省略可)((detail: TsunagiEventDetail) => void) | undefined
onSolve (省略可)((detail: TsunagiEventDetail) => void) | undefined

例

import { TSUNAGI_4 } from "@johnmorrisdotca/tsunagi/levels-4";
import type { TsunagiMountOptions } from "@johnmorrisdotca/tsunagi/play";

const givens = TSUNAGI_4[0][0];
const answer = TSUNAGI_4[0][1];
const value: TsunagiMountOptions = {size:4,givens,answer,controls:true};
console.log(value);
{
  size: 4,
  givens: 'A..AB..BC..CD..D',
  answer: 'AAAABBBBCCCCDDDD',
  controls: true
}

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/tsunagi 1.7.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。