freshAwaseSeedfunction
A new seed for a deal under this rule: inside AWASE_SAME_BLOCK for the identical rule, anywhere else from 1 to
SEED_MOST for the usual one. draw gives a seed for the usual rule (a site keeping blocks of seeds for its own
uses passes its own); a whole number from 1 to SEED_MOST unless said.
Import it
import { freshAwaseSeed } from "@johnmorrisdotca/jarajara/awase";
Definition
function freshAwaseSeed(rule: MahjongBonusRule, random?: Random, draw?: () => number): number
Parameters
| Name | Type | Description |
|---|---|---|
rule | MahjongBonusRule | Grouped or identical bonus matching. |
random (optional) | Random | A reproducible random source returning values in [0,1). |
draw (optional) | () => number | An optional function drawing a seed outside separately reserved blocks. |
Returns
number
A new seed for a deal under this rule: inside AWASE_SAME_BLOCK for the identical rule, anywhere else from 1 to SEED_MOST for the usual one. draw gives a seed for the usual rule (a site keeping blocks of seeds for its own uses passes its own); a whole number from 1 to SEED_MOST unless said.
Examples
import { freshAwaseSeed } from "@johnmorrisdotca/jarajara/awase";
import { seededRandom } from "@johnmorrisdotca/jarajara";
console.log(freshAwaseSeed("same",seededRandom(42)));1560110375What it prints (run when this page was built)