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

forbiddenReasonfunction

Why the colour to move may not play point, when a forbidden shape is why.

Import it

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

Definition

function forbiddenReason(state: GameState, point: Point): ForbiddenPattern | null

Parameters

NameTypeDescription
stateGameState

The current immutable game position.

pointPoint

A zero-based row and column on the board.

Returns

ForbiddenPattern | null

The forbidden pattern, or null when this point has no forbidden shape.

Examples

import { createGame, forbiddenReason } from "@johnmorrisdotca/narabe";

const state = createGame({variant:"freestyle",size:15});
const point = {row:7,col:7};
console.log(forbiddenReason(state, point));
null

What it prints (run when this page was built)

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