checkKumimoji関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { checkKumimoji } from "@johnmorrisdotca/kumimoji";
定義
function checkKumimoji(size: number, givens: string, answer: string, options?: KumimojiOptions & { level?: KumimojiLevel; }): KumimojiCheck
引数
| 名前 | 型 | 説明 |
|---|---|---|
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 (省略可) | KumimojiOptions & { level?: KumimojiLevel; } | Native game, component or presentation options. |
戻り値
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.
例
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'
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。