A simple command-line implementation of the classic Tic-Tac-Toe game where you play against the computer.
- The game board is displayed as a 3x3 grid with numbers 1-9 representing available positions.
- You play as 'O' and the computer plays as 'X'.
- On your turn, enter the number corresponding to the position where you want to place your 'O'.
- The computer will automatically make its move as 'X' after your turn.
- The first player to get 3 of their marks in a row (horizontally, vertically, or diagonally) wins.
- If all positions are filled without a winner, the game ends in a tie.
- Clear visual representation of the game board
- Input validation to ensure only valid moves are accepted
- Random computer moves
- Automatic detection of wins or ties
- Python 3.x
- Save the game code to a file (e.g.,
tic_tac_toe.py
) - Run the game using Python:
py app.py