Reference · Rules, tiles and records
handSpellingfunction
The hand with word's tiles first, in its order, and the rest after them as they were.
Import it
import { handSpelling } from "@johnmorrisdotca/kumimoji";
Definition
function handSpelling(play: TilePlay, word: string): TilePlay
Parameters
| Name | Type | Description |
|---|---|---|
play | TilePlay | The current immutable solo-game progress. |
word | string | The encoded word to lay or spell. |
Returns
TilePlay
The hand with word's tiles first, in its order, and the rest after them as they were.
Examples
import { deal, handSpelling } from "@johnmorrisdotca/kumimoji";
const tiles = new Map([["0,0","c"],["0,1","a"],["0,2","t"]]);
const play = deal("catdog",3);
console.log(handSpelling(play,"cat").tiles);Map(0) {}What it prints (run when this page was built)