Question: My questions is what code do I write using vectors that will determine a winner or loser? Tic Tac Toe Tic-tac-toe is a paper-and-pencil game
My questions is what code do I write using vectors that will determine a winner or loser?


Tic Tac Toe Tic-tac-toe is a paper-and-pencil game for two players, X and 0, who take turns marking the spaces in a 3x3 grid. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row is the winner (Wikipedia). We've provided a main.cc which gets input from the user and draws a tic-tac-toe board. Users take turns entering their preferred move into the terminal until one of the player wins or no spaces are left. Your task is to implement the function CheckGame in tic tac_toe.cc which will determine if the game is over, and if so, the result. Implement CheckGame Here is the function prototype for CheckGame defined in tic tac toe.h: // Return 1 if player 1 wins, 2 if player 2 wins, o if no one has won but // there's still space, and -1 if the board is full. int CheckGame(std::vector<:vector>>& game); Here the game parameter is a vector of vectors. Specifically, game[@] is a vector
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
