Reference · Marking, scores and game rules
shiritoriReadingIsPlayablefunction
Whether a word continues the chain and does not end it.
Import it
import { shiritoriReadingIsPlayable } from "@johnmorrisdotca/kotoba";
Definition
function shiritoriReadingIsPlayable(reading: string, chainKey: string, rules?: ShiritoriRules): boolean
Parameters
| Name | Type | Description |
|---|---|---|
reading | string | The reading of the word. |
chainKey | string | The last word's tail key. |
rules (optional) | ShiritoriRules | House rules; the forgiving ones if left out. |
Returns
boolean
Whether the word can be played without losing.
Examples
import { shiritoriReadingIsPlayable } from "@johnmorrisdotca/kotoba";
console.log(shiritoriReadingIsPlayable("らくだ", "ら"), shiritoriReadingIsPlayable("らいおん", "ら"));true falseWhat it prints (run when this page was built)