This is a simple Tic Tac Toe game written in C++ that allows two players to enter their names and play alternately using standard 'X' and 'O' markers. The game declares the winner or notifies a draw based on the moves.
- Two-player mode with custom name input
- Visual 3x3 board display after each move
- Detects win, loss, or draw conditions
- Input validation for already-occupied cells
- Simple terminal-based interface
- Language: C++
- Compilation: g++ or any standard C++ compiler
- Platform: Command-line (Terminal)
git clone https://github.com/Khushi256/tic-tac-toe.git
cd tic-tac-toeUse any C++ compiler, for example g++:
g++ tic_tac_toe -o tic_tac_toe ./tic_tac_toeThis project is licensed under the MIT License.
Enter name of the first player:
Alice
Enter name of the second player:
Bob
Alice will play first!!
Bob will play next!!
| |
1 | 2 | 3
_____|______|_____
| |
4 | 5 | 6
_____|______|_____
| |
7 | 8 | 9
| |
Alice Enter your choice:
5
...
Bob WINS!!