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 · Browser table

KumimojiTableOptionstype

Optional initial game, presentation, readiness and callback choices. With nothing, it is a short English game from a hand of seven, with some wild tiles.

Import it

import type { KumimojiTableOptions } from "@johnmorrisdotca/kumimoji/ui";

Definition

type KumimojiTableOptions = {
    language?: KumimojiLanguage;
    hand?: number;
    level?: KumimojiLevel;
    gameLength?: KumimojiLength;
    diagonals?: boolean;
    seed?: number;
    onFinish?: (result: {
        deal: KumimojiDeal;
        play: TilePlay;
        elapsedMs: number;
    }) => void;
    onChange?: (saved: KumimojiSaved) => void;
    locale?: KumimojiLocale;
    strings?: Partial<KumimojiStrings>;
    theme?: Readonly<Record<string, string>>;
    cloth?: Cloth;
    keep?: boolean;
    controls?: boolean;
    saved?: KumimojiSaved;
    onError?: (error: Error) => void;
};

Members

NameTypeDescription
language (optional)KumimojiLanguage | undefined

The language of the tiles: "english" or "japanese" kana. English by default.

hand (optional)number | undefined

The opening hand: 3, 7 or 11 tiles.

level (optional)KumimojiLevel | undefined

How many of the tiles are wild: "easy" the most, "medium" some, "hard" none.

gameLength (optional)KumimojiLength | undefined

How much of the set the bag holds: "short", "medium", or "full", all 144 tiles.

diagonals (optional)boolean | undefined

Every diagonal run of three or more must be a word too.

seed (optional)number | undefined

The seed the bag is dealt from; a new one each game when absent.

onFinish (optional)((result: { deal: KumimojiDeal; play: TilePlay; elapsedMs: number; }) => void) | undefined

Told when the last tile is laid and every run is a word, with the time it took.

onChange (optional)((saved: KumimojiSaved) => void) | undefined

Told after every change to the game, with the game as it would be saved.

locale (optional)KumimojiLocale | undefined

The language of the table's words, which is not the language of the tiles: "en" or "ja". By default the page's own (<html lang>), and English for any other.

strings (optional)Partial<KumimojiStrings> | undefined

Words of your own, laid over the locale's: any of KumimojiStrings.

theme (optional)Readonly<Record<string, string>> | undefined

CSS variables set on the table itself, which win in light and dark alike: { "--km-felt": "#23405a" }.

cloth (optional)"green" | "blue" | "red" | "black" | "wood" | undefined

The cloth the table is laid in: "green", "blue", "red", "black" or "wood", the family's five. theme is laid over it.

keep (optional)boolean | undefined

Whether the table offers saving and loading. True by default.

controls (optional)boolean | undefined

Show native play-action buttons; a host hiding them supplies its own actions.

saved (optional)KumimojiSaved | undefined

A validated saved game to restore initially instead of dealing a new one.

onError (optional)((error: Error) => void) | undefined

Called after a word-list load or initial restoration fails.

Examples

import type { KumimojiTableOptions } from "@johnmorrisdotca/kumimoji/ui";
const options: KumimojiTableOptions = { hand: 7, keep: false, controls: true };
console.log(options.hand);
7

What it prints (run when this page was built)

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