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

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

21.8 kB minified and gzipped, with everything it imports (measured with esbuild)

Exports

NameKindWhat it is
ActiontypeA native player action accepted or rejected according to the current phase and rules.
actionsForTickfunctionResolves canonical actions in the design's per-tick order.
advanceTicksfunctionAdvances fixed 60 Hz game ticks.
applyActionfunctionApplies and records one immutable action; rejected actions preserve state identity.
CampaignLeveltypeOne authored native challenge with its stable id, setup, winning witness, measurements and review status.
campaignManifestconstantThe frozen native campaign manifest with its ordering, revisions, checksum and measured levels.
CampaignManifesttypeThe ordered native campaign, its generation/grading revisions, checksum and measured levels.
ChallengeGoaltypeA native authored challenge objective; its discriminant selects target, chain, empty-board or score requirements.
ChallengeGoalChaintypeA Falling Triplets objective requiring at least the supplied chain depth.
ChallengeGoalEmptytypeA Falling Triplets objective requiring an empty board.
ChallengeGoalTargetstypeA Falling Triplets objective requiring the supplied stable target ids to be cleared.
ChallengeHinttypeOne witnessed Falling Triplets placement with a column and cycle orientation.
ChallengeOptionstypeAuthored challenge inputs including the starting board, finite goal and supplied witness.
ChallengeSettingstypeThe fixed Falling Triplets challenge settings with the original board and finite triplet queue.
ColourtypeA gem colour ID.
compactBoardfunctionCompacts each column downward while preserving the top-to-bottom order of survivors.
createChallengefunctionCreates a challenge after validating its authored board, finite queue, goal, and witness.
createGamefunctionCreates a deterministic empty game with an active piece and three-piece preview.
createInputSchedulerfunctionCreates an empty fixed-tick input scheduler state.
createLevelfunctionConstruct a fresh validated challenge state for a stable level ID or display number.
CreateOptionstypeCreation settings for this native engine; dimensions, mode, seed and optional mechanics are validated together.
decodeGamefunctionReplays and validates a bounded save, then verifies its checkpoint against the derived state.
DifficultyMetricstypeThe bounded engine measurements used to grade this campaign; they do not claim human difficulty.
encodeGamefunctionEncodes the authoritative settings, action recording, and derived checkpoint.
findMatchesfunctionFinds the union of every maximal horizontal, vertical, and diagonal run of at least three.
GameEventtypeAn event emitted by one native transition; type selects the event’s additional fields.
GameStatetypeThe immutable authoritative native game state, including its board, random state and recording.
GemtypeA settled or active gem with a stable run-local identity.
getLevelfunctionFind a level by stable content ID or its current one-based display number.
getTutorialfunctionFind a lesson by its persistent ID.
landingYfunctionReturns the exact landing row for the current rigid triplet.
legalActionsfunctionLists the core actions currently available to the player.
levelManifestconstantThe frozen ordered native levels; array indices start at zero and display numbers start at one.
LocalizedTexttypeOne authored text in English and Japanese.
ModetypeThe native game mode; authored challenges have fixed setup and queue rules.
nextIntfunctionDraws an unbiased integer and updated state using rejection sampling.
nextUint32functionAdvances the reference xorshift32 source.
PhasetypeThe native falling, resolution, pause and ending phases.
PiecetypeThe native falling triplet with stable gem ids, orientation, descent and lock counters.
queueInputEdgefunctionQueues a one-shot cycle, drop, or pause edge for the next logical tick.
RecordedActiontypeOne accepted canonical action and its logical tick position.
releaseAllActionsfunctionReleases every held action after blur, pause, or pointer cancellation.
restartGamefunctionRecreates the same authored mode, seed, and challenge configuration from its original setup.
seedStatefunctionHashes a string seed with UTF-8 FNV-1a and returns a nonzero uint32 state.
setHeldActionfunctionStarts or releases one held action; opposite lateral holds cancel during scheduling.
SettingstypeValidated settings fixed at native game creation.
statusOffunctionReturns a plain status summary suitable for UI labels.
TransitiontypeThe resulting native state, emitted events and acceptance decision; rejected actions preserve the input.
TriplettypeThree ordered gem colours composing one falling triplet.
TutorialDefinitiontypeOne bilingual native lesson with its authored setup, teaching steps and winning witness.
tutorialManifestconstantThe frozen native bilingual lessons and their authored teaching steps.
TutorialSteptypeOne bilingual native lesson instruction and the corresponding action or tick step.
WavetypeOne simultaneous native match wave, its cleared cells and chain score.

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