restartGamefunction
Starts the exact initial ruleset and seed again, discarding all run progress.
Import it
import { restartGame } from "@johnmorrisdotca/houseki/gem-swap";
Definition
function restartGame(state: GameState): GameState
Parameters
| Name | Type | Description |
|---|---|---|
state | GameState | The immutable native state to read or transition; the input is retained. |
Returns
GameState
Starts the exact initial ruleset and seed again, discarding all run progress.
Examples
import { createGame, restartGame } from "@johnmorrisdotca/houseki/gem-swap";
const state=createGame({seed:"docs"});
console.log(restartGame(state).phase);readyWhat it prints (run when this page was built)