markKanaGuess関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A guess coloured against the word, place by place. Both are arrays of single kana.
インポート
import { markKanaGuess } from "@johnmorrisdotca/kotoba";
定義
function markKanaGuess(guess: readonly string[], word: readonly string[]): KanaMarked[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
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. |
戻り値
KanaMarked[]
A guess coloured against the word, place by place. Both are arrays of single kana.
例
import { markKanaGuess } from "@johnmorrisdotca/kotoba";
console.log(markKanaGuess(["ぱ","な"],["は","な"]));[
{ mark: 'hit', wrongSize: false, wrongMark: true },
{ mark: 'hit', wrongSize: false, wrongMark: false }
]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。