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 · Falling Triplets

Settingstype

Validated settings fixed at native game creation.

Import it

import type { Settings } from "@johnmorrisdotca/houseki/falling-triplets";

Definition

interface Settings {
    readonly mode: Mode;
    readonly width: number;
    readonly height: number;
    readonly colourCount: 4 | 5 | 6;
    readonly seed: string;
    readonly pieceLimit?: number;
    readonly goal?: 'targets' | 'chain' | 'empty';
    readonly targetIds?: readonly number[];
    readonly minimumChain?: number;
    readonly challengeBoard?: readonly (Gem | null)[];
    readonly challengeQueue?: readonly Triplet[];
    readonly witness?: readonly ChallengeHint[];
}

Members

NameTypeDescription
modeMode
widthnumber
heightnumber
colourCount4 | 5 | 6
seedstring
pieceLimit (optional)number | undefined
goal (optional)"targets" | "chain" | "empty" | undefined
targetIds (optional)readonly number[] | undefined
minimumChain (optional)number | undefined
challengeBoard (optional)readonly (Gem | null)[] | undefined
challengeQueue (optional)readonly Triplet[] | undefined
witness (optional)readonly ChallengeHint[] | undefined

Examples

import { createGame } from "@johnmorrisdotca/houseki/falling-triplets";
import type { Settings } from "@johnmorrisdotca/houseki/falling-triplets";

const state=createGame({seed:"docs"});
const value: Settings = state.settings;
console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
[ 'mode', 'width', 'height', 'colourCount', 'seed' ]

What it prints (run when this page was built)

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