An optimal Tic-Tac-Toe AI that uses the Minimax algorithm with alpha-beta pruning and depth-aware evaluation to select the best move for winning.
The bot assumes perfect play from both sides and guarantees a win when possible, otherwise a draw. It is designed for small board sizes (e.g., 3×3), where full game-tree search is feasible.
- Install pnpm (if not already installed):
npm i -g pnpm- Install dependencies:
pnpm i- Run the project:
pnpm devIf you found this project useful or interesting, consider giving it a star ⭐.