restartGamefunction
Starts a fresh attempt from the identical seeded board or preserved challenge definition.
Import it
import { restartGame } from "@johnmorrisdotca/houseki/stone-collapse";
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 a fresh attempt from the identical seeded board or preserved challenge definition.
Examples
import { createGame, restartGame } from "@johnmorrisdotca/houseki/stone-collapse";
const state=createGame({seed:"docs"});
console.log(restartGame(state).phase);readyWhat it prints (run when this page was built)