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

resolvePlacementfunction

Where a stone played at point actually goes: the same point, or in a drop game the bottom of its column. A click anywhere in a column is a play in that column.

Import it

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

Definition

function resolvePlacement(state: GameState, point: Point): Point

Parameters

NameTypeDescription
stateGameState

The current immutable game position.

pointPoint

A zero-based row and column on the board.

Returns

Point

Where a stone played at point actually goes: the same point, or in a drop game the bottom of its column. A click anywhere in a column is a play in that column.

Examples

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

const drop = createGame({variant:"dropFour"});
console.log(resolvePlacement(drop,{row:0,col:0}));
{ row: 6, col: 0 }

What it prints (run when this page was built)

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