How would I format my ShowBoard() function to output my stringin the following way?
my code:
#include “gameboard.hpp”
GameBoard::GameBoard(std::string letters)
{
for(int i = 0; i < 4; ++i)
{
for(int j = 0; j < 4; ++j)
{
this->letters[i][j] = letters[i * 4 + j];
}
}
}
char GameBoard::GetLetterByRowCol(int row, int col)
{
/*
*Returns the character at the specified row andcolumn.
*/
return this->letters[row][col];
}
std::string GameBoard::ShowBoard()
{
/*
*Returns a string representation of the board (shouldinclude new lines as needed).
*/
std::string output = “”;
for(int i = 0; i < 4; ++i)
{
for(int j = 0; j <
OR
OR