Skip to content

It's an AI program that is based on the minimax algorithm and plays Tic Tac Toe. One of my first AI program.

License

Notifications You must be signed in to change notification settings

MZaFaRM/TicTacToeAI

Repository files navigation

TicTacToeAI

This is a simple implementation of Tic Tac Toe with an AI opponent using the Minimax algorithm.

Getting Started

These instructions will help you run the game on your local machine.

Prerequisites

You will need Python 3 and the Pygame module installed.

python3
pygame

Installing

Clone the repository to your local machine:

git clone https://github.com/MZaFaRM/tictactoeAI.git

Navigate to the project directory:

cd TicTacToeAI

Running the game To start the game, run the runner.py file:

py runner.py
Use your mouse to click on either "Play as X" or "Play as O" to choose which player you want to be. If you are X, you go first. Click on any empty square to make your move. If you are O, the AI will calculate its move and go first. Then you can click to make your move. The AI uses the Minimax algorithm to calculate the optimal next move. When the game ends, click "Play Again" to reset the board and play another round.

Acknowledgments

Completed as part of my venture in CS50AI from Harvard CS50 hosted on EDx


Made with 🧡 by Muhammed Zafar

About

It's an AI program that is based on the minimax algorithm and plays Tic Tac Toe. One of my first AI program.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages