awaseRulesfunction
The rules a game is played by. A challenge sets its own; the options given are laid over what it allows, and where a
challenge takes something away (undo in the spark and blackout) it stays taken away. tiles is how many tiles the
layout holds, which the clocks and goals are scaled by.
Import it
import { awaseRules } from "@johnmorrisdotca/jarajara/awase";
Definition
function awaseRules(tiles: number, options?: AwaseOptions): AwaseRules
Parameters
| Name | Type | Description |
|---|---|---|
tiles | number | The number of tiles in the starting layout. |
options (optional) | AwaseOptions | Native game, SVG, sound or presentation options. |
Returns
AwaseRules
The rules a game is played by. A challenge sets its own; the options given are laid over what it allows, and where a challenge takes something away (undo in the spark and blackout) it stays taken away. tiles is how many tiles the layout holds, which the clocks and goals are scaled by.
Examples
import { awaseRules, generateAwase } from "@johnmorrisdotca/jarajara/awase";
const deal = generateAwase(4,"easy",2026);
const cells = deal.givens;
console.log(awaseRules(cells.length,{challenge:"rush"}));{
challenge: 'rush',
hints: null,
shuffles: null,
undo: true,
timeMs: 180000,
reserveMs: null,
pairBonusMs: 0,
sparkBonusMs: 0,
comboBonusMs: 0,
goalPairs: 2,
goalScore: null,
hideBlocked: false
}What it prints (run when this page was built)