An AI-powered Tic Tac Toe game built with React and JavaScript, using the Minimax algorithm enhanced with Alpha-Beta pruning for perfect play.
The computer uses the Minimax algorithm to evaluate all possible game outcomes:
| Outcome | Score |
|---|---|
| AI Win | +1 |
| Draw | 0 |
| Player Win | −1 |
The algorithm recursively simulates each move and counter-move to select the optimal action.
Alpha-Beta pruning skips unneeded branches, improving runtime efficiency without changing results.
- 🤖 AI opponent using Minimax + Alpha-Beta pruning
- 🏆 Unbeatable gameplay logic
- 🧮 Recursive evaluation with +1 / 0 / −1 scoring
- 🌀 Instant reset to replay without reload
- 📱 Responsive layout for all screen sizes
- React, JavaScript, HTML, CSS
- Minimax algorithm
- Alpha-Beta pruning
- Render (deployment)
git clone https://github.com/lahariSane/tic-tac-toe.git
cd tic-tac-toe
npm install
npm run dev