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

piecesHomefunction

How many of stone's pieces stand in the far camp.

Import it

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

Definition

function piecesHome(board: Cell[], size: number, stone: Stone): number

Parameters

NameTypeDescription
boardCell[]

The row-major board cells; null marks an empty point.

sizenumber

The number of cells on each side of the board.

stoneStone

The black or white colour being examined.

Returns

number

How many of stone's pieces stand in the far camp.

Examples

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

const halma = createGame({variant:"halma",size:8});
console.log(piecesHome(halma.board,8,"black"));
0

What it prints (run when this page was built)

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