This is a simple Python project that implements the classic Tic-Tac-Toe game. You can play against the computer, which makes random moves. The game has a text-based user interface (TUI) that runs in the terminal.
- A 3x3 grid that shows the board state
- A prompt that asks you to choose your symbol (X or O)
- A prompt that asks you to enter the row and column numbers of your move
- A message that displays the result of the game
To run this project, you need to have Python 3 installed on your system. You don’t need to install any external modules, as the project only uses the built-in random and os modules.
To start the game, you need to clone this repository and run the main.py file. You can do this by typing the following commands in your terminal:
# Clone this repository git clone https://github.com/[your username]/Tic-Tac-Toe-Game-in-Python.git
cd Tic-Tac-Toe-Game-in-Python
python main.py
You will see a 3x3 grid and some prompts in the terminal. You need to choose your symbol (X or O) and enter the row and column numbers of an empty cell on the grid. The game will alternate between your symbol and the computer’s symbol. The first player to form a horizontal, vertical, or diagonal line of three symbols wins the game. If the grid is full and no one wins, the game is a draw.