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

checkersHasCapturefunction

Whether any of stone's pieces on the board has a capture available right now.

Import it

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

Definition

function checkersHasCapture(board: Cell[], kings: readonly Point[], size: number, stone: Stone, rules?: CheckersRules): boolean

Parameters

NameTypeDescription
boardCell[]

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

kingsreadonly Point[]

The points occupied by crowned pieces.

sizenumber

The number of cells on each side of the board.

stoneStone

The black or white colour being examined.

rules (optional)CheckersRules

The draughts rule set governing capture.

Returns

boolean

Whether any of stone's pieces on the board has a capture available right now.

Examples

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

const checkers = createGame({variant:"checkers"});
console.log(checkersHasCapture(checkers.board,checkers.kings,8,"black",ENGLISH_CHECKERS_RULES));
false

What it prints (run when this page was built)

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