Building the TIC TAC Toe Game
Tic-tac-toe is a game for two players, X and O, who take turns marking the spaces in a 3×3 grid. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row is the winner.
To test the game, You have 2 options.
To test the game online, click on this demo link.
-
First off all, clone the repo on your local machine:
git clone https://github.com/Datagirlcmr/Object-Oriented-Programming
-
Open your terminal and go to the project root directory:
cd Object-Oriented-Programming
-
To run the game type:
bin/main
The game will be initialized. Enjoy!.
-
When the game starts, two players are prompted to provide their names.
-
The players are prompted to choose the symbol of play; X or O By default, the second player gets the other symbol not chosen by the first player
-
The board is then displayed as shown below
-
The player chooses between the available positions from 1 to 9.
-
A position can not be chosen twice
-
The first player to get his symbols aligned in a horizontal, vertical or diagonal row wins the game
-
A draw occurs when all the positions on the board have been filled up, yet no player has been able to win.
-
The Game ends when there is a win or a draw
-
You can always choose to play again or quit the game.