Skip to the content

Sugoroku双六

Play backgammon and its relatives with native rules, cube and match scoring, seeded dice and replayable records.

Sugoroku is the Japanese name 双六 for games of tables. About the name

Contents

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

NameTypeDescription
gameGameState

The current immutable native game state.

sideSide

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)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/sugoroku 1.1.1.