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
| Name | Type | Description |
|---|---|---|
onRoll | number | What it is worth to have the roll, which the side that does not have it must give up. |
raceChecker | number | Per checker still to bear off, in a race. |
home | readonly [number, number, number, number, number, number] | What a made point in the home board is worth, by the point, 1 to 6. |
outfield | number | A made point in the outfield (7 to 12), and in the other outfield (13 to 18). |
middle | number | |
anchor | number | A made point in the other side's home board, an anchor, and the extra for the 20 and 21 points. |
anchorAdvanced | number | |
prime | number | The reward for a run of made points: this times the square of its length beyond two. |
stack | number | The cost of each checker beyond four on a point. |
blotTempo | number | 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 |
blotBoard | number | |
blotScale | number | |
threat | number | A share of the other side's blots that this side threatens. |
threatTempo | number | |
bar | number | A checker on the bar, or yet to enter: a base cost and a cost for each point the other side holds at home. |
barBoard | number | |
barOther | number | 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)