🎮 Live Demo: isolate-me.vercel.app
A web-based implementation of the mathematical strategy board game Isolation, built with React and Vite. Features a custom game engine powered by the Minimax algorithm with Alpha-Beta pruning.
The game is played on a 3x3 grid with a single shared token:
- Start: The token starts at position 1 (top-center). The starting tile is burned immediately.
- Turns: Players take turns moving the token one step orthogonally (up, down, left, right).
- Burning Tiles: Every tile vacated by the token becomes permanently blocked.
- Endgame: The first player with no legal moves left on their turn loses.
- Minimax Decision Engine: Explores game states to calculate optimal moves for the computer opponent.
- Alpha-Beta Pruning: Cuts off redundant branches in the search tree to minimize compute time.
- Depth-Weighted Scoring: Prioritizes faster victories and delays loss scenarios based on distance to terminal state.
- Separation of Concerns: Core game and search logic (
src/utils/minimax.js) is decoupled from React UI components.
Measurements evaluated across all unique board symmetries (corners, edges, center) using npm run benchmark:
| Metric | Plain Minimax | Minimax + Alpha-Beta | Optimization |
|---|---|---|---|
| Explored States (Nodes) | 61 – 79 | 40 – 59 | Up to 44.3% tree reduction |
| Execution Time (Node.js) | ~0.23 – 0.24 ms | ~0.11 – 0.15 ms | Up to ~45% speedup |
- The search space adheres to
$\mathcal{O}(b^d)$ worst-case complexity ($b \le 4, d \le 9$ ), scaling down toward$\mathcal{O}(b^{d/2})$ under optimal Alpha-Beta branch pruning, guaranteeing mathematically optimal moves in under$0.2\text{ ms}$ on Node.js runtimes.
- Frontend: React, Vite
- Styling: CSS (Grid, Flexbox)
- Core Logic: JavaScript (ES6 Modules)
- Tooling: Oxlint, Git
isolate-me/
├── index.html
├── package.json
├── docs/
│ └── screenshot.png
└── src/
├── main.jsx
├── App.jsx
├── index.css
├── components/
│ ├── Header.jsx
│ ├── Rules.jsx
│ ├── Board.jsx
│ └── Game.jsx
└── utils/
└── minimax.js
- Node.js (v18+)
- npm
-
Clone repository: git clone https://github.com/Winlanto/isolate-me.git cd isolate-me
-
Install dependencies: npm install
-
Start dev server: npm run dev
-
Build production bundle: npm run build
-
Run benchmark suite: npm run benchmark
- Author: Alek-Jaan Tšern
- License: This project is licensed under the MIT License.
