squareBoard関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A square board, its edges joined if wrap, with any blocked cells.
インポート
import { squareBoard } from "@johnmorrisdotca/tsunagi";
定義
function squareBoard(side: number, more?: { wrap?: boolean; blocked?: ReadonlySet<number>; }): TsunagiBoard
引数
| 名前 | 型 | 説明 |
|---|---|---|
side | number | The number of cells on each side. |
more (省略可) | { wrap?: boolean; blocked?: ReadonlySet<number>; } | Whether the edges join, and the cells no line enters. |
戻り値
TsunagiBoard
The board as a graph.
例
import { squareBoard } from "@johnmorrisdotca/tsunagi";
console.log(squareBoard(5,{wrap:true}).around[0]);[ 20, 1, 5, 4 ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。