Skip to content

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.

License

Notifications You must be signed in to change notification settings

eswar-7116/tictactoe-ai

Repository files navigation

Tic-Tac-Toe AI

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.

Setup

  1. Install pnpm (if not already installed):
npm i -g pnpm
  1. Install dependencies:
pnpm i
  1. Run the project:
pnpm dev

If you found this project useful or interesting, consider giving it a star ⭐.