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 · Magnetic Blocks

blockBondsfunction

List the native stable-id bonds connecting adjacent gems in the active block.

Import it

import { blockBonds } from "@johnmorrisdotca/houseki/magnetic-blocks";

Definition

function blockBonds(block: Block): readonly Bond[]

Parameters

NameTypeDescription
blockBlock

The native active 2×2 block and its stable gem ids.

Returns

readonly Bond[]

List the native stable-id bonds connecting adjacent gems in the active block.

Examples

import { blockBonds, createGame } from "@johnmorrisdotca/houseki/magnetic-blocks";

const state=createGame({seed:"docs"});
console.log(blockBonds(state.active!).length);
4

What it prints (run when this page was built)

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