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

powerDropPreviewfunction

Returns the Shizen hard-drop landing and one-step rebound preview without changing state.

finalCells is where the pair locks after any rebound, the cells of the power-drop-landed event. Stones above a gap then fall, so settledCells is where each stone of the pair comes to rest in the board the hard drop commits, before any clear: draw a ghost from it. Both carry the pair's stable stone ids, and both are checked against applyAction with a hard-drop over many played boards.

Import it

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

Definition

function powerDropPreview(state: GameState): ChainsPowerDropPreview | null

Parameters

NameTypeDescription
stateGameState

The immutable native state to read or transition; the input is retained.

Returns

ChainsPowerDropPreview | null

Returns the Shizen hard-drop landing and one-step rebound preview without changing state. Returns null when there is no active piece or applicable preview.

Examples

import { createGame, powerDropPreview } from "@johnmorrisdotca/houseki/colour-chains";

const state=createGame({seed:"docs"});
console.log(powerDropPreview(state));
null

What it prints (run when this page was built)

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