A modern, feature-rich Tic Tac Toe game built with Python and Tkinter. Play against a friend or challenge the AI with multiple difficulty levels!
- 2 Player Mode - Play locally with a friend
- vs AI Mode - Challenge the computer
- Easy - Random moves, perfect for beginners
- Medium - Mix of smart and random moves
- Hard - Unbeatable Minimax algorithm
- Dark - Modern dark theme with neon accents
- Light - Clean light theme
- Retro - Classic retro styling
- Tracks total games played
- Win/loss/draw statistics
- Persistent storage of game history
- Undo Move - Take back your last move
- Custom Player Names - Personalize your experience
- Win Detection - Visual highlighting of winning moves
- Draw Detection - Properly handles tie games
- Python 3.7 or higher
pip install -r requirements.txtpython tic_tac_toe.py- Launch the game by running
python tic_tac_toe.py - Select Game Mode:
- Choose "2 Player" to play with a friend
- Choose "vs AI" to play against the computer
- Set AI Difficulty (when playing vs AI):
- Easy: Random moves
- Medium: Balanced challenge
- Hard: Impossible to beat
- Customize Player Names (optional)
- Choose Your Theme from the dropdown
- Click on the grid to make your move
- First player to get 3 in a row wins!
- Undo - Revert your last move
- New Round - Start a fresh game (keeps scores)
- Stats - View your game statistics
- Reset All - Clear everything including scores
The game is built using an object-oriented architecture:
TicTacToeGame - Main game controller
├── GameStats - Statistics management
├── TicTacToeAI - AI opponent (Minimax algorithm)
└── Theme - Color themes (Dark/Light/Retro)
The Hard difficulty uses the Minimax algorithm, which:
- Explores all possible game states
- Chooses the optimal move every time
- Is mathematically unbeatable (best you can do is draw)
Advance-Tic-Tac-Toe/
├── tic_tac_toe.py # Main game file
├── requirements.txt # Python dependencies
├── game_stats.json # Game statistics (auto-generated)
└── README.md # This file
Dark Theme - Modern look with neon accents
Light Theme - Clean and minimal
Retro Theme - Classic arcade feel
- Online multiplayer
- Sound effects and music
- Animated moves and transitions
- 4x4 and 5x5 board sizes
- Time attack mode
- Leaderboards
Contributions are welcome! Feel free to:
- Fork the repository
- Create a feature branch
- Submit a pull request
This project is licensed under the MIT License.
Created by kimi code yeah saying that openly(wanted to test it out duh)
Enjoy the game! If you have any suggestions or find bugs, please open an issue. 🎮