Reference · Rolls and exact odds
resultTextfunction
A roll's result as it would be said: its total, or for dice that are only words, the words.
Import it
import { resultText } from "@johnmorrisdotca/korokoro";
Definition
function resultText(roll: Roll): string
Parameters
| Name | Type | Description |
|---|---|---|
roll | Roll | The completed roll to read or record. |
Returns
string
A roll's result as it would be said: its total, or for dice that are only words, the words.
Examples
import { resultText } 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(resultText(sample));7What it prints (run when this page was built)