Skip to content

Play Tic Tac Toe solo or with a friend in Python using Pygame.

Notifications You must be signed in to change notification settings

Tehseen-Ajmal/Tic-Tac-Toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Tic Tac Toe Game with Pygame

Overview

Welcome to the Tic Tac Toe game developed in Python using Pygame! This game offers both single-player and multiplayer experiences with a visually appealing GUI. It features two levels of Bot difficulty: Easy and Hard. While the Easy bot simply tries to win, the Hard bot is designed to block the player and create a more challenging gameplay experience.

Features

  • Single Player Mode: Play against the computer with two difficulty levels.
  • Multiplayer Mode: Enjoy the classic Tic Tac Toe experience with another player.
  • Easy Bot: A basic opponent that makes calculated moves and try to win.
  • Hard Bot: An advanced opponent that strategically blocks the player and attempts to win.
  • User-Friendly GUI: An intuitive and engaging interface developed using Pygame.

Installation

  1. Clone the Repository:

    git clone https://github.com/Tehseen-Ajmal/Tic-Tac-Toe.git
    cd Tic-Tac-Toe
  2. Install Dependencies:

    pip install pygame
  3. Run the Game:

    python main.py

How to Play

  1. Single Player:

    • Select '1-Player' from the main menu.
    • Choose the difficulty level: Easy or Hard.
    • The game starts with the player making the first move, followed by the bot.
  2. Multiplayer:

    • Select '2-Player' from the main menu.
    • Two players take turns to place their marks (X and O) on the board.
    • The first player to get three marks in a row (horizontally, vertically, or diagonally) wins.

Here is some preview of the game:

Tic_Tac_Toe_pygame_preview


tictactoe-preview-gif


Enjoy playing Tic Tac Toe! Happy gaming!