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 · Stone Collapse

ChallengeOptionstype

Authored challenge inputs including the starting board, finite goal and supplied witness.

Import it

import type { ChallengeOptions } from "@johnmorrisdotca/houseki/stone-collapse";

Definition

interface ChallengeOptions {
    readonly id: string;
    readonly width: number;
    readonly height: number;
    readonly colourCount: 4 | 5 | 6;
    readonly seed?: string | number;
    readonly mask?: readonly boolean[];
    readonly initialBoard: readonly (Stone | null)[];
    readonly goal: ChallengeGoal;
    readonly moveLimit?: number;
    readonly witness: readonly (readonly number[])[];
}

Members

NameTypeDescription
idstring
widthnumber
heightnumber
colourCount4 | 5 | 6
seed (optional)string | number | undefined
mask (optional)readonly boolean[] | undefined
initialBoardreadonly (Stone | null)[]
goalChallengeGoal
moveLimit (optional)number | undefined
witnessreadonly (readonly number[])[]

Examples

import { createGame } from "@johnmorrisdotca/houseki/stone-collapse";
import type { ChallengeOptions } from "@johnmorrisdotca/houseki/stone-collapse";

const state=createGame({seed:"docs"});
const value: ChallengeOptions = {id:"docs",width:6,height:6,colourCount:4,initialBoard:state.board,goal:{kind:"clear-all"},witness:[]};
console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
[ 'id', 'width', 'height', 'colourCount', 'initialBoard', 'goal' ]

What it prints (run when this page was built)

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