本文へ移動

Korokoroコロコロ

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

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

目次

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

FaceStats型

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

How often each face of one kind of die came up, and whether that looks fair.

インポート

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

定義

type FaceStats = {
    sides: Sides;
    counts: number[];
    dice: number;
    fairness: number | null;
    labels?: string[];
    loaded?: true;
};

メンバー

名前型説明
sidesSides

The kind of die counted.

countsnumber[]

counts[i] is how often the die's i-th face came up, from its lowest: every die thrown, a rerolled one and an explosion's included.

dicenumber

How many dice of this kind were thrown.

fairnessnumber | null

Chance a fair die strays this far or further. Null until there are enough throws to ask.

labels (省略可)string[] | undefined

What each face says, on a custom die. Left out otherwise.

loaded (省略可)true | undefined

True when the die counted is a loaded one. Left out otherwise.

例

import type { FaceStats } from "@johnmorrisdotca/korokoro";
import { faceStats } from "@johnmorrisdotca/korokoro";
const value: FaceStats = faceStats([], 6);
console.log(value.counts);
[ 0, 0, 0, 0, 0, 0 ]

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

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

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