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

dailyWordfunction

The word of a day: the same for everybody who asks about the same day of the same list. Give a YYYY-MM-DD day, or a Date (read as a day in UTC, or in zone). Throws a RangeError for an empty list or a day that is not one.

Import it

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

Definition

function dailyWord(words: readonly string[], day?: DayKey | Date | number, options?: DailyOptions): string

Parameters

NameTypeDescription
wordsreadonly string[]

The ordered nonempty word pool or accepted-guess dictionary specified by the signature.

day (optional)string | number | Date

A valid YYYY-MM-DD date or moment specified by the signature.

options (optional)DailyOptions

Native game, mount or daily choices specified by the signature.

Returns

string

The word of a day: the same for everybody who asks about the same day of the same list. Give a YYYY-MM-DD day, or a Date (read as a day in UTC, or in zone). Throws a RangeError for an empty list or a day that is not one.

Examples

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

console.log(dailyWord(["apple","berry","lemon"],"2026-10-12",{salt:"sample"}));
apple

What it prints (run when this page was built)

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