A simple console-based Tic-Tac-Toe game written in C.
It supports:
- Two-player mode (Player 1 vs Player 2)
- Single-player mode (Player vs Computer)
- Interactive board displayed in console
- Input validation for moves
- Randomized computer moves
- Option to replay after each game
-
Clone this repository:
git clone https://github.com/your-username/tic-tac-toe-c.git
-
Navigate into the project folder:
cd tic-tac-toe-c -
Compile the program:
gcc tictactoe.c -o tictactoe
-
Run the game:
./tictactoe
X | O | X
---|---|---
O | X |
---|---|---
| | O