Reference · Marking, scores and game rules
ShiritoriPlaytype
What a word does to a chain.
Import it
import type { ShiritoriPlay } from "@johnmorrisdotca/kotoba";
Definition
type ShiritoriPlay = {
readonly ok: true;
readonly loses: false;
readonly next: string;
} | {
readonly ok: true;
readonly loses: true;
readonly next: null;
} | {
readonly ok: false;
readonly why: ShiritoriRefusal;
};
Examples
import type { ShiritoriPlay } from "@johnmorrisdotca/kotoba";
const play: ShiritoriPlay = { ok: true, loses: false, next: "ら" };
console.log(play);{ ok: true, loses: false, next: 'ら' }What it prints (run when this page was built)