Git Product home page Git Product logo

ubaid2751 / tic-tac-toe Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 7 KB

This project is a classic implementation of the Tic Tac Toe game using Python and the Pygame library. The game offers two modes: Player vs Player, where two players can compete against each other on the same computer, and Player vs AI, where a player can challenge a simple AI opponent that uses the minimax algorithm for decision-making.

Python 100.00%

tic-tac-toe's Introduction


Tic Tac Toe Game

Overview

This is a simple Tic Tac Toe game implemented in Python using the Pygame library. The game allows two players to take turns marking spaces in a 3x3 grid until one player wins or the board is full (resulting in a draw).

Features

  • Player vs Player mode: Two players can play on the same computer, taking turns to make their moves.
  • Player vs AI mode: Play against a simple AI that uses the minimax algorithm to make strategic moves.
  • Visual indicators for winning lines and draws.
  • Option to reset the game and switch game modes (Player vs Player or Player vs AI).

Installation

  1. Clone the repository to your local machine:
    git clone https://github.com/your-username/Tic-Tac-Toe.git
    
  2. Navigate to the project directory:
    cd Tic-Tac-Toe
    
  3. Install the required dependencies (Pygame):
    pip install pygame
    

Usage

  1. Run the game using Python:
    python main.py
    
  2. Choose a game mode (Player vs Player or Player vs AI) by pressing the 'g' key.
  3. You can reset the game using the 'r' key.
  4. Make moves by clicking on the desired grid squares during your turn.
  5. Enjoy the game and have fun!

Credits

  • This game was created by Ubaid Abbas.
  • Inspired by tutorials and resources from the Pygame community.

License

This project is licensed under the MIT License.


tic-tac-toe's People

Contributors

ubaid2751 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.