This is a console-based implementation of the popular Tic Tac Toe game, written in C++. The game allows two players to play against each other on a 3x3 grid.
- Interactive gameplay in the console
- Clear and intuitive user interface
- Error handling for invalid moves
- Intelligent computer player (optional)
To compile and run the Tic Tac Toe game, you need to have the following software installed on your system:
- C++ compiler (supporting C++11 or later)
- Make sure the necessary libraries are available (standard library).
To compile the game, run the following command in your terminal or command prompt:
g++ -std=c++11 main.cpp -o tictactoe
After successful compilation, you can run the game by executing the compiled binary:
./tictactoe
Follow the on-screen instructions to play the game. Players can take turns and enter their moves by entering the corresponding position number. The game will display the updated board after each move and determine the winner or a draw when applicable.
- The game is played on a 3x3 grid.
- Two players take turns to mark a vacant cell with their respective symbols (X and O).
- The objective is to get three of their symbols in a horizontal, vertical, or diagonal row.
- The game ends when either one player achieves the winning condition or there are no more vacant cells left (a draw).
If you want to customize the game further, you can explore the source code files:
main.cpp
: Contains the main entry point and user interface logic.
Feel free to modify and enhance the code as per your requirements.
The image used in this README is sourced from Pinterest. All rights belong to the original creator.
This project is licensed under the MIT License.