blockCellsfunction
Returns stable-gem addresses after rotating the square block around its centre.
Import it
import { blockCells } from "@johnmorrisdotca/houseki/magnetic-blocks";
Definition
function blockCells(block: Block, width: number): readonly { readonly index: number; readonly gem: Gem; }[]
Parameters
| Name | Type | Description |
|---|---|---|
block | Block | The native active 2×2 block and its stable gem ids. |
width | number | The native board width in cells. |
Returns
readonly { readonly index: number; readonly gem: Gem; }[]
Returns stable-gem addresses after rotating the square block around its centre.
Examples
import { blockCells, createGame } from "@johnmorrisdotca/houseki/magnetic-blocks";
const state=createGame({seed:"docs"});
console.log(blockCells(state.active!,state.settings.width).length);4What it prints (run when this page was built)