lineDirectionsFor関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The directions a winning line may run: the hexagon's three axes on a hexagon board, the square's four otherwise.
インポート
import { lineDirectionsFor } from "@johnmorrisdotca/narabe";
定義
function lineDirectionsFor(hexagon: boolean): readonly Point[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
hexagon | boolean | Whether to use the hexagonal rather than square line directions. |
戻り値
readonly Point[]
The directions a winning line may run: the hexagon's three axes on a hexagon board, the square's four otherwise.
例
import { lineDirectionsFor } from "@johnmorrisdotca/narabe";
console.log(lineDirectionsFor(false));[
{ row: 0, col: 1 },
{ row: 1, col: 0 },
{ row: 1, col: 1 },
{ row: 1, col: -1 }
]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。