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 · Colour Chains

ChallengeOptionstype

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

Import it

import type { ChallengeOptions } from "@johnmorrisdotca/houseki/colour-chains";

Definition

interface ChallengeOptions {
    readonly id: string;
    readonly width?: number;
    readonly height?: number;
    readonly colourCount?: 4 | 5 | 6;
    readonly seed?: string;
    readonly board: readonly (ChallengeGem | null)[];
    readonly queue: readonly (readonly [
        Colour,
        Colour
    ])[];
    readonly magneticQueue?: readonly (readonly [
        boolean,
        boolean
    ])[];
    readonly nature?: boolean;
    readonly weather?: WeatherSchedule;
    readonly goal: ChallengeGoal;
    readonly witness?: readonly WitnessStep[];
}

Members

NameTypeDescription
idstring
width (optional)number | undefined
height (optional)number | undefined
colourCount (optional)4 | 5 | 6 | undefined
seed (optional)string | undefined
boardreadonly (Gem | null)[]
queuereadonly (readonly [Colour, Colour])[]
magneticQueue (optional)readonly (readonly [boolean, boolean])[] | undefined
nature (optional)boolean | undefined
weather (optional)WeatherSchedule | undefined
goalChallengeGoal
witness (optional)readonly WitnessStep[] | undefined

Examples

import { createGame } from "@johnmorrisdotca/houseki/colour-chains";
import type { ChallengeOptions } from "@johnmorrisdotca/houseki/colour-chains";

const state=createGame({seed:"docs"});
const value: ChallengeOptions = {id:"docs",board:state.board,queue:[["red","green"]],goal:{kind:"empty-board"}};
console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
[ 'id', '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.