本文へ移動

Tsunagi繋ぎ

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

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

目次

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

shapedBoard関数

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

A board of any outline: every cell of the square keep says yes to, and the rest off the board. A hole in the middle reads as blocked cells, since it does not reach the edge (offBoardCells).

インポート

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

定義

function shapedBoard(size: number, keep: (at: number) => boolean, more?: { hex?: boolean; }): TsunagiBoard

引数

名前型説明
sizenumber

The side of the square it is written in.

keep(at: number) => boolean

Whether a cell is on the board.

more (省略可){ hex?: boolean; }

Whether it is a honeycomb.

戻り値

TsunagiBoard

The board as a graph.

例

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

console.log(shapedBoard(5,(at)=>at%5!==2||at>=10).cells.length);
23

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

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

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