Reference · Marking, scores and game rules
markKanaGuessfunction
A guess coloured against the word, place by place. Both are arrays of single kana.
Import it
import { markKanaGuess } from "@johnmorrisdotca/kotoba";
Definition
function markKanaGuess(guess: readonly string[], word: readonly string[]): KanaMarked[]
Parameters
| Name | Type | Description |
|---|---|---|
guess | readonly string[] | The guessed word or kana array, with the same length as the hidden word. |
word | readonly string[] | The word or kana array specified by this signature. |
Returns
KanaMarked[]
A guess coloured against the word, place by place. Both are arrays of single kana.
Examples
import { markKanaGuess } from "@johnmorrisdotca/kotoba";
console.log(markKanaGuess(["ぱ","な"],["は","な"]));[
{ mark: 'hit', wrongSize: false, wrongMark: true },
{ mark: 'hit', wrongSize: false, wrongMark: false }
]What it prints (run when this page was built)