forbiddenAt関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Why stone may not play point, or null when it may. Only the patterns the
variant forbids that colour are looked for, so this is cheap outside renju
and omok.
インポート
import { forbiddenAt } from "@johnmorrisdotca/narabe";
定義
function forbiddenAt(board: Cell[], settings: GameSettings, stone: Stone, point: Point, depth?: number): ForbiddenPattern | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
board | Cell[] | The row-major board cells; null marks an empty point. |
settings | GameSettings | The native game settings to interpret. |
stone | Stone | The black or white colour being examined. |
point | Point | A zero-based row and column on the board. |
depth (省略可) | number | The current recursion depth of the forbidden-shape analysis. |
戻り値
ForbiddenPattern | null
The forbidden pattern, or null when the rules permit the shape.
例
import { createGame, forbiddenAt } from "@johnmorrisdotca/narabe";
const state = createGame({variant:"freestyle",size:15});
const point = {row:7,col:7};
console.log(forbiddenAt(state.board,state.settings,"black",point));null出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。