本文へ移動

Kumimoji組み文字

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

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

目次

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

crossingFit関数

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

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

定義

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

引数

名前型説明
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 (省略可)((run: string) => boolean) | null

Optional diagonal-word predicate; null disables diagonal checking.

戻り値

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).

例

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 } ]
}

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

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

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