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

diagonalsReadfunction

Whether every diagonal run a laying's new tiles would stand in is taken by isWord: each walked from its top end down, with the word's own letters on its new squares. Only a run through a new tile can change, and two new tiles of one word never share a diagonal (they share a row or a column), so each is read on its own. A run of two, a corner touch, is never read.

Import it

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

Definition

function diagonalsRead(letterAt: (row: number, col: number) => string, inside: (row: number, col: number) => boolean, word: string, fit: CrossingFit, isWord: (run: string) => boolean): boolean

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.

fitCrossingFit

The first coordinate and fresh tile coordinates of the proposed laying.

isWord(run: string) => boolean

The predicate that accepts a readable word.

Returns

boolean

Whether every diagonal run a laying's new tiles would stand in is taken by isWord: each walked from its top end down, with the word's own letters on its new squares. Only a run through a new tile can change, and two new tiles of one word never share a diagonal (they share a row or a column), so each is read on its own. A run of two, a corner touch, is never read.

Examples

import { loadTileWordsFromModule } from "@johnmorrisdotca/kumimoji/words";
import { diagonalsRead } from "@johnmorrisdotca/kumimoji";

const words = await loadTileWordsFromModule("english");
console.log(diagonalsRead(()=>"",()=>true,"cat",{first:{row:0,col:0},fresh:[{row:0,col:0},{row:0,col:1},{row:0,col:2}]},word=>words.allowed.has(word)));
true

What it prints (run when this page was built)

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