Need C++ code for following with a document describing the codeas well:
Write a program to implement the game of Tic Tac ToeFour.
The game is played on a 4 × 4 chessboard,within 2 players. The player who is playing \"X\" always goes first.Players alternate placing Xs and Os on the board until either oneplayer has four in a row, horizontally, vertically, or diagonally;or all 16 squares are filled(which is a draw).
The program should be able to:
1) keep receiving the input from two players in turn.
E.g. receive both row index and column index from keyboardinput
2) print the current chessboard pattern for every turn. Below isan example of chessboard printing, with ‘-’ for empty squares. Youcan use any other pattern you like to visualize the chessboard.
- - - - - - - - - - - - - - - - game start | - - - - - - x - - o - - - - - - during game | - - - - - x x - - o - - - - o - during game | o o o o - x x - - o - x x - o x “o†wins |
3) determine if any player wins the game, or the game comes to adraw. Print out the final game result.
E.g. “Player1 wins†or “Drawâ€
Please submit all your source codes together with a documentdescribing your code and ideas