Reference · Shizen and Arashi environments
applyMagneticPulsefunction
Apply one attraction pulse. Disabled nature rules preserve the exact state reference and consume no random state.
Import it
import { applyMagneticPulse } from "@johnmorrisdotca/houseki/nature";
Definition
function applyMagneticPulse(state: NatureState): NatureTransition
Parameters
| Name | Type | Description |
|---|---|---|
state | NatureState | The immutable native state to read or transition; the input is retained. |
Returns
NatureTransition
Apply one attraction pulse. Disabled nature rules preserve the exact state reference and consume no random state.
Examples
import { applyMagneticPulse, createNatureState } from "@johnmorrisdotca/houseki/nature";
const state=createNatureState({width:4,height:4,seed:"docs"});
console.log(applyMagneticPulse(state).accepted);trueWhat it prints (run when this page was built)