Reference · Rolls and exact odds
soundMathfunction
A formula given by hand, checked for its shape alone: the nodes are what they say they are. Undefined when it is not a formula.
Import it
import { soundMath } from "@johnmorrisdotca/korokoro";
Definition
function soundMath(given: unknown, depth?: number): MathNode | undefined
Parameters
| Name | Type | Description |
|---|---|---|
given | unknown | The candidate arithmetic tree to validate. |
depth (optional) | number | The current recursive depth; normally omitted. |
Returns
MathNode | undefined
A formula given by hand, checked for its shape alone: the nodes are what they say they are. undefined when it is not a formula.
Examples
import { soundMath } from "@johnmorrisdotca/korokoro";
console.log(soundMath({ kind: "dice", group: 0 }));{ kind: 'dice', group: 0 }What it prints (run when this page was built)