By Pavithra P
This game can be played by 2 players. The player who attains the pattern(line) first is the winner. If the pattern is not achieved then it results in draw.
This game is played by two members that is player 1(X) and player 2(O)
Two players can enter the number alternatively from 1 to 10.
In case the player has entered number rather from 1 to 10. The text “Invalid move” and again the player should enter the valid number.
The player who attains the pattern such as slanting line (both right and left), vertical line and horizontal line first is the winner. If the pattern is not achieved then it results in draw.
Int checkwin()
checks if the pattern is achieved.
//function to return game status
1 for game is over with result
-1 for game is in progress
0 game is over and no result
void board ()
Function to draw board of tic tac toe (that is in the shape of #) with player’s mark.
Submitted by Pavithra P (Pavithra11)
Download packets of source code on Coders Packet
Comments