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 · Colour Chains

Settingstype

Run settings fixed at game creation.

Import it

import type { Settings } from "@johnmorrisdotca/houseki/colour-chains";

Definition

interface Settings {
    readonly mode: Mode;
    readonly width: number;
    readonly height: number;
    readonly colourCount: 4 | 5 | 6;
    readonly seed: string;
    readonly date?: string;
    readonly pairLimit?: number;
    readonly nature?: true;
    readonly weather?: WeatherSchedule;
    readonly challengeId?: string;
    readonly goal?: ChallengeGoal;
    readonly initialBoard?: readonly (ChallengeGem | null)[];
    readonly queue?: readonly (readonly [
        Colour,
        Colour
    ])[];
    readonly magneticQueue?: readonly (readonly [
        boolean,
        boolean
    ])[];
    readonly witness?: readonly WitnessStep[];
}

Members

NameTypeDescription
modeMode
widthnumber
heightnumber
colourCount4 | 5 | 6
seedstring
date (optional)string | undefined
pairLimit (optional)number | undefined
nature (optional)true | undefined
weather (optional)WeatherSchedule | undefined
challengeId (optional)string | undefined
goal (optional)ChallengeGoal | undefined
initialBoard (optional)readonly (Gem | null)[] | undefined
queue (optional)readonly (readonly [Colour, Colour])[] | undefined
magneticQueue (optional)readonly (readonly [boolean, boolean])[] | undefined
witness (optional)readonly WitnessStep[] | undefined

Examples

import { createGame } from "@johnmorrisdotca/houseki/colour-chains";
import type { Settings } from "@johnmorrisdotca/houseki/colour-chains";

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.