Skip to the content

Narabe並べ

Play forty-eight abstract board games through immutable moves, legal choices and replayable records.

Narabe means arranging in Japanese, as in gomoku-narabe: five in a row. About the name

Contents

Reference · Rules and records

forbiddenAtfunction

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 it

import { forbiddenAt } from "@johnmorrisdotca/narabe";

Definition

function forbiddenAt(board: Cell[], settings: GameSettings, stone: Stone, point: Point, depth?: number): ForbiddenPattern | null

Parameters

NameTypeDescription
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 (optional)number

The current recursion depth of the forbidden-shape analysis.

Returns

ForbiddenPattern | null

The forbidden pattern, or null when the rules permit the shape.

Examples

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

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/narabe 1.3.0.