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
| Name | Type | Description |
|---|---|---|
count | number | The positive number of words to choose among. |
day | string | 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"));0What it prints (run when this page was built)