Skip to content

kingdomOfIT/Python-Tictactoe-AI-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Project Banner
python

Python Tic Tac Toe AI Game

It is a game where the opponent can be your friend or unbeatable AI
  1. 🤖 Introduction
  2. ⚙️ Tech Stack
  3. 🔋 Features
  4. 🤸 Quick Start
  5. 🚀 More

Welcome to my Tic Tac Toe game implemented in Python! This classic game is designed for two players to enjoy, but it also features an AI opponent for those seeking a challenge. Powered by intelligent decision-making algorithms, the AI always chooses the best move possible, providing a formidable adversary for any player. Have fun testing your skills against both friends and machine intelligence in this timeless battle of wit and strategy!

  • Python

👉 Player vs Player Mode: Enjoy classic gameplay with friends in a two-player mode, where players take turns marking the board.

👉 Player vs AI Mode: Test your skills against an intelligent AI opponent that employs the minimax algorithm to ensure challenging gameplay.

👉 Dynamic Game Modes: Seamlessly switch between Player vs Player and Player vs AI modes during gameplay with the press of a key.

👉 Responsive User Interface: Experience smooth navigation and gameplay with a responsive user interface, providing an immersive gaming experience.

👉 Random AI Difficulty Setting: Adjust the AI difficulty level between random and minimax algorithms to tailor the challenge according to your preference.

👉 Efficient Algorithm: The AI utilizes the minimax algorithm to make optimal moves, ensuring a competitive and engaging experience.

👉 Interactive Board Display: Visualize the game progress with dynamic board displays, highlighting winning moves and enhancing the gaming experience.

👉 Game Reset Functionality: Reset the game at any point to start a new match and continue the fun without interruption.

👉 Simple Controls: Control the game effortlessly with intuitive keyboard controls, providing a smooth and enjoyable gaming experience for players of all levels.

Follow these steps to set up the project locally on your machine.

Prerequisites

Make sure you have the following installed on your machine:

Cloning the Repository

git clone https://github.com/kingdomOfIT/Python-Tictactoe-AI-Game.git
cd Python-Tictactoe-AI-Game

Installation

Install the project dependencies using pip or pip3:

pip install -r requirements.txt

Running the Project

python tictactoe.py

Choose your game mode using the following keys:

Press 'g' to toggle between Player vs Player and Player vs AI modes. Make moves as follows:

In Player vs Player mode, take turns marking the board with your symbol. In Player vs AI mode, wait for your turn and watch the AI make its move.


Restarting the Game

Press 'r' at any time to reset the game and start a new match.


Adjusting AI Difficulty

Press '0' for random AI moves or '1' for minimax algorithm-based moves.

Enjoy the game and have fun playing Tic Tac Toe against friends or challenging the AI!

Explore other projects or visit website

Check out my other projects on GitHub to discover more exciting creations!

🚀 Explore more of my work and stay updated with the latest projects on my website.

Thank you for visiting! Don't forget to star ⭐ this repository if you found it useful or interesting.



About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages