Skip to content

I created this AI-driven Tic Tac Toe project to highlight the application of the Minimax algorithm, providing an unbeatable opponent that showcases the integration of classic game theory and artificial intelligence.

Notifications You must be signed in to change notification settings

hamidatb/MinMax-TicTacToe-Player

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

Tic Tac Toe Player

Welcome to my AI Tic Tac Toe Player project! This project implements the classic game of Tic Tac Toe using the minimax algorithm to create an unbeatable AI opponent. This README provides an overview of the project, setup instructions, and insights into my code.

Introduction

Tic Tac Toe, also known as Noughts and Crosses, is a simple and fun game played between two players who take turns marking spaces in a 3×3 grid. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row wins the game. This project leverages the minimax algorithm, a popular AI strategy, to create an intelligent Tic Tac Toe player that cannot be defeated.

Features

  • Unbeatable AI: Uses the minimax algorithm to ensure the AI always makes the optimal move.
  • Clean and Modular Code: The code is well-structured and easy to understand, making it suitable for further modifications and enhancements.
  • Detailed Comments: The code is thoroughly commented to help you understand each function and its purpose.

Prerequisites

  • Python 3.x

Installation

  1. Clone the repository:
    git clone https://github.com/your-username/tic-tac-toe-player.git
  2. Navigate to the project directory:
    cd tic-tac-toe-player

Usage

Run the Tic Tac Toe game using the following command:

python tic_tac_toe.py

How It Works

The game uses a simple command-line interface. Players can enter their moves as coordinates, and the AI responds with its move, calculated through the Minimax algorithm. The game continues until a player wins or there's a tie.

Future Improvements

  • Implement a GUI using Tkinter or PyGame to make it more accessible.
  • Add difficulty levels for the AI.
  • Expand the AI to support other games using similar algorithms.

License

This project is open-sourced under the MIT license.

About

I created this AI-driven Tic Tac Toe project to highlight the application of the Minimax algorithm, providing an unbeatable opponent that showcases the integration of classic game theory and artificial intelligence.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages