working on useGame

This commit is contained in:
2025-10-15 17:29:53 +01:00
commit 8acc16fc1c
37 changed files with 3320 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import { useGame } from "./useGame";
export type UseGameType = ReturnType<typeof useGame>;
export type {
Difficulty,
DifficultyName,
BoardString,
} from "./lib/Sudoku";
export type GamePhase = "idle" | "playing";
export type PlayStatus = "started" | "game-over" | "game-won";
export type GameStatus = "waiting" | "started" | "game-over" | "game-won";
export const isPlaying = (status: GameStatus): status is PlayStatus =>
status === "started" || status === "game-over" || status === "game-won";
export const getGamePhase = (status: GameStatus): GamePhase =>
status === "waiting" ? "idle" : "playing";