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
| Name | Type | Description |
|---|---|---|
kind | string | 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"));trueWhat it prints (run when this page was built)