Coders Packet

TicTacToe game in C++

By Neeraj Kumar Singhal

TicTacToe is a two-player game in which one's sign is' X' and the other's sign is 'O' and the player has to make 3 the same signs in a row to win the game.

Screen:

                |    |
             1 | 2 | 3
            __|__|__
                |    |
             4 | 5 | 6
            __|__ |__
                |    |
             7 | 8 | 9
                |    |

First, player1 has to select a number from 1 to 9, and then there will be an 'X' sign on the screen and now player2 has to select a number then there will be an 'O' sign. The Game will end as any player win or match drawn.

In this project, I created a game that two players can play at a time. Let suppose player-1 is 'X' and player-2 is 'O' and they both are playing simultaneously. If any player is successful to get 3 of her marks in a row either up, down, across, or diagonally then he would be declared as the winner.

If the square box will full of marks and no one gets 3 of her marks in a row, the match declared a draw.

 

THANKS

Download Complete Code

Comments

No comments yet