decodeGamefunction
Replays and validates a bounded save, then verifies its checkpoint against the derived state.
Import it
import { decodeGame } from "@johnmorrisdotca/houseki/falling-triplets";
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
Replays and validates a bounded save, then verifies its checkpoint against the derived state.
Examples
import { createGame, decodeGame, encodeGame } from "@johnmorrisdotca/houseki/falling-triplets";
const state=createGame({seed:"docs"});
console.log(decodeGame(encodeGame(state)).phase);fallingWhat it prints (run when this page was built)