SuidoEventDetailtype
What a mounted board tells of itself in every event.
Import it
import type { SuidoEventDetail } from "@johnmorrisdotca/suido/play";
Definition
type SuidoEventDetail = {
code: string;
progress: string;
turns: number;
hints: number;
solved: boolean;
cell?: number;
};
Members
| Name | Type | Description |
|---|---|---|
code | string | The game as a code, every piece facing as it does now: what |
progress | string | The game as a short string to keep a game half played ( |
turns | number | Taps that turned a piece. |
hints | number | Hints asked for. |
solved | boolean | |
cell (optional) | number | undefined | The piece turned, for |
Examples
import { SUIDO_5X5 } from "@johnmorrisdotca/suido/levels-5x5";
import { gameProgress, isGameSolved, newGame } from "@johnmorrisdotca/suido";
import type { SuidoEventDetail } from "@johnmorrisdotca/suido/play";
const row = SUIDO_5X5[0];
const code = row[0];
const game = newGame(code)!;
const value: SuidoEventDetail = {code,progress:gameProgress(game),turns:game.turns,hints:0,solved:isGameSolved(game)};
console.log(value);{
code: '5x5:j5a5C5I59Ib75f7a6CCa35aIC',
progress: '0000000000000000000000000:0',
turns: 0,
hints: 0,
solved: false
}What it prints (run when this page was built)