Reference · Rules, solvers and generation
explosionsAsChosenfunction
A level's explosions as the player chose to play them at set-up: as made,
SOFTENED — a boom in place of a blast, and half as often — or OFF. John's
row: "a set-up option to soften or switch them off". Either way the solve is
kept as helped (solveHelp.ts).
Import it
import { explosionsAsChosen } from "@johnmorrisdotca/tsunagi";
Definition
function explosionsAsChosen(rule: LinkLayout["explosions"], choice: "on" | "soft" | "off"): LinkLayout["explosions"]
Parameters
| Name | Type | Description |
|---|---|---|
rule | { every: number; blast: boolean; } | null | The stored explosion rule, or null when none. |
choice | "soft" | "on" | "off" | The selected native explosion mode. |
Returns
{ every: number; blast: boolean; } | null
The selected explosion rule, or null when explosions are absent or disabled.
Examples
import { explosionsAsChosen } from "@johnmorrisdotca/tsunagi";
console.log(explosionsAsChosen({every:5,blast:true},"soft"));{ every: 10, blast: false }What it prints (run when this page was built)