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

Getting started

Getting started

Choose one native engine and inspect a deterministic transition.

Start a seeded run

import { fallingTriplets } from "@johnmorrisdotca/houseki";
const state=fallingTriplets.createGame({seed:"small-example"});
const moved=fallingTriplets.applyAction(state,{kind:"left"});
console.log(state.phase,moved.accepted,moved.state.active?.x);
falling true 2

The main entry exposes six namespaces. Five are games: Falling Triplets, Colour Chains, Stone Collapse, Gem Swap and Magnetic Blocks. nature is their reusable magnetic/rebound/weather core. Each game keeps its own native state, actions and settings; they are not interchangeable.

Import one engine

import { createGame,statusOf } from "@johnmorrisdotca/houseki/gem-swap";
console.log(statusOf(createGame({seed:"small-example"})).legalMoveCount);
16

The seven original entry points stay intact. An npm alias changes the name in your import, not the engine API. Continue with falling games, full boards or a host UI. No DOM or browser is required by these engine imports.

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