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

leavesNoStonefunction

Whether a recorded move put nothing on the board: a pass, or a turn the clock took away. Neither has a point — both sit at -1, -1 — so anything reading a move's row and column asks this first.

Not the question "was this a pass". Two passes in a row end a game, and a forfeit before a pass is not the first of two: losing a turn on time says nothing about whether anybody could move. Code asking THAT compares with MOVE_KINDS.pass itself.

Import it

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

Definition

function leavesNoStone(kind: string | undefined): boolean

Parameters

NameTypeDescription
kindstring | undefined

The recorded move kind.

Returns

boolean

Whether a recorded move put nothing on the board: a pass, or a turn the clock took away. Neither has a point — both sit at -1, -1 — so anything reading a move's row and column asks this first. Not the question "was this a pass". Two passes in a row end a game, and a forfeit before a pass is not the first of two: losing a turn on time says nothing about whether anybody could move. Code asking THAT compares with MOVE_KINDS.pass itself.

Examples

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

console.log(leavesNoStone("pass"));
true

What it prints (run when this page was built)

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