Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic Tac Toe with AI

A modern implementation of the classic Tic Tac Toe game built with React and TypeScript. Play against an AI opponent with three different difficulty levels!

Features

  • 🎮 Play against AI with three difficulty levels:
    • Easy: Makes random moves
    • Medium: Tries to block your wins and make winning moves
    • Hard: Uses the minimax algorithm for perfect play
  • ✨ Celebratory confetti animation when winning
  • 🔄 Game history navigation
  • 🎯 Highlighting of winning moves
  • 📱 Responsive design
  • 🎨 Modern UI with smooth animations

Technologies Used

  • React
  • TypeScript
  • CSS3
  • react-confetti

Getting Started

  1. Clone the repository
git clone [your-repo-url]
cd tictactoe
  1. Install dependencies
npm install
  1. Run the development server
npm start
  1. Open http://localhost:3000 to play the game

How to Play

  1. Select your preferred AI difficulty level
  2. Click on any square to make your move (you play as X)
  3. The AI will automatically make its move (O)
  4. Try to get three in a row horizontally, vertically, or diagonally
  5. Use the history buttons to undo moves or restart the game

Project Structure

  • src/components/ - React components
  • src/utils/ - Game logic and AI implementation
  • src/App.tsx - Main game component
  • src/App.css - Styles

Contributing

Feel free to submit issues and enhancement requests!

About

Simple tictactoe game implementation

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages