Skip to content

CodeCinnamon001/tictactoe-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TicTacToe Game in C++

This is a command line Tic Tac Toe game written in C. The game can be played by player and computer .

Getting Started

To play the game, you will need to have a C++ compiler installed on your machine. You can use any C compiler of your choice, such as GCC, Clang, or Visual Studio.

1.Clone the repository to your local machine using the following command:

git clone https://github.com/CodeCinnamon001/tictactoe-cli.git

2.Compile the game using the following command:

g++ .\main.cpp -o tictactoe

3.Run the game using the following command:

./tictactoe

How to Play

1.The game is played on a 3x3 board. Where player can choose either X or O.

2.The players take turns to make their move. To make a move, enter the number corresponding to the position on the board where you want to place your X or O.

3.The board positions are numbered as follows:

1 | 2 | 3

4 | 5 | 6

7 | 8 | 9

4.If the player gets three of their symbols in a row (horizontally, vertically, or diagonally) wins the game. If all the positions on the board are filled and neither player has won nor computer, the game is a tie.

5.To exit the game at any time, press Ctrl+C on your keyboard.

License

All copyright of This project belongs to CodeCinnamon001