Reference · Rules, games and records
Movetype
ONE CHECKER MOVED BY ONE DIE, in the mover's own numbering: from its own
point from (or the BAR, 25, for a checker entering from the bar or from
off the board at the start of a race) to its own point to (0 for borne
off). A move that lands on a lone checker of the other side hits it.
Import it
import type { Move } from "@johnmorrisdotca/sugoroku";
Definition
type Move = {
readonly from: number;
readonly to: number;
readonly die: number;
readonly hit: boolean;
};
Members
| Name | Type | Description |
|---|---|---|
from | number | |
to | number | |
die | number | The number on the die that moved it. A checker borne off with a larger die than it needed has |
hit | boolean | Whether it hit a checker, which went to the other side's bar. |
Examples
import { legalPlaysOf, newGame, rollOpening, settingsFor } from "@johnmorrisdotca/sugoroku";
import type { Move } from "@johnmorrisdotca/sugoroku";
const settings = settingsFor("backgammon",{points:5,cube:true});
const game = rollOpening(newGame(settings),[3,1]);
const play = legalPlaysOf(game)[0];
const move = play.moves[0];
const value: Move = move;
console.log(value);{ from: 24, to: 21, die: 3, hit: false }What it prints (run when this page was built)