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 · Magnetic Blocks

Settingstype

Validated settings fixed at native game creation.

Import it

import type { Settings } from "@johnmorrisdotca/houseki/magnetic-blocks";

Definition

interface Settings {
    readonly mode: Mode;
    readonly width: number;
    readonly height: number;
    readonly colourCount: 4 | 5 | 6;
    readonly seed: string | number;
    readonly mask: readonly boolean[];
    readonly schedule: FloorSchedule;
    readonly floorSwitch: boolean;
    readonly magneticImpact: boolean;
    readonly pieceLimit: number;
    readonly initialBoard: readonly (Gem | null)[];
    readonly bonds: readonly Bond[];
    readonly initialQueue?: readonly (readonly [
        Colour,
        Colour,
        Colour,
        Colour
    ])[];
    readonly goal?: Goal;
}

Members

NameTypeDescription
modeMode
widthnumber
heightnumber
colourCount4 | 5 | 6
seedstring | number
maskreadonly boolean[]
scheduleFloorSchedule
floorSwitchboolean
magneticImpactboolean
pieceLimitnumber
initialBoardreadonly (Gem | null)[]
bondsreadonly Bond[]
initialQueue (optional)readonly (readonly [Colour, Colour, Colour, Colour])[] | undefined
goal (optional)Goal | undefined

Examples

import { createGame } from "@johnmorrisdotca/houseki/magnetic-blocks";
import type { Settings } from "@johnmorrisdotca/houseki/magnetic-blocks";

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', 'mask' ]

What it prints (run when this page was built)

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