本文へ移動

Kotoba言葉

必要な単語一覧だけを読み込み、重複する文字を正しく判定し、日替わりやシード付きの単語ゲームを遊べます。

「Kotoba」は「言葉」です。 名前について(英語)

目次

リファレンス · 判定・得点・ゲームのルール

dailyIndex関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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 { dailyIndex } from "@johnmorrisdotca/kotoba";

定義

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

引数

名前型説明
countnumber

The positive number of words to choose among.

daystring

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

salt (省略可)string

Stable text distinguishing this daily word stream.

戻り値

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.

例

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

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

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/kotoba 1.2.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。