Skip to the content

Korokoroコロコロ

Roll mixed dice or type notation, compare exact probabilities, keep a history and replay seeded rolls.

Korokoro describes something small rolling in Japanese. About the name

Contents

Reference · Rolls and exact odds

faceChancesfunction

Every face of one die of a group with its chance, beside the fair die's. For a custom die of words this is its odds: the faces have no total to have odds of.

Import it

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

Definition

function faceChances(group: DiceGroup): FaceChance[]

Parameters

NameTypeDescription
groupDiceGroup

One kind of dice and its rules.

Returns

FaceChance[]

Every face of one die of a group with its chance, beside the fair die's. For a custom die of words this is its odds: the faces have no total to have odds of.

Examples

import { faceChances } from "@johnmorrisdotca/korokoro";
import { normalizeSpec } from "@johnmorrisdotca/korokoro";
const spec = normalizeSpec({ count: 2, sides: 6 });
console.log(faceChances(spec)[0]);
{
  face: 1,
  label: '1',
  chance: 0.16666666666666666,
  fair: 0.16666666666666666
}

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/korokoro 1.16.0.