A simple and interactive Tic Tac Toe game built with Python from scratch.
This was my first major project while learning Python. I built it without using AI tools (no Copilot) to strengthen my fundamentals.
- Clean and nice-looking game board
- Player can choose to play as X or O
- Input validation (prevents invalid moves and non-numeric input)
- Proper win detection (rows, columns, and diagonals)
- Automatic player switching
- Announces the winner when the game ends
##UPDATE ON V2 -i have added computer opponent to play against and trust me, you will have a hard time against it.
- Run the game using:
python game.py Choose whether you want to play as X or O
- Enter a position number from 0 to 8 when prompted
- The game will automatically switch turns and check for a winner after every move
##Technologies Used
Python 3 Built using only basic Python (lists, functions, loops, conditionals)
What I Learned
- Working with lists and indexing
- Creating and using multiple functions
- Handling user input with validation
- Implementing game logic and win conditions
- Debugging and problem-solving step by step
##Future Improvements (Planned)
- Add option to play again after the game ends
- Detect and announce draws (ties)
- dd a simple computer AI opponent (Single Player mode)
- Improve code structure and remove global variables
##How to Run Bash# Clone the repository git clone https://github.com/latakin/tictactoe-python.git
cd tictactoe-python
python game.py Author Lateef First Python project — Built with determination and no shortcuts.