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

isKingAtfunction

Whether the piece at at, if any, is a king.

Import it

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

Definition

function isKingAt(kings: readonly Point[], at: Point): boolean

Parameters

NameTypeDescription
kingsreadonly Point[]

The points occupied by crowned pieces.

atPoint

The point to examine.

Returns

boolean

Whether the piece at at, if any, is a king.

Examples

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

const checkers = createGame({variant:"checkers"});
console.log(isKingAt(checkers.kings,{row:5,col:0}));
false

What it prints (run when this page was built)

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