This project is a console-based implementation of the classic Tic-Tac-Toe game, developed in C++. It allows two players to compete against each other in a fun and interactive way. The game features a simple user interface and includes essential game mechanics such as turn-taking, win detection, and draw conditions.
- Two-player gameplay: Players can take turns marking their moves on a 3x3 grid.
- Win and draw detection: The game checks for winning combinations and announces the result.
- User-friendly interface: Clear prompts guide players through their moves, making it easy to play.
To run this project locally, follow these steps:
- Clone the repository:
git clone https://github.com/alishbannoor2/Tic-Tac-Toe.git cd Tic-Tac-Toe - Create a new project in Visual Studio:
Open Visual Studio and create a new C++ project. Add the existing source files (
Tic-Tac-Toe.cpp,ClientCode.cpp, andTic-Tac-Toe.h) to the project. - Build the project:
In Visual Studio, go to Build in the menu and select Build Solution (or press
Ctrl + Shift + B). - Run the game:
After building, you can run the program by clicking the Start button (or press
F5).
- Start the game and enter the names of the two players.
- Players take turns entering the box number (0-8) to mark their move.
- The game will display the updated board after each turn.
- The game ends when a player wins or if there is a draw.
Contributions are welcome! If you have suggestions for improvements or new features, feel free to fork the repository and submit a pull request.
