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

valueOfFacefunction

What a face of a group's die is worth in a total: its number, or for a custom face its value, which is 0 when it is only words.

Import it

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

Definition

function valueOfFace(group: DiceGroup, face: number): number

Parameters

NameTypeDescription
groupDiceGroup

One kind of dice and its rules.

facenumber

The physical face value to display or read.

Returns

number

What a face of a group's die is worth in a total: its number, or for a custom face its value, which is 0 when it is only words.

Examples

import { valueOfFace } from "@johnmorrisdotca/korokoro";
import { normalizeSpec } from "@johnmorrisdotca/korokoro";
const spec = normalizeSpec({ count: 2, sides: 6 });
console.log(valueOfFace(spec, 4));
4

What it prints (run when this page was built)

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