A fully interactive two-player Tic Tac Toe game running in the terminal, built in Python using functions and simple data types.
- Two-player mode (Player X vs Player O)
- Live board display that updates after each move
- Input validation — rejects invalid or already-taken squares
- Automatic win detection for rows, columns and diagonals
- Draw detection when the board is full
- Play again prompt at the end of each game
- Python 3.8 or higher
git clone https://github.com/Faceless013/tictactoe_python.git cd tictactoe-python
python main.py
Players take turns entering a number from 1–9 corresponding to a position on the board:
7 | 8 | 9
The first player to get three in a row (horizontally, vertically or diagonally) wins. If all squares are filled with no winner, the game ends in a draw.
- Python 3.11
- Standard library only (no external dependencies)
- Structuring a project using simple functions
- Handling and validating user input robustly
- Using nested lists to represent a 2D game board
- Writing clean game loop logic with clear win/draw conditions
- Using different data types in conjunction with one another
- How to use Github in general
- Setting up a professional GitHub repository from scratch
- Setting up Git for version control and creating a working Workspace on VS Code.
- Add a single-player mode with a basic AI opponent
- Add score tracking across multiple rounds
- Add colour to the terminal output using colorama
- Build a simple GUI version using tkinter
This project is licensed under the MIT Licence. See the LICENSE file for details.
