generateKumimoji関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
MAKING A KUMIMOJI, in the browser, from a seed: the bag the game is played from, in the order its tiles come out.
A bag drawn blind from the mix can be one nobody can finish — two Q's and
no U, and every tile must be laid before the game ends. So the bag is made
the other way round: a crossword is laid first, word by word, from letters
drawn from the mix (TILE_MIX), and the bag is that crossword's tiles,
shuffled. Every bag has at least one finished grid, which is the puzzle's
solution — kept only to prove that, never shown — and a player may build
any other.
The crossword grows from a word across the middle: each next word crosses a tile already down, its new tiles touching nothing at their sides, so every run on it is a word by construction. Words are chosen to use the letters drawn from the mix, and never a letter more times than the whole set holds, so the bag reads like a handful from the full set.
With Diagonals, the crossword must read as a word along its diagonals too:
a new tile that would make a diagonal run of three or more is laid only
where that run is a word (fit), so the proof holds under the rule the
game is played by. Without, nothing about the laying changes, and a seed
deals the bag it always dealt.
Deterministic in the seed, like every generator here: two browsers in a race, or one tomorrow, deal the same bag in the same order.
インポート
import { generateKumimoji } from "@johnmorrisdotca/kumimoji";
定義
function generateKumimoji(size: number, level: KumimojiLevel, seed: number, options?: KumimojiOptions): KumimojiDeal
引数
| 名前 | 型 | 説明 |
|---|---|---|
size | number | The supported initial hand size. |
level | KumimojiLevel | The difficulty that determines the wildcard allowance. |
seed | number | The numeric seed for deterministic deals or random draws. |
options (省略可) | KumimojiOptions | Native game, component or presentation options. |
戻り値
KumimojiDeal
MAKING A KUMIMOJI, in the browser, from a seed: the bag the game is played from, in the order its tiles come out.
例
import { generateKumimoji } from "@johnmorrisdotca/kumimoji";
import { loadTileWordsFromModule } from "@johnmorrisdotca/kumimoji/words";
await loadTileWordsFromModule("english");
console.log(generateKumimoji(3,"hard",44).givens);nwosy出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。