Skip to the content

Houseki宝石

Run five native gem and stone engines, play measured challenges and lessons, and save deterministic games.

Houseki (宝石) is Japanese for a gem or precious stone. About the name

Contents

Reference · Tsumiki

encodeGamefunction

A game as text: what it was and the moves made, never the score or the board, which a replay works out.

Import it

import { encodeGame } from "@johnmorrisdotca/houseki/tsumiki";

Definition

function encodeGame(state: GameState): string

Parameters

NameTypeDescription
stateGameState

The game to keep.

Returns

string

Text that decodeGame reads back to this state.

Examples

import { createGame, encodeGame } from "@johnmorrisdotca/houseki/tsumiki";
console.log(encodeGame(createGame({ seed: "demo" })).length > 0);
true

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/houseki 0.5.0.