Reference · Rules, tiles and records
wordsInHandfunction
The words the hand's own tiles spell, longest first and then in the list's order; wilds are not used.
Import it
import { wordsInHand } from "@johnmorrisdotca/kumimoji";
Definition
function wordsInHand(hand: readonly string[], words: TileWords): string[]
Parameters
| Name | Type | Description |
|---|---|---|
hand | readonly string[] | The hand size or tile codes, as declared by the function signature. |
words | TileWords | The loaded native language word list and tile mappings. |
Returns
string[]
The words the hand's own tiles spell, longest first and then in the list's order; wilds are not used.
Examples
import { loadTileWordsFromModule } from "@johnmorrisdotca/kumimoji/words";
import { wordsInHand } from "@johnmorrisdotca/kumimoji";
const words = await loadTileWordsFromModule("english");
console.log(wordsInHand(["c","a","t"],words));[ 'act', 'cat', 'at', 'ta' ]What it prints (run when this page was built)