A simple, command-line interface (CLI) Tic Tac Toe game built using C++. This implementation supports modular compilation and features both player-vs-player and player-vs-computer modes.
- The Grid: The game is played on a standard 3x3 grid.
- Game Modes: Choose either to play against the computer or a second player.
- Turns: Players take turns placing their marks (X and O) in empty squares.
- Winning: The first player to get 3 in a row (horizontally, vertically, or diagonally) wins.
- Draw: If all 9 squares are full and no player has 3 in a row, the game is a draw.
Ensure you have a C++ compiler (like g++) installed on your machine.
Run the following commands in your terminal:
# Clone the repository
git clone [https://github.com/dkak/cpp-tic-tac-toe.git]
# Navigate to the directory
cd cpp-tic-tac-toe
# Compile the code
# This command links main.cpp with all source files and includes the header directory
g++ main.cpp src/*.cpp -Iinclude -o tic-tac-toe
# Run the game (Windows)
./tic-tac-toe.exe