A classic Tic Tac Toe game built in Python with a user-friendly GUI using Tkinter. Supports two game modes:
- ๐ฅ Player vs Player
- ๐ค Player vs Computer (AI)
The AI uses intermediate logic to attempt to win or block the player, giving a fun and fair challenge.
- โ Graphical interface with clean button layout
- โ Player vs Player (PvP) mode
- โ Player vs Computer (PvE) mode
- โ Basic AI with win/block strategy
- โ Tie and win detection
- โ Restart and role selection
- โ Centered window and styled UI
- Python 3.10 or higher
- No external packages required (just uses built-in
tkinter
)
-
Clone the repo or download the
.py
file:git clone https://github.com/iMD10/tic-tac-toe-python.git cd tic-tac-toe-python
-
Run the game:
python TicTacToeUI.py
The AI follows an intermediate approach:
- If it can win, it plays the winning move.
- If the player is about to win, it blocks.
- Otherwise, it plays the first available move.
- Muhannad Majed
GitHub: @iMD10