decodeGamefunction
Reconstructs and validates a bounded replay before accepting its checkpoint.
Import it
import { decodeGame } from "@johnmorrisdotca/houseki/stone-collapse";
Definition
function decodeGame(text: string): GameState
Parameters
| Name | Type | Description |
|---|---|---|
text | string | A saved JSON recording from this entry’s encodeGame; malformed or inconsistent saves throw. |
Returns
GameState
Reconstructs and validates a bounded replay before accepting its checkpoint.
Examples
import { createGame, decodeGame, encodeGame } from "@johnmorrisdotca/houseki/stone-collapse";
const state=createGame({seed:"docs"});
console.log(decodeGame(encodeGame(state)).phase);readyWhat it prints (run when this page was built)