FaceChance型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
One face of a die and how often it comes up, beside how often it would on a fair one.
インポート
import type { FaceChance } from "@johnmorrisdotca/korokoro";
定義
type FaceChance = {
face: number;
label: string;
chance: number;
fair: number;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
face | number | The face, as a roll records it. |
label | string | What it says, on a custom die; its number otherwise. |
chance | number | Its chance on this die. |
fair | number | Its chance if every face were as likely as the next. |
例
import type { FaceChance } from "@johnmorrisdotca/korokoro";
import { DEFAULT_SPEC, faceChances } from "@johnmorrisdotca/korokoro";
const value: FaceChance = faceChances(DEFAULT_SPEC)[0]!;
console.log(value.chance);0.16666666666666666出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。