本文へ移動

Korokoroコロコロ

ダイスを組み合わせて振り、ダイス表記を読み取り、正確な確率を調べます。履歴の保存やシードを指定した再現もできます。

「コロコロ」は、小さなものが転がる様子を表す言葉です。 名前について(英語)

目次

リファレンス · ロールと正確な確率

DiceWarThrow型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

One throw of the table: everybody who had to roll, in seat order, the war it was in (0 for the round's first throw), the seats that tied for highest, and who took the stake: null where the throw was a tie and the war goes on, or the round was called off.

インポート

import type { DiceWarThrow } from "@johnmorrisdotca/korokoro";

定義

type DiceWarThrow = {
    round: number;
    war: number;
    rolls: DiceWarRoll[];
    tied: number[];
    winner: number | null;
    stake: number;
};

メンバー

名前型説明
roundnumber
warnumber
rollsDiceWarRoll[]
tiednumber[]
winnernumber | null
stakenumber

例

import type { DiceWarThrow } from "@johnmorrisdotca/korokoro";
import { startDiceWar, playDiceWar } from "@johnmorrisdotca/korokoro";
const value: DiceWarThrow = playDiceWar(startDiceWar({ players: ["One", "Two"], computers: [true, true], seed: "docs" })!, {})!.throws[0]!;
console.log(value.round);
1

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/korokoro 1.16.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。