This is a simple implementation and updated version of code the classic Tic-Tac-Toe game using Python's tkinter library. The game provides a graphical user interface (GUI) for two players to play the game on a 3x3 grid. Players take turns placing their respective symbols, "X" and "O", on the grid, and the first player to form a winning combination of their symbol wins the game.
- Python 3.x
- Tkinter library (usually comes pre-installed with Python)
-
Make sure you have Python and Tkinter installed on your system.
-
Clone this repository or download the main.py file to your local machine.
-
Run the main.py script using Python:
python main.py
- When the game starts, it's Player X's turn by default.
- To make a move, click on an empty cell on the grid to place the "X" or "O" symbol.
- The game will automatically switch turns between "X" and "O" after each move.
- The player who successfully places three of their symbols in a row (horizontally, vertically, or diagonally) wins the game.
- If all cells are filled and no player has won, the game ends in a draw.
- To start a new game, select "File" from the menu bar and choose "Play Again."
- To exit the game, select "File" from the menu bar and choose "Exit."
The score for each player is displayed at the top of the window. The "X" player's score is shown on the left, and the "O" player's score is shown on the right. The score is updated after each game based on the winner or if the game ends in a draw.
This project is licensed under the MIT License. Feel free to use and distribute it.
Enjoy playing Tic-Tac-Toe v2.0!