本文へ移動

Korokoroコロコロ

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

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

目次

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

presetOdds関数

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

The exact odds of each outcome of a game's first roll: a natural in craps, each hand in chinchirorin, each result of a Risk battle. Every way the dice can fall is counted, in whole numbers. spec is the preset's own dice unless others are given (a larger pool, fewer battle dice).

Null where there is nothing to count: a reading that is only the total, whose odds distributionOf gives; a reading that depends on the order of the dice; or dice that are rerolled or explode.

インポート

import { presetOdds } from "@johnmorrisdotca/korokoro";

定義

function presetOdds(preset: Preset, spec?: RollSpec, language?: "en" | "ja"): OutcomeOdds[] | null

引数

名前型説明
presetPreset

The game preset whose dice and reading are used.

spec (省略可)RollSpec

Dice counts, sides, rules and modifier; omitted fields use the documented defaults.

language (省略可)"en" | "ja"

English or Japanese for the reading text.

戻り値

OutcomeOdds[] | null

The exact odds of each outcome of a game's first roll: a natural in craps, each hand in chinchirorin, each result of a Risk battle. Every way the dice can fall is counted, in whole numbers. spec is the preset's own dice unless others are given (a larger pool, fewer battle dice). null where there is nothing to count: a reading that is only the total, whose odds distributionOf gives; a reading that depends on the order of the dice; or dice that are rerolled or explode.

例

import { presetOdds } from "@johnmorrisdotca/korokoro";
import { getPreset } from "@johnmorrisdotca/korokoro";
const preset = getPreset("cho-han")!;
console.log(presetOdds(preset)?.map((outcome) => outcome.text));
[ 'Chō (even)', 'Han (odd)' ]

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

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

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