Skip to the content

Kotoba言葉

Load only the word lists you need, mark repeated letters correctly and play a daily or seeded word game.

Kotoba is the Japanese word for words. About the name

Contents

Reference · Marking, scores and game rules

shiritoriTailKeyfunction

The kana the next word must start on, or null when the word ends the chain: it ends in ん, or holds no kana.

Import it

import { shiritoriTailKey } from "@johnmorrisdotca/kotoba";

Definition

function shiritoriTailKey(reading: string, rules?: ShiritoriRules): string | null

Parameters

NameTypeDescription
readingstring

The reading of the word just played.

rules (optional)ShiritoriRules

House rules; the forgiving ones if left out.

Returns

string | null

The key the next word's head must equal, or null.

Examples

import { shiritoriTailKey } from "@johnmorrisdotca/kotoba";

console.log(shiritoriTailKey("さくら"), shiritoriTailKey("コーヒー"), shiritoriTailKey("みかん")); // ら い null
ら い null

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kotoba 1.11.0.