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;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
sides | Sides | The kind of die counted. |
counts | number[] | 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. |
dice | number | How many dice of this kind were thrown. |
fairness | number | 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 ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。