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

crossingFitfunction

Where word stands with its letter at on the tile at anchor, running across or down, or null where it cannot: a square outside what may be used, a tile at either end, a different letter in its way, a new tile with a neighbour at its side, or no new tile at all — and, given diagonalWord (a game with Diagonals), a new tile standing in a diagonal run of three or more that diagonalWord does not take (diagonalsRead).

Import it

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

Definition

function crossingFit(letterAt: (row: number, col: number) => string, inside: (row: number, col: number) => boolean, word: string, anchor: Square, at: number, across: boolean, diagonalWord?: ((run: string) => boolean) | null): CrossingFit | null

Parameters

NameTypeDescription
letterAt(row: number, col: number) => string

The tile at a coordinate, or an empty string for no tile.

inside(row: number, col: number) => boolean

Whether a coordinate is within the caller’s working grid.

wordstring

The encoded word to lay or spell.

anchorSquare

The existing tile that the word crosses.

atnumber

The word offset, seat index or date specified by this signature.

acrossboolean

Whether to lay or type horizontally rather than vertically.

diagonalWord (optional)((run: string) => boolean) | null

Optional diagonal-word predicate; null disables diagonal checking.

Returns

CrossingFit | null

Where word stands with its letter at on the tile at anchor, running across or down, or null where it cannot: a square outside what may be used, a tile at either end, a different letter in its way, a new tile with a neighbour at its side, or no new tile at all — and, given diagonalWord (a game with Diagonals), a new tile standing in a diagonal run of three or more that diagonalWord does not take (diagonalsRead).

Examples

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

console.log(crossingFit((r,c)=>r===0&&c===0?"c":"",()=>true,"cat",{row:0,col:0},0,true));
{
  first: { row: 0, col: 0 },
  fresh: [ { row: 0, col: 1 }, { row: 0, col: 2 } ]
}

What it prints (run when this page was built)

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