EndgameCounttype
An ending that must be won within so many moves or it is a draw, once each
player has made movesEach more moves inside it.
endings: named pairings, either side holding either half — three kings
against one king, a king and a man against a king. restartsOnChange says
what a capture or a crowning that keeps the position inside the set does:
lets the count run on (FMJD 6.3, the Brazilian confederation's art. 99), or
starts it again, as a count "from when that balance arose" does.
balance: any ending of one of these numbers of pieces in which both sides
have a king, counted while the pieces stay exactly as they are — a capture or
a crowning always starts it again. The Russian federation's rule, which no
list of pairings could state without naming dozens of them.
Import it
import type { EndgameCount } from "@johnmorrisdotca/narabe";
Definition
type EndgameCount = {
kind: "endings";
endings: readonly (readonly [
PieceTally,
PieceTally
])[];
restartsOnChange: boolean;
movesEach: number;
} | {
kind: "balance";
pieces: readonly number[];
movesEach: number;
};
Examples
import type { EndgameCount } from "@johnmorrisdotca/narabe";
const value: EndgameCount = {kind:"balance",pieces:[2,2],movesEach:15};
console.log(value);{ kind: 'balance', pieces: [ 2, 2 ], movesEach: 15 }What it prints (run when this page was built)