本文へ移動

Kumimoji組み文字

シードから配った英字やかなのタイルで、ひとりでも複数人の卓でも、単語を組み合わせて遊べます。

「組み文字」は文字を組み合わせることを表す言葉です。 名前について(英語)

目次

リファレンス · ルール・タイル・記録

diagonalsRead関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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 { diagonalsRead } from "@johnmorrisdotca/kumimoji";

定義

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

引数

名前型説明
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.

戻り値

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.

例

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

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/kumimoji 1.6.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。