By deepshikha
This project is about finding the winner in Tic-tac-toe game using C++. Tic-tac-toe is played by two players A and B on a 3 x 3 grid.
Rules for Tic-tac-toe
It will Return the winner of the game if it exists (A or B), the game ends in a draw if neither of them wins and all the squares are filled, it will return "Draw" if there are still movements to play return "Pending".
For example
Input: For the moves = { [0,0], [2,0], [1,1], [2,1], [2,2] }
Output: "A is the winner"
Explanation:
A always plays first :
| X | | X | | X | | X | | X |
| | -> | | -> | X | -> | X | -> | X |
| | | O | | O | | O | | X |
Submitted by deepshikha (deepshikha)
Download packets of source code on Coders Packet
Comments