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

Movetype

A move rebuilt by the engine, including captures and other replay effects.

Import it

import type { Move } from "@johnmorrisdotca/narabe";

Definition

type Move = Point & {
    stone: Stone;
    by?: Stone;
    kind: MoveKind;
    captured?: Point[];
    from?: Point;
    twist?: Twist;
    cleared?: Cell[];
    cells?: PieceCell[];
    wasKing?: boolean;
    capturedWasKing?: boolean;
    continuedChain?: boolean;
    crowned?: boolean;
    forced?: boolean;
    headStart?: boolean;
    koPointBefore?: Point | null;
};

Members

NameTypeDescription
rownumber
colnumber
stoneStone

The colour of the stone placed.

by (optional)Stone | undefined

The colour that moved, when the game lets a mover place the other colour.

kindMoveKind
captured (optional)Point[] | undefined

Opponent stones this move took off the board, in the capture variants.

from (optional)Point | undefined

Where a moving piece came from. Only on move kinds.

twist (optional)Twist | undefined

The twist that finished this move, once it has been made.

cleared (optional)Cell[] | undefined

The bottom row this move cleared, so it can be put back by an undo.

cells (optional)PieceCell[] | undefined

The cells a piece covered, with their colours, on piece kinds.

wasKing (optional)boolean | undefined

Whether the piece making this move was already a king. Checkers only, for undo.

capturedWasKing (optional)boolean | undefined

Whether the piece this move captured was itself a king. Checkers only, for undo.

continuedChain (optional)boolean | undefined

Whether this move continued a capture chain already under way. Checkers only, for undo.

crowned (optional)boolean | undefined

Whether this move crowned the piece that made it. Checkers only, and only where it did: an endgame count reads the record back to the move that entered its ending, and a man becoming a king changes which ending it is.

forced (optional)boolean | undefined

On a pass: whether it was forced — the colour had nothing it could play — rather than chosen, as a pass in Go is. Set by passTurn when the pass is made, so a replay of the record sets it again; never stored.

headStart (optional)boolean | undefined

On a pass: whether it was a turn the other colour's head start took — see owesHeadStart. Set by passTurn from the position, like forced, and never stored.

koPointBefore (optional)Point | null | undefined

The ko point in force just before this move, so undo can put it back. Go only.

Examples

import type { Move } from "@johnmorrisdotca/narabe";

const value: Move = {row:7,col:7,stone:"black",kind:"place"};
console.log(value);
{ row: 7, col: 7, stone: 'black', kind: 'place' }

What it prints (run when this page was built)

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