本文へ移動

Narabe並べ

48種類の盤上ゲームを、新しい局面を返す手の操作、合法手の一覧、再生できる棋譜で扱えます。

「並べ」は五目並べの「並べ」。石を並べることを表す言葉です。 名前について(英語)

目次

リファレンス · ルールと棋譜

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

引数

名前型説明
boardCell[]

The row-major board cells; null marks an empty point.

settingsGameSettings

The native game settings to interpret.

stoneStone

The black or white colour being examined.

pointPoint

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

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

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

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