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
| Name | Type | Description |
|---|---|---|
guess | string | The guessed word or kana array, with the same length as the hidden word. |
hidden | string | 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)