Skip to content

dkak/cpp-tic-tac-toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โŒ Tic Tac Toe (C++) โ—‹

A simple, command-line interface (CLI) Tic Tac Toe game built using C++. This implementation supports modular compilation and features both player-vs-player and player-vs-computer modes.

๐ŸŽฎ How to Play

  • The Grid: The game is played on a standard 3x3 grid.
  • Game Modes: Choose either to play against the computer or a second player.
  • Turns: Players take turns placing their marks (X and O) in empty squares.
  • Winning: The first player to get 3 in a row (horizontally, vertically, or diagonally) wins.
  • Draw: If all 9 squares are full and no player has 3 in a row, the game is a draw.

๐Ÿš€ Quick Start

Prerequisites

Ensure you have a C++ compiler (like g++) installed on your machine.

Installation & Compilation

Run the following commands in your terminal:

# Clone the repository
git clone [https://github.com/dkak/cpp-tic-tac-toe.git]

# Navigate to the directory
cd cpp-tic-tac-toe

# Compile the code
# This command links main.cpp with all source files and includes the header directory
g++ main.cpp src/*.cpp -Iinclude -o tic-tac-toe

# Run the game (Windows)
./tic-tac-toe.exe

About

Starting project on cpp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages