Skip to content

Tic-Tac-Toe game AI using Minimax algorithm with alpha-beta pruning optimization and fast win heuristics.

Notifications You must be signed in to change notification settings

jatin-47/Tic-Tac-Toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic-Tac-Toe

Tic-Tac-Toe game AI using Minimax algorithm with alpha-beta pruning optimization.
Heuristic/Evaluation function is such that it chooses the move that makes fastest win / slowest loss by giving score to the terminal states based on the their depth.

PLAY NOW!

Features: ✨

  1. User-friendly UI/UX with very smooth sliding animations.
  2. Choose your own marker (X/O).
  3. 2 modes - Play against AI 🤖 or Play against a Friend 🙋🏻‍♂️.
  4. 3 difficulty levels for playing against AI.
  5. Number of matches played, timer and scoreboard with the playing player highlighted.
  6. Strip message animation.

Compatibility: 🖥️ 📱

Responsive design, can be played on any device.

Difficulty Levels (AI): 🎚️

1. Easy:

AI randomly chooses any available spot on the board.

2. Medium:

Minimax algorithm with 30% randomness. AI can choose a random spot with 30% probability.

3. Impossible:

Minimax algorithm with alpha-beta pruning for optimization of minimax algorithm as it reduces the time complexity by pruning nodes in the minimax tree (abstract). Score to a terminal state is assigned with +- depth of that state which accounts for the closness of this terminal state to the current state. Closser terminal states means faster winning move.

Some very good resources: 📚

Screenshots: 📷

Main Menu
SS1
Game Screen
SS2