encodeGamefunction
Encodes the canonical initial configuration, accepted replay actions, and a derived checkpoint.
Import it
import { encodeGame } from "@johnmorrisdotca/houseki/stone-collapse";
Definition
function encodeGame(state: GameState): string
Parameters
| Name | Type | Description |
|---|---|---|
state | GameState | The immutable native state to read or transition; the input is retained. |
Returns
string
Encodes the canonical initial configuration, accepted replay actions, and a derived checkpoint.
Examples
import { createGame, encodeGame } from "@johnmorrisdotca/houseki/stone-collapse";
const state=createGame({seed:"docs"});
console.log(encodeGame(state).length);5761What it prints (run when this page was built)