Reference · Rolls and exact odds
diceTextfunction
The dice of a roll as plain text, in the order thrown: 6 4 2 (1).
Import it
import { diceText } from "@johnmorrisdotca/korokoro";
Definition
function diceText(roll: Roll): string
Parameters
| Name | Type | Description |
|---|---|---|
roll | Roll | The completed roll to read or record. |
Returns
string
The dice of a roll as plain text, in the order thrown: 6 4 2 (1).
Examples
import { diceText } from "@johnmorrisdotca/korokoro";
import { normalizeSpec, rollFrom } from "@johnmorrisdotca/korokoro";
const spec = normalizeSpec({ count: 2, sides: 6 });
const sample = rollFrom(spec, [2, 5], "saved", 0, null)!;
console.log(diceText(sample));2 5What it prints (run when this page was built)