After playing Gomoku for a whole day, Doraemon and Capoo are looking to try new games.They are interested in exploring other classic board games, such as Tic-tac-toe and Connect4, which share the "n-in-a-row" style with Gomoku. Your mission is to develop a program that supports the games of Tic-tac-toe and Connect4 for them to play.
This is a partial judge problem. Please review the provided code and refer to the sections labeled "TODO" in the function.h file for further details, and using C++17 to submit your solution.
The first line of the input contains an integer N, representing the number of test cases. (1 ≤ N ≤ 100)
Each of the following N lines represents a test case. Each line records a game session, detailing every move made by the players. The game may conclude early if one player wins. The game records are formatted as follows:
<TicTacToe/ConnectFour> <Player1_Name>:<Move> <Player2_Name>:<Move> <Player1_Name>:<Move> ...
We guarantee that players will not play out of turn or make illegal moves, such as placing pieces on already occupied spaces.
The move format for Tic-tac-toe is x/y
where "x" represents the row and "y" represents the column, indicating the placement of a piece on the board at position board[x][y]; The move format for Connect4 is cx
where "x" represents the column in which the disk is dropped.
Refer to the sample output provided.
If a game concludes without a winner after all moves in each testcase, output "Tie". Otherwise, tell the winner of the game. Additionally, display the status of the board at the end of the game. Please ensure to leave an empty line in the output at the end of each test case.