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

ChallengeSettingstype

The fixed Falling Triplets challenge settings with the original board and finite triplet queue.

Import it

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

Definition

interface ChallengeSettings extends Settings {
    readonly mode: 'challenge';
    readonly goal: ChallengeGoal['type'];
    readonly challengeBoard: readonly (Gem | null)[];
    readonly challengeQueue: readonly Triplet[];
}

Members

NameTypeDescription
mode"challenge"
goal"targets" | "chain" | "empty"
challengeBoardreadonly (Gem | null)[]
challengeQueuereadonly Triplet[]
widthnumber
heightnumber
colourCount4 | 5 | 6
seedstring
pieceLimit (optional)number | undefined
targetIds (optional)readonly number[] | undefined
minimumChain (optional)number | undefined
witness (optional)readonly ChallengeHint[] | undefined

Examples

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

const state=createGame({seed:"docs"});
const value: ChallengeSettings = {...state.settings,mode:"challenge",goal:"empty",challengeBoard:state.board,challengeQueue:[["red","green","blue"]]};
console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
[ 'mode', 'width', 'height', 'colourCount', 'seed', 'goal' ]

What it prints (run when this page was built)

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