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

EvaluationWeightstype

The numbers the evaluation is made of, each a number of pips.

Import it

import type { EvaluationWeights } from "@johnmorrisdotca/sugoroku";

Definition

type EvaluationWeights = {
    onRoll: number;
    raceChecker: number;
    home: readonly [
        number,
        number,
        number,
        number,
        number,
        number
    ];
    outfield: number;
    middle: number;
    anchor: number;
    anchorAdvanced: number;
    prime: number;
    stack: number;
    blotTempo: number;
    blotBoard: number;
    blotScale: number;
    threat: number;
    threatTempo: number;
    bar: number;
    barBoard: number;
    barOther: number;
};

Members

NameTypeDescription
onRollnumber

What it is worth to have the roll, which the side that does not have it must give up.

raceCheckernumber

Per checker still to bear off, in a race.

homereadonly [number, number, number, number, number, number]

What a made point in the home board is worth, by the point, 1 to 6.

outfieldnumber

A made point in the outfield (7 to 12), and in the other outfield (13 to 18).

middlenumber
anchornumber

A made point in the other side's home board, an anchor, and the extra for the 20 and 21 points.

anchorAdvancednumber
primenumber

The reward for a run of made points: this times the square of its length beyond two.

stacknumber

The cost of each checker beyond four on a point.

blotTemponumber

A blot's cost when hit, as a chance times (the pips it loses, this many more for the turn spent, and this much for each point the other side holds at home), all times blotScale.

blotBoardnumber
blotScalenumber
threatnumber

A share of the other side's blots that this side threatens.

threatTemponumber
barnumber

A checker on the bar, or yet to enter: a base cost and a cost for each point the other side holds at home.

barBoardnumber
barOthernumber

How much of that the other side's checkers on the bar are worth to this side.

Examples

import type { EvaluationWeights } from "@johnmorrisdotca/sugoroku";
import { EVALUATION_WEIGHTS } from "@johnmorrisdotca/sugoroku";

const value: EvaluationWeights = EVALUATION_WEIGHTS;
console.log(value);
{
  onRoll: 4,
  raceChecker: 1.6,
  home: [ 1.5, 3, 4, 5.2, 5.8, 4.6 ],
  outfield: 2.2,
  middle: 0.6,
  anchor: 5,
  anchorAdvanced: 7.5,
  prime: 1.8,
  stack: 1.4,
  blotTempo: 7,
  blotBoard: 1.2,
  blotScale: 1.15,
  threat: 0.45,
  threatTempo: 4,
  bar: 8,
  barBoard: 1.4,
  barOther: 0.8
}

What it prints (run when this page was built)

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