An open API service indexing awesome lists of open source software.

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++.

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
```