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 · Gem Swap

GemSwapLessonSteptype

One bilingual native lesson instruction and the corresponding action or tick step.

Import it

import type { GemSwapLessonStep } from "@johnmorrisdotca/houseki/gem-swap";

Definition

type GemSwapLessonStep = {
    readonly kind: 'action';
    readonly id: string;
    readonly action: Action;
    readonly accepted: boolean;
    readonly reason?: string;
    readonly event?: string;
    readonly cell?: number;
    readonly text: {
        readonly en: string;
        readonly ja: string;
    };
} | {
    readonly kind: 'ticks';
    readonly id: string;
    readonly count: number;
    readonly event?: string;
    readonly outcome?: string;
    readonly cell?: number;
    readonly text: {
        readonly en: string;
        readonly ja: string;
    };
};

Examples

import type { GemSwapLessonStep } from "@johnmorrisdotca/houseki/gem-swap";
import { GEM_SWAP_LESSONS } from "@johnmorrisdotca/houseki/gem-swap";

const value: GemSwapLessonStep = GEM_SWAP_LESSONS[0].steps[0];
console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
[ 'kind', 'id', 'action', 'accepted', 'reason', 'text' ]

What it prints (run when this page was built)

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