markGuess関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Each letter of a guess marked against the hidden word, counting a letter only as often as the word holds it.
インポート
import { markGuess } from "@johnmorrisdotca/kotoba";
定義
function markGuess(guess: string, hidden: string): LetterMark[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
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. |
戻り値
LetterMark[]
Each letter of a guess marked against the hidden word, counting a letter only as often as the word holds it.
例
import { markGuess } from "@johnmorrisdotca/kotoba";
console.log(markGuess("alley","apple"));[ 'hit', 'near', 'miss', 'near', 'miss' ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。