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 · Gem Swap

CreateOptionstype

Creation settings for this native engine; dimensions, mode, seed and optional mechanics are validated together.

Import it

import type { CreateOptions } from "@johnmorrisdotca/houseki/gem-swap";

Definition

interface CreateOptions {
    readonly preset?: BoardPreset;
    readonly width?: number;
    readonly height?: number;
    readonly colourCount?: 4 | 5 | 6;
    readonly seed?: string | number;
    readonly tools?: boolean;
    readonly advancedTools?: boolean;
    readonly shape?: BoardShape;
    readonly mask?: readonly boolean[];
    readonly mode?: GameMode;
    readonly dailyDate?: string;
    readonly challenge?: ChallengeRules;
}

Members

NameTypeDescription
preset (optional)BoardPreset | undefined
width (optional)number | undefined
height (optional)number | undefined
colourCount (optional)4 | 5 | 6 | undefined
seed (optional)string | number | undefined
tools (optional)boolean | undefined
advancedTools (optional)boolean | undefined
shape (optional)BoardShape | undefined
mask (optional)readonly boolean[] | undefined

Row-major active-cell mask. Requires explicit custom dimensions.

mode (optional)GameMode | undefined
dailyDate (optional)string | undefined

Required for Daily; a UTC calendar date in YYYY-MM-DD form.

challenge (optional)ChallengeRules | undefined

Challenge-only finite goals and optional legal-swap budget.

Examples

import type { CreateOptions } from "@johnmorrisdotca/houseki/gem-swap";

const value: CreateOptions = {seed:"docs"};
console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
[ 'seed' ]

What it prints (run when this page was built)

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