Reference · Rules, games and records
winKindfunction
The kind of win a game that winner has won by bearing off is: single, gammon or backgammon, before the rules say what they count for.
Import it
import { winKind } from "@johnmorrisdotca/sugoroku";
Definition
function winKind(game: GameState, winner: Side): WinKind
Parameters
| Name | Type | Description |
|---|---|---|
game | GameState | The current immutable native game state. |
winner | Side | The side whose win kind is evaluated. |
Returns
WinKind
The kind of win a game that winner has won by bearing off is: single, gammon or backgammon, before the rules say what they count for.
Examples
import { newGame, rollOpening, settingsFor, winKind } from "@johnmorrisdotca/sugoroku";
const settings = settingsFor("backgammon",{points:5,cube:true});
const game = rollOpening(newGame(settings),[3,1]);
console.log(winKind(game,"white"));backgammonWhat it prints (run when this page was built)