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

TilePlaytype

A KUMIMOJI BEING PLAYED: the bag, the tiles traded back into it, how many have been taken out, the tiles on the table and the hand. Every move is a function that returns a new state and leaves the one it was given alone, the way the engine's moves are. Nothing here knows how the table is being looked at — zoom and pan are the view's (tableView.ts), never the game's.

THE BAG IS A LINE, not a heap. Its tiles come out in the order the seed dealt them (givens), and a tile traded back joins the END of the line, so the tiles still to come are always bag + returned from taken on. That keeps a game the same for everybody at a seed, trades and all, and lets a kept game be checked: what is held — hand and table — is exactly what was taken, less what was given back.

Import it

import type { TilePlay } from "@johnmorrisdotca/kumimoji";

Definition

type TilePlay = {
    bag: string;
    returned: string;
    taken: number;
    tiles: Tiles;
    hand: readonly string[];
};

Members

NameTypeDescription
bagstring

The tiles in the order they come out: the puzzle's givens.

returnedstring

Tiles traded back, in order; they come out after the bag.

takennumber

How many tiles have been taken from bag + returned.

tilesTiles

The tiles on the table, by square ("row,col").

handreadonly string[]

The hand, in the order the player keeps it.

Examples

import { deal } from "@johnmorrisdotca/kumimoji";
import type { TilePlay } from "@johnmorrisdotca/kumimoji";

const play = deal("catdog",3);
const value: TilePlay = play;
console.log(value);
{
  bag: 'catdog',
  returned: '',
  taken: 3,
  tiles: Map(0) {},
  hand: [ 'c', 'a', 't' ]
}

What it prints (run when this page was built)

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