boardModelfunction
THE PART OF THE TABLE TO DRAW, for a grid and its verdict: the tiles and a
margin round them, at least BOARD_LEAST a side, each square with its tile,
what is printed on it, and how it stands. Row by row, left to right. The
grid itself has no edges; this is only the window a board shows it through.
Import it
import { boardModel } from "@johnmorrisdotca/kumimoji/ui";
Definition
function boardModel(tiles: Tiles, verdict: GridVerdict | null, glyphOf?: (tile: string) => string): BoardModel
Parameters
| Name | Type | Description |
|---|---|---|
tiles | Tiles | The map from row,column square names to internal tile codes. |
verdict | GridVerdict | null | The native word and connectivity verdict for this grid. |
glyphOf (optional) | (tile: string) => string | The function that renders an internal tile code as a visible glyph. |
Returns
BoardModel
THE PART OF THE TABLE TO DRAW, for a grid and its verdict: the tiles and a margin round them, at least BOARD_LEAST a side, each square with its tile, what is printed on it, and how it stands. Row by row, left to right. The grid itself has no edges; this is only the window a board shows it through.
Examples
import { boardModel } from "@johnmorrisdotca/kumimoji/ui";
const tiles = new Map([["0,0","c"],["0,1","a"],["0,2","t"]]);
console.log(boardModel(tiles,null).squares.length);49What it prints (run when this page was built)