Reference · Rules, tiles and records
isFinishedfunction
Whether the game is over: the bag empty, the hand used, and the grid sound.
Import it
import { isFinished } from "@johnmorrisdotca/kumimoji";
Definition
function isFinished(play: TilePlay, verdict: GridVerdict): boolean
Parameters
| Name | Type | Description |
|---|---|---|
play | TilePlay | The current immutable solo-game progress. |
verdict | GridVerdict | The native word and connectivity verdict for this grid. |
Returns
boolean
Whether the game is over: the bag empty, the hand used, and the grid sound.
Examples
import { loadTileWordsFromModule } from "@johnmorrisdotca/kumimoji/words";
import { deal, isFinished, judgeWithWords } from "@johnmorrisdotca/kumimoji";
const words = await loadTileWordsFromModule("english");
const play = deal("catdog",3);
const verdict = judgeWithWords(new Map([["0,0","c"],["0,1","a"],["0,2","t"]]),words);
console.log(isFinished(play,verdict));falseWhat it prints (run when this page was built)