Skip to the content

Kumimoji組み文字

Build crosswords from seeded English or Japanese tile bags, alone or at a shared table.

Kumimoji means assembled characters in Japanese. About the name

Contents

Reference · Rules, tiles and records

bestLayingfunction

THE COMPUTER'S NEXT WORD: its play after laying the best word its hand can lay on its table, and the word, or null when there is none. The grid after it is judged against the list, by the game's rules (rules), and is always sound.

Import it

import { bestLaying } from "@johnmorrisdotca/kumimoji";

Definition

function bestLaying(play: TilePlay, words: TileWords, rules?: GridRules): { play: TilePlay; word: string; } | null

Parameters

NameTypeDescription
playTilePlay

The current immutable solo-game progress.

wordsTileWords

The loaded native language word list and tile mappings.

rules (optional)GridRules

Whether diagonal runs are also judged.

Returns

{ play: TilePlay; word: string; } | null

THE COMPUTER'S NEXT WORD: its play after laying the best word its hand can lay on its table, and the word, or null when there is none. The grid after it is judged against the list, by the game's rules (rules), and is always sound.

Examples

import { loadTileWordsFromModule } from "@johnmorrisdotca/kumimoji/words";
import { bestLaying, deal } from "@johnmorrisdotca/kumimoji";

const words = await loadTileWordsFromModule("english");
const play = deal("catdog",3);
console.log(bestLaying(play,words)?.word);
act

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kumimoji 1.6.0.