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

turnPassedByfunction

The colour whose turn passed because it had no move, as the latest turn left the board — or null when nobody's did.

Two ways a turn passes, and the record says both: a forced pass on the record, and the flipping games' pass with no row at all, where the colour that just moved is to move again. A pass somebody chose — Go's — is not one.

Import it

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

Definition

function turnPassedBy(state: GameState): Stone | null

Parameters

NameTypeDescription
stateGameState

The current immutable game position.

Returns

Stone | null

The colour whose forced pass was recorded, or null when the latest move was not such a pass.

Examples

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

const state = createGame({variant:"freestyle",size:15});
console.log(turnPassedBy(state));
null

What it prints (run when this page was built)

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