https://github.com/bahaaio/consoletictactoe
Console TicTacToe game in C++.
https://github.com/bahaaio/consoletictactoe
Last synced: 11 months ago
JSON representation
Console TicTacToe game in C++.
- Host: GitHub
- URL: https://github.com/bahaaio/consoletictactoe
- Owner: Bahaaio
- Created: 2024-01-03T22:49:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-13T17:31:30.000Z (about 2 years ago)
- Last Synced: 2025-08-09T15:20:43.523Z (12 months ago)
- Language: C++
- Homepage:
- Size: 8.79 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tic-Tac-Toe
Simple console Tic-Tac-Toe game in C++!
Tic-Tac-Toe is a classic two-player game where players take turns marking spaces in a 3x3 grid. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row wins the game.
## How to Play
1. **Setup**: Run the executable file to start the game.
2. **Gameplay**: Players take turns marking spaces in the grid with 'X' and 'O'. The game board is numbered from 1 to 9 for each position.
3. **Winning**: The first player to get three of their marks in a row (horizontally, vertically, or diagonally) wins the game.
4. **Draw**: If all spaces are filled and no player has won, the game ends in a draw.
## Features
- Clear screen functionality for a better user interface.
- Input validation to ensure valid moves.
- Continuous play option to enjoy multiple rounds.
## Usage
1. Clone the repository:
```bash
git clone https://github.com/BahaaMohamed98/ConsoleTicTacToe
```
2. Compile the source code:
```bash
g++ main.cpp -o tic-tac-toe
```
3. Run the executable:
```bash
./tic-tac-toe
```