Reference · Rules, tiles and records
handCanSpellfunction
Whether a hand can spell a word from the list: any word of two tiles or more, a wild counting as able to be anything.
Import it
import { handCanSpell } from "@johnmorrisdotca/kumimoji";
Definition
function handCanSpell(hand: readonly string[], words: TileWords): boolean
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
boolean
Whether a hand can spell a word from the list: any word of two tiles or more, a wild counting as able to be anything.
Examples
import { loadTileWordsFromModule } from "@johnmorrisdotca/kumimoji/words";
import { handCanSpell } from "@johnmorrisdotca/kumimoji";
const words = await loadTileWordsFromModule("english");
console.log(handCanSpell(["c","a","t"],words));trueWhat it prints (run when this page was built)