checkMath関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Whether a formula can be used with kinds of dice whose totals run over these ranges: the problem, or null when there is none. It has to name each kind exactly once (so the kinds stay independent and the odds exact), come to a whole number, never divide by nothing, and stay small enough to count.
インポート
import { checkMath } from "@johnmorrisdotca/korokoro";
定義
function checkMath(node: MathNode, ranges: readonly { min: number; max: number; }[]): MathProblem | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
node | MathNode | The arithmetic expression tree. |
ranges | readonly { min: number; max: number; }[] | The minimum and maximum for each dice group. |
戻り値
MathProblem | null
Whether a formula can be used with kinds of dice whose totals run over these ranges: the problem, or null when there is none. It has to name each kind exactly once (so the kinds stay independent and the odds exact), come to a whole number, never divide by nothing, and stay small enough to count.
例
import { checkMath } from "@johnmorrisdotca/korokoro";
console.log(checkMath({ kind: "dice", group: 0 }, [{ min: 1, max: 6 }]));null出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。