Labyrinth Game Solver is a web application designed to solve configurations of the classic board game Ravensburger Labyrinth. The application helps users design board layouts, set up player pawns and target cards, and utilizes an optimized Breadth-First Search (BFS) solver to compute the shortest path of moves (tile shifts and pawn steps) required to collect target cards.
It runs directly in any modern mobile or desktop web browser and is hosted for free on GitHub Pages, built using Vite, React, TypeScript, and Tailwind CSS v4.
- iPhone / iOS Home Screen PWA: Configured with Apple Web App meta tags and viewport constraints to disable browser double-tap zoom bouncing. Use "Add to Home Screen" in Safari to run it full-screen just like a native mobile app.
- Sticky Mobile Action Bar: Controls like Undo, Redo, Rotate Board Perspective, Stats, and Audio are placed in a thumb-friendly bottom toolbar on mobile viewports.
- Intuitive Tab Editor & Drag-and-Drop: Build configurations easily on touch screens. Drag movable tiles onto the grid or tap them to rotate. The app enforces official setup limits (12 movable corners, 12 straight corridors, 9 T-junctions, and exactly 1 spare tile).
- Official Board Rules:
- Spawns match exact game rules: Red (Top-Left) is diagonal to Blue (Bottom-Right), and Yellow (Top-Right) diagonal to Green (Bottom-Left).
- Core treasures labeled textually (e.g., "Foot Ghost", "Lady Pig", "Gold Menorah").
- Multi-Threaded BFS Solver: Path search searches are handed off to a background thread Web Worker (
solver.worker.js), keeping the browser UI fully responsive. - Timeline History & LocalStorage Sync: Full Undo/Redo support. All saves, auto-saves, and layouts are synced directly to your browser's client-side
LocalStoragedatabase (runs serverless). - Synthesized Retro Audio: Retro sound effects built natively using the browser's Web Audio API (oscillators) for game actions.
| Setup | Solver |
|---|---|
![]() |
![]() |
| Welcome guide | Go Home |
|---|---|
![]() |
![]() |
| Mobile — expanded panel | Mobile — collapsed panel |
|---|---|
![]() |
![]() |
Simply open the live URL on your desktop browser or mobile phone: 👉 https://jleshnick.github.io/Labyrinth-Game-Solver/
- Load the link above in Safari on your iPhone.
- Tap the Share button in Safari's bottom toolbar.
- Scroll down and choose Add to Home Screen.
- Launch it from your home screen to enjoy the full-screen standalone experience!
You need Node.js (v20 or newer) and Git installed on your computer.
- Clone the repository:
git clone https://github.com/JLeshnick/Labyrinth-Game-Solver.git cd Labyrinth-Game-Solver - Install package dependencies:
npm install
Launches the local Vite hot-reloading dev server:
npm run devOpen http://localhost:3000 in your browser.
Compiles production assets and outputs them to the dist/ directory:
npm run buildnpm run test # Runs Vitest unit tests
npm run typecheck # Typechecks the TypeScript source
npm run lint # Lints files using oxlintsrc/
├── App.tsx # Core application controller & React state machine
├── index.css # Tailwind CSS v4 styling & scrollbars
├── main.tsx # Bootstrap React mounting
├── solver.js # Legacy solver logic (BFS, sliding, reachability)
├── solver.worker.js # Background worker for non-blocking solver computations
├── solver.d.ts # TypeScript module declarations for solver functions
├── constants.ts # Official board presets, coordinates, and treasure names
├── types.ts # App-wide TypeScript interfaces
├── components/ # React view components
│ ├── Board.tsx # 9x9 Layout grid (arrows, tiles, reachable overlays)
│ ├── SidePanel.tsx # Loose tiles container
│ ├── Tile.tsx # Corridor renders, starting colors, and descriptions
│ └── ui/ # Accessible Radix primitives and UI shells
├── hooks/ # Custom React hooks
│ ├── useLabyrinthHistory.ts # Timeline undo/redo snapshot stack
│ └── useLabyrinthStorage.ts # Browser LocalStorage persistence
└── utils/ # Utility functions
└── audio.ts # Web Audio API retro oscillator sound effects





