encodeGamefunction
Encodes the initial rules plus accepted actions and logical inputs in canonical JSON.
Import it
import { encodeGame } from "@johnmorrisdotca/houseki/gem-swap";
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 initial rules plus accepted actions and logical inputs in canonical JSON.
Examples
import { createGame, encodeGame } from "@johnmorrisdotca/houseki/gem-swap";
const state=createGame({seed:"docs"});
console.log(encodeGame(state).length);474What it prints (run when this page was built)