Strength型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
THE COMPUTER PLAYER, in four strengths. Each is the one before it with more care, and none of them is slow: a move takes a few milliseconds, and the strongest well under a tenth of a second in a browser.
random: any legal play, with equal chance. It never doubles, and takes every double.greedy: the play that leaves the best position by the evaluation (evaluate), looking no further.careful: weighs its best four plays by what the other side's best reply to each roll would leave.strong: the same over its best ten plays.
Doubling is simple, and works as documented in the README: in a race the
Keith count (see keithCount), where the rules are Keith's: double when the
count of the side on roll is within 4 of the other's, redouble within 3,
take when the doubler's is 2 or more above the taker's. In a position where the sides are still in
contact (careful and strong only), the evaluation is turned into a
chance of winning (winChance) and a side doubles at 70% and takes at 25%.
インポート
import type { Strength } from "@johnmorrisdotca/sugoroku";
定義
type Strength = "random" | "greedy" | "careful" | "strong";
例
import type { Strength } from "@johnmorrisdotca/sugoroku";
const value: Strength = "greedy";
console.log(value);greedy出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。