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 · Falling Triplets

ChallengeOptionstype

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

Import it

import type { ChallengeOptions } from "@johnmorrisdotca/houseki/falling-triplets";

Definition

interface ChallengeOptions {
    readonly seed?: string;
    readonly width?: number;
    readonly height?: number;
    readonly colourCount?: 4 | 5 | 6;
    readonly board: readonly (Gem | null)[];
    readonly queue: readonly Triplet[];
    readonly goal: ChallengeGoal;
    readonly witness?: readonly ChallengeHint[];
}

Members

NameTypeDescription
seed (optional)string | undefined
width (optional)number | undefined
height (optional)number | undefined
colourCount (optional)4 | 5 | 6 | undefined
boardreadonly (Gem | null)[]
queuereadonly Triplet[]
goalChallengeGoal
witness (optional)readonly ChallengeHint[] | undefined

Examples

import { createGame } from "@johnmorrisdotca/houseki/falling-triplets";
import type { ChallengeOptions } from "@johnmorrisdotca/houseki/falling-triplets";

const state=createGame({seed:"docs"});
const value: ChallengeOptions = {width:6,height:12,board:state.board,queue:[["red","green","blue"]],goal:{type:"empty"}};
console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
[ 'width', 'height', 'board', 'queue', 'goal' ]

What it prints (run when this page was built)

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