Reference · Rules, tiles and records
runsOffunction
Every run the grid is read by: two or more tiles across, then down, and with Diagonals three or more down to the right, then down to the left. A tile with nothing beside it in a line is no run.
Import it
import { runsOf } from "@johnmorrisdotca/kumimoji";
Definition
function runsOf(tiles: Tiles, rules?: GridRules): Run[]
Parameters
| Name | Type | Description |
|---|---|---|
tiles | Tiles | The map from row,column square names to internal tile codes. |
rules (optional) | GridRules | Whether diagonal runs are also judged. |
Returns
Run[]
Every run the grid is read by: two or more tiles across, then down, and with Diagonals three or more down to the right, then down to the left. A tile with nothing beside it in a line is no run.
Examples
import { runsOf } from "@johnmorrisdotca/kumimoji";
const tiles = new Map([["0,0","c"],["0,1","a"],["0,2","t"]]);
console.log(runsOf(tiles));[ { word: 'cat', squares: [ '0,0', '0,1', '0,2' ], line: 'across' } ]What it prints (run when this page was built)