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

slideWordfunction

A slide as the draughts records write it: square to square with an arrow, a capture with a colon (g5:e3), and a multi-jump as every square it landed on (g5:e3:c1). The colon is the draughts convention vint.ee and Russian notation use; pdn.ts writes a file's own separators.

Import it

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

Definition

function slideWord(squares: readonly string[], capture: boolean): string

Parameters

NameTypeDescription
squaresreadonly string[]

The square names along a move or capture chain.

captureboolean

Whether to join squares with capture separators.

Returns

string

A slide as the draughts records write it: square to square with an arrow, a capture with a colon (g5:e3), and a multi-jump as every square it landed on (g5:e3:c1). The colon is the draughts convention vint.ee and Russian notation use; pdn.ts writes a file's own separators.

Examples

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

console.log(slideWord(["a3","c5"],true));
a3:c5

What it prints (run when this page was built)

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