Reference · Rules, games and records
ComputerOptionstype
Strength, tie-breaking randomness, lookahead time budget and evaluation weights for computer decisions.
Import it
import type { ComputerOptions } from "@johnmorrisdotca/sugoroku";
Definition
type ComputerOptions = {
strength?: Strength;
random?: Random;
budget?: number;
weights?: EvaluationWeights;
};
Members
| Name | Type | Description |
|---|---|---|
strength (optional) | Strength | undefined | The strength. Default |
random (optional) | Random | undefined | Where its choices come from, for |
budget (optional) | number | undefined | The longest, in milliseconds, it spends looking ahead at one move: it looks at its best plays in order and stops when the time is
up (always having looked at the best two). Default 60, so a move stays well under a tenth of a second even in a position of
hundreds of plays on a slow device. |
weights (optional) | EvaluationWeights | undefined | Weights for the evaluation, to play with a different taste. Default |
Examples
import type { ComputerOptions } from "@johnmorrisdotca/sugoroku";
import { seededRandom } from "@johnmorrisdotca/sugoroku";
const value: ComputerOptions = {strength:"greedy",random:seededRandom(42)};
console.log(value);{ strength: 'greedy', random: [Function (anonymous)] }What it prints (run when this page was built)