Skip to content

This project is a Tic-Tac-Toe game where players can compete against each other or an AI powered by the minimax algorithm. The game is built with Python and Pygame, featuring a 3x3 grid, win-checking logic, and a restart option via the "R" key. The AI computes the best possible move, making it a challenging opponent.

Notifications You must be signed in to change notification settings

SamuelMarete/TicTacToe-With-Minimax-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic-Tac-Toe with Minimax AI

Description

A simple Tic-Tac-Toe game implemented in Python using Pygame. The game allows two players to play against each other or one player to compete against an AI powered by the minimax algorithm. The game features a 3x3 grid, win-checking logic, and restart functionality via the "R" key. The AI makes optimal moves, providing a challenging opponent.

Features

  • Two-player gameplay or player vs AI
  • Minimax algorithm for AI decision-making
  • Win-checking and draw detection
  • Restart game with the "R" key

Installation

  1. Clone the repository:
    [git clone /~https://github.com/SamuelMarete/TicTacToe-With-Minimax-AI.git]
    
  2. Install the required dependencies:
    pip install pygame numpy
    

How to Play

  1. Click on any empty square to make a move.
  2. The AI will automatically make its move after you.
  3. Press the "R" key to restart the game.

License

This project is licensed under the MIT License.

About

This project is a Tic-Tac-Toe game where players can compete against each other or an AI powered by the minimax algorithm. The game is built with Python and Pygame, featuring a 3x3 grid, win-checking logic, and a restart option via the "R" key. The AI computes the best possible move, making it a challenging opponent.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages