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

ShiritoriPlaytype

What a word does to a chain.

Import it

import type { ShiritoriPlay } from "@johnmorrisdotca/kotoba";

Definition

type ShiritoriPlay = {
    readonly ok: true;
    readonly loses: false;
    readonly next: string;
} | {
    readonly ok: true;
    readonly loses: true;
    readonly next: null;
} | {
    readonly ok: false;
    readonly why: ShiritoriRefusal;
};

Examples

import type { ShiritoriPlay } from "@johnmorrisdotca/kotoba";

const play: ShiritoriPlay = { ok: true, loses: false, next: "ら" };
console.log(play);
{ ok: true, loses: false, next: 'ら' }

What it prints (run when this page was built)

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