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

diceCountfunction

How many dice a roll asks for, over all its kinds.

Import it

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

Definition

function diceCount(spec: RollSpec): number

Parameters

NameTypeDescription
specRollSpec

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

Returns

number

How many dice a roll asks for, over all its kinds.

Examples

import { diceCount } from "@johnmorrisdotca/korokoro";
import { parseNotation } from "@johnmorrisdotca/korokoro";
console.log(diceCount(parseNotation("2d6+1d8")!));
3

What it prints (run when this page was built)

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