本文へ移動

Tsunagi繋ぎ

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

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

目次

リファレンス · ルール・解法・生成

Explosion型

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

EXPLOSIONS: every so many strokes, a drawn line is broken. John's row: "a drawn line broken or removed every so many moves", with a warning beat before it and "which line is deterministic from the level seed and the moves made", so two players making the same strokes on the same level meet the same explosions, and nothing is left to a coin in the browser.

A stroke is a line let go having changed the board (TsunagiSolve's lift). After the every-th stroke, and every every after it, one line with something drawn is chosen by a hash of the board and the stroke's number:

  • boom<N>: that line is cut back to half its length.
  • blast<N>: that line is wiped, and one line touching it is cut back to half as well.

A stroke that solves the level sets nothing off: the level is done first. Pure, like the rest of the drawing rules: new lines, the old ones untouched.

インポート

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

定義

type Explosion = {
    lines: Lines;
    hit: number[];
    cells: number[];
};

メンバー

名前型説明
linesLines
hitnumber[]
cellsnumber[]

例

import { TSUNAGI_4 } from "@johnmorrisdotca/tsunagi/levels-4";
import { decodeLayout, noLines } from "@johnmorrisdotca/tsunagi";
import type { Explosion } from "@johnmorrisdotca/tsunagi";

const givens = TSUNAGI_4[0][0];
const layout = decodeLayout(givens,4)!;
const lines = noLines(layout);
const value: Explosion = {lines,hit:[0],cells:[0]};
console.log(value);
{ lines: [ [], [], [], [] ], hit: [ 0 ], cells: [ 0 ] }

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

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

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