本文へ移動

Kotoba言葉

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

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

目次

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

WORD_SCORE定数

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

WHAT A GOMOJI WORD SCORES, won or lost. John, 2026-09-25: "lost words would give you more than 0 for getting some GREEN and some yellow. like time gives you some points, number of guesses, number of green, sooner the better green, yellows, number of yellows, etc." and "0 points is only possible for never hitting even one letter".

Every letter of the word is worth something the first time it is found, and more the sooner: a guess's WEIGHT is the rows that were still to come when it was made, so the first row of six weighs 6 and the last weighs 1.

  • PLACED: a letter in its place, 10 × the weight of the guess that first put it there.
  • ELSEWHERE: a letter of the word found but never placed, 4 × the weight of the guess that first showed it.
  • FOUND: the word itself, 10 for every place of every guess the board gives (foundBonus: 300 for five letters and six guesses, 450 for nine), and 25 for every guess left unused.
  • SPEED: a word found inside a minute, 50, one fewer for every six seconds after that, nothing after six minutes. The browser's clock, as every solo time here is; a lost word earns none, or giving up fast would pay.

So a word with no letter ever found scores 0 and nothing else does, and any word found is worth more than any word lost, however many guesses the level gives (layout.ts). A lost word never had every letter in place in one guess, so at best all but one went in on the first row and the last on the second: 10 × (letters × guesses − 1). A word found on its last row has every place (10 × letters) and the bonus (10 × letters × guesses), which is more (wordScore.test.ts holds it at every size and level). Everything but the time is read from the guesses, which the server has checked, so the server works it out itself.

インポート

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

定義

const WORD_SCORE: { readonly placed: 10; readonly elsewhere: 4; readonly rowLeft: 25; readonly speedMost: 50; readonly speedFreeMs: 60000; readonly speedStepMs: 6000; } = {
    placed: 10,
    elsewhere: 4,
    rowLeft: 25,
    speedMost: 50,
    speedFreeMs: 60000,
    speedStepMs: 6000,
} as const

メンバー

名前型説明
placed10
elsewhere4
rowLeft25
speedMost50
speedFreeMs60000
speedStepMs6000

例

import { WORD_SCORE } from "@johnmorrisdotca/kotoba";
console.log(WORD_SCORE);
{
  placed: 10,
  elsewhere: 4,
  rowLeft: 25,
  speedMost: 50,
  speedFreeMs: 60000,
  speedStepMs: 6000
}

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

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

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