Reference · Rules, games and records
concedefunction
Give up the game: side loses. kind is what it is giving up, from concedeKind's worst down to a single game.
Import it
import { concede } from "@johnmorrisdotca/sugoroku";
Definition
function concede(game: GameState, side: Side, kind?: WinKind): GameState
Parameters
| Name | Type | Description |
|---|---|---|
game | GameState | The current immutable native game state. |
side | Side | The side being examined: white or black. |
kind (optional) | WinKind | The native single, gammon or backgammon result. |
Returns
GameState
Give up the game: side loses. kind is what it is giving up, from concedeKind's worst down to a single game.
Examples
import { concede, newGame, rollOpening, settingsFor } from "@johnmorrisdotca/sugoroku";
const settings = settingsFor("backgammon",{points:5,cube:true});
const game = rollOpening(newGame(settings),[3,1]);
const result = concede(game,"black","single").result!;
console.log(concede(game,"black","single").result);{
winner: 'white',
how: 'concede',
kind: 'single',
multiplier: 1,
cube: 1,
points: 1
}What it prints (run when this page was built)