Reference · Rules, tiles and records
boundsOffunction
The rows and columns the tiles stand within, or null for no tiles.
Import it
import { boundsOf } from "@johnmorrisdotca/kumimoji";
Definition
function boundsOf(tiles: Tiles): Bounds | null
Parameters
| Name | Type | Description |
|---|---|---|
tiles | Tiles | The map from row,column square names to internal tile codes. |
Returns
Bounds | null
The rows and columns the tiles stand within, or null for no tiles.
Examples
import { boundsOf } from "@johnmorrisdotca/kumimoji";
const tiles = new Map([["0,0","c"],["0,1","a"],["0,2","t"]]);
console.log(boundsOf(tiles));{ top: 0, left: 0, bottom: 0, right: 2 }What it prints (run when this page was built)