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

dailyIndexfunction

Which of count words a day gets, from 0 to count - 1. Over any run of count days that starts at a multiple of count days after 1970-01-01, every place comes up exactly once. salt names the list, so that two lists of one length are not dealt in the same order.

Import it

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

Definition

function dailyIndex(count: number, day: DayKey, salt?: string): number

Parameters

NameTypeDescription
countnumber

The positive number of words to choose among.

daystring

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

salt (optional)string

Stable text distinguishing this daily word stream.

Returns

number

Which of count words a day gets, from 0 to count - 1. Over any run of count days that starts at a multiple of count days after 1970-01-01, every place comes up exactly once. salt names the list, so that two lists of one length are not dealt in the same order.

Examples

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

console.log(dailyIndex(3,"2026-10-12","sample"));
0

What it prints (run when this page was built)

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