Reference · Rules, tiles and records
checkKumimojifunction
WHETHER A GRID FINISHES A KUMIMOJI: the one check the server also runs. O(squares) and a lookup a word, nothing searched: the grid uses exactly the tiles of the bag, as many of each, it is all one piece, and every run of two or more across or down is in the list — and, for a game set up with Diagonals, every run of three or more along a diagonal. Which tiles were traded on the way does not matter — a finished game holds the whole bag whatever came out of it when — so the answer is the grid alone.
Written out here rather than asked of the play page, which is what made the
grid; the list must have been loaded (loadTileWords), and a check that
cannot read it refuses.
Import it
import { checkKumimoji } from "@johnmorrisdotca/kumimoji";
Definition
function checkKumimoji(size: number, givens: string, answer: string, options?: KumimojiOptions & { level?: KumimojiLevel; }): KumimojiCheck
Parameters
| Name | Type | Description |
|---|---|---|
size | number | The supported initial hand size. |
givens | string | The original bag of internal tile codes. |
answer | string | The encoded completed grid to verify. |
options (optional) | KumimojiOptions & { level?: KumimojiLevel; } | Native game, component or presentation options. |
Returns
KumimojiCheck
WHETHER A GRID FINISHES A KUMIMOJI: the one check the server also runs. O(squares) and a lookup a word, nothing searched: the grid uses exactly the tiles of the bag, as many of each, it is all one piece, and every run of two or more across or down is in the list — and, for a game set up with Diagonals, every run of three or more along a diagonal. Which tiles were traded on the way does not matter — a finished game holds the whole bag whatever came out of it when — so the answer is the grid alone.
Examples
import { checkKumimoji } from "@johnmorrisdotca/kumimoji";
import { loadTileWordsFromModule } from "@johnmorrisdotca/kumimoji/words";
await loadTileWordsFromModule("english");
console.log(checkKumimoji(3,"cat","cat",{level:"hard"}));{
ok: false,
reason: 'the givens are not a bag of tiles',
code: 'givens-not-bag'
}What it prints (run when this page was built)