Skip to content

ColinDao/your-move

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Your Move...

Project Description

This project implements an AI player in Python for the classic game of Tic-Tac-Toe. The agent uses the minimax algorithm with alpha-beta pruning to make optimal moves and ensure it never loses.

Table of Contents

Installation

You'll need to have Python and pip3 installed. You can download them from the official Python website.

  1. Clone the repository:
git clone https://github.com/ColinDao/your-move.git
  1. Navigate to the project directory:
cd your-move
  1. Install the required dependencies:
pip3 install -r requirements.txt

Usage

To play against the AI, run the following command:

python runner.py

Follow the prompts to make your moves. The AI player will respond with its moves based on the optimal strategy. Good luck, it never loses!

Features

Minimax Algorithm: The AI agent uses the minimax algorithm to search through the possible outcomes and determine the best move to make.

Alpha-Beta Pruning: Alpha-beta pruning is applied to optimize the minimax algorithm and reduce the number of paths explored.

Graphical User Interface (GUI): A simple GUI is provided to visualize the Tic-Tac-Toe board and player moves.

Technologies

Language: Python
Libraries: Pygame, Time, Sys, Copy

Credit

This project was completed as a part of CS50's Introduction to Artificial Intelligence with Python. Go check them out!

License

MIT License

Copyright (c) 2024 Colin Dao

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Releases

No releases published

Packages

No packages published

Languages