Skip to content

lahariSane/tic-tac-toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎮 Tic Tac Toe — Minimax AI with Alpha-Beta Pruning

An AI-powered Tic Tac Toe game built with React and JavaScript, using the Minimax algorithm enhanced with Alpha-Beta pruning for perfect play.

🎯 Live Demo


🧠 AI Logic

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.


🧩 Features

  • 🤖 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

🛠️ Tech Stack

  • React, JavaScript, HTML, CSS
  • Minimax algorithm
  • Alpha-Beta pruning
  • Render (deployment)

🚀 Getting Started

git clone https://github.com/lahariSane/tic-tac-toe.git
cd tic-tac-toe
npm install
npm run dev

Open http://localhost:5173 to play locally.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors