Reference · Rolls and exact odds
exportedRollfunction
One roll as the JSON export writes it.
Import it
import { exportedRoll } from "@johnmorrisdotca/korokoro";
Definition
function exportedRoll(roll: Roll): ExportedRoll
Parameters
| Name | Type | Description |
|---|---|---|
roll | Roll | The completed roll to read or record. |
Returns
ExportedRoll
One roll as the JSON export writes it.
Examples
import { exportedRoll } 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(exportedRoll(sample).notation);2d6What it prints (run when this page was built)