Reference · Marking, scores and game rules
kanaScorefunction
Score kana guesses using exact, elsewhere and same-family matches plus found and speed bonuses.
Import it
import { kanaScore } from "@johnmorrisdotca/kotoba";
Definition
function kanaScore(word: string, guesses: readonly string[], rows: number, elapsedMs: number): KanaScore
Parameters
| Name | Type | Description |
|---|---|---|
word | string | The word or kana array specified by this signature. |
guesses | readonly string[] | Submitted whole guesses in chronological order. |
rows | number | The number of guesses the game permits. |
elapsedMs | number | Elapsed milliseconds supplied by the host clock. |
Returns
KanaScore
Score kana guesses using exact, elsewhere and same-family matches plus found and speed bonuses.
Examples
import { kanaScore } from "@johnmorrisdotca/kotoba";
console.log(kanaScore("はな",["ぱな","はな"],6,20000));{
placed: 110,
elsewhere: 0,
column: 0,
found: 220,
speed: 50,
total: 380
}What it prints (run when this page was built)