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

hasTotalfunction

Whether a roll's total says anything. It does unless every die in it is a custom die with no numbers on it at all, such as Yes, No, Maybe: then the roll is its faces' words, and the total is 0 and means nothing.

Import it

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

Definition

function hasTotal(spec: RollSpec): boolean

Parameters

NameTypeDescription
specRollSpec

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

Returns

boolean

Whether a roll's total says anything. It does unless every die in it is a custom die with no numbers on it at all, such as Yes, No, Maybe: then the roll is its faces' words, and the total is 0 and means nothing.

Examples

import { hasTotal } from "@johnmorrisdotca/korokoro";
import { parseNotation } from "@johnmorrisdotca/korokoro";
console.log(hasTotal(parseNotation("2d[Left,Right]")!));
false

What it prints (run when this page was built)

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