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 · Shizen and Arashi environments

NatureOptionstype

The native grid dimensions, passability mask, occupants, seed and magnetic/rebound settings.

Import it

import type { NatureOptions } from "@johnmorrisdotca/houseki/nature";

Definition

interface NatureOptions {
    readonly width: number;
    readonly height: number;
    readonly seed?: string;
    readonly activeCells?: readonly boolean[];
    readonly cells?: readonly (NatureEntity | null)[];
    readonly magneticEnabled?: boolean;
    readonly reboundEnabled?: boolean;
    readonly reboundDirectionMode?: ReboundDirectionMode;
}

Members

NameTypeDescription
widthnumber
heightnumber
seed (optional)string | undefined
activeCells (optional)readonly boolean[] | undefined

Row-major passability mask. False cells are permanent gaps and cannot hold pieces.

cells (optional)readonly (NatureEntity | null)[] | undefined

Row-major initial occupants; false mask cells must be empty.

magneticEnabled (optional)boolean | undefined
reboundEnabled (optional)boolean | undefined
reboundDirectionMode (optional)ReboundDirectionMode | undefined

Examples

import type { NatureOptions } from "@johnmorrisdotca/houseki/nature";

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

What it prints (run when this page was built)

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