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

markGuessfunction

Each letter of a guess marked against the hidden word, counting a letter only as often as the word holds it.

Import it

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

Definition

function markGuess(guess: string, hidden: string): LetterMark[]

Parameters

NameTypeDescription
guessstring

The guessed word or kana array, with the same length as the hidden word.

hiddenstring

The hidden word in native lowercase letters or kana.

Returns

LetterMark[]

Each letter of a guess marked against the hidden word, counting a letter only as often as the word holds it.

Examples

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

console.log(markGuess("alley","apple"));
[ 'hit', 'near', 'miss', 'near', 'miss' ]

What it prints (run when this page was built)

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