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 · Shizen and Arashi environments

LightningPreviewtype

A pure selected-column removal and resulting occupants/random state.

Import it

import type { LightningPreview } from "@johnmorrisdotca/houseki/nature";

Definition

interface LightningPreview {
    readonly columns: readonly number[];
    readonly removedCells: readonly number[];
    readonly removedIds: readonly number[];
    readonly cells: readonly (NatureEntity | null)[];
    readonly randomStateAfter: number;
}

Members

NameTypeDescription
columnsreadonly number[]
removedCellsreadonly number[]
removedIdsreadonly number[]
cellsreadonly (NatureEntity | null)[]
randomStateAfternumber

Examples

import { createNatureState, previewLightning } from "@johnmorrisdotca/houseki/nature";
import type { LightningPreview } from "@johnmorrisdotca/houseki/nature";

const state=createNatureState({width:4,height:4,seed:"docs"});
const value: LightningPreview = previewLightning(state,{columns:[0]});
console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
[
  'columns',
  'removedCells',
  'removedIds',
  'cells',
  'randomStateAfter'
]

What it prints (run when this page was built)

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