A classic Tic-Tac-Toe game built using Python and the Tkinter library for the graphical user interface. This project is perfect for beginners learning GUI development in Python. The game features a simple and intuitive interface, allowing two players to compete in the timeless game of Tic-Tac-Toe.
- Two-Player Game: Play against a friend on the same device.
- Winning Highlight: Winning moves are highlighted in green for a better visual experience.
- Random Start: The starting player is chosen randomly for fairness.
- Restart Option: Easily restart the game at any time with the "Restart" button.
- Simple Interface: Clean and user-friendly design.
- Start the Game: Run the Python script to launch the game.
- Player Turns: Players take turns clicking on the grid to place their symbol (
X
orO
). - Win or Tie: The game ends when a player gets three of their symbols in a row (horizontally, vertically, or diagonally) or when the grid is full (tie).
- Restart: Click the "Restart" button to start a new game.
-
Clone the Repository:
git clone https://github.com/Sa3d-Ka/Tic-Tac-Toe.git cd Tic-Tac-Toe
-
Run the Game: Make sure you have Python installed, then run:
python tic_tac_toe.py
- Tkinter GUI: The game uses Tkinter for the graphical interface.
- Game Logic:
- Players alternate turns by clicking on the grid.
- The game checks for a winner after each move.
- Winning moves are highlighted in green.
- Restart Functionality: The game can be restarted at any time using the "Restart" button.
Game
Win
Tie
- Python 3.x
- Tkinter (comes pre-installed with Python)
Contributions are welcome! If you'd like to improve the game, follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeatureName
). - Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/YourFeatureName
). - Open a pull request.
This project is open-source and available under the MIT License.