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

pieceMovesfunction

Where a piece of the colour to move may step from from; empty if it may not move.

Import it

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

Definition

function pieceMoves(state: GameState, from: Point): Point[]

Parameters

NameTypeDescription
stateGameState

The current immutable game position.

fromPoint

The source point of the group or moving piece.

Returns

Point[]

Where a piece of the colour to move may step from from; empty if it may not move.

Examples

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

const checkers = createGame({variant:"checkers"});
console.log(pieceMoves(checkers,{row:5,col:0}));
[]

What it prints (run when this page was built)

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