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

GameStatetype

The whole of a game, returned new by every move: nothing in it is changed in place.

Import it

import type { GameState } from "@johnmorrisdotca/houseki/tsumiki";

Definition

interface GameState {
    readonly game: "tsumiki";
    readonly settings: GameSettings;
    readonly board: readonly (Block | null)[];
    readonly tray: readonly (Piece | null)[];
    readonly phase: GamePhase;
    readonly score: number;
    readonly lines: number;
    readonly moves: number;
    readonly streak: number;
    readonly nextId: number;
    readonly random: number;
    readonly history: readonly Action[];
}

Members

NameTypeDescription
game"tsumiki"
settingsGameSettings
boardreadonly (Block | null)[]
trayreadonly (Piece | null)[]
phaseGamePhase
scorenumber
linesnumber
movesnumber
streaknumber

How many placements in a row have cleared something.

nextIdnumber
randomnumber
historyreadonly Action[]

Examples

import { createGame } from "@johnmorrisdotca/houseki/tsumiki";
import type { GameState } from "@johnmorrisdotca/houseki/tsumiki";

const value: GameState = createGame({ seed: "demo" });
console.log(value.tray.length);
3

What it prints (run when this page was built)

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