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

passTurnfunction

Takes a turn without a stone. Two passes end a piece game as a draw; in Go they end it by area count instead, since passing there is a real choice, not a sign nobody can move. A replay passes at the same point either way.

Import it

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

Definition

function passTurn(state: GameState): GameState

Parameters

NameTypeDescription
stateGameState

The current immutable game position.

Returns

GameState

The resulting position; a refused or inapplicable action leaves the input position unchanged.

Examples

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

const go = playMove(createGame({variant:"go",size:9}),{row:4,col:4});
console.log(passTurn(go).moves.length);
2

What it prints (run when this page was built)

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