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
| Name | Type | Description |
|---|---|---|
block | Block | 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);4What it prints (run when this page was built)