ever since instantiated the class, i am stuck in the do you want to play again loop
the code is as follows- for main
#include
#include
#include"FBullCowGame.h"
void PlayIntro();
void PlayGame();
bool AskToPlayAgain();
int main();
FBullCowGame BCGame;
int main()
{
bool bPlayAgain;
do {
PlayIntro();
PlayGame();
bPlayAgain=AskToPlayAgain();
} while (bPlayAgain);
return 0; // exit the game
}
void PlayIntro()
{
constexpr int Word_Length = 5;
std::cout << “welcome to bulls and cows\n”;
std::cout << “can you Guess the " << Word_Length << " letter isogram I’m thinking of? \n”;
}
void PlayGame()
{
BCGame.Reset();
int curtry=BCGame.GetCurrentTry();
int maxtry=BCGame.GetMaxTries();
std::string Guess;
//loop for number of reruns
for (int i = 1; i <= maxtry; i++)
{
std::cout<<"try " << curtry << ", enter your guess: ";
std::getline(std::cin, Guess);
std::cout << "your guess is: " << Guess << std::endl;
}
}
bool AskToPlayAgain()
{
std::string Response="";
std::cout << "do you want to play again?(Y/N) ";
std::getline(std::cin, Response);
return (Response[0] == ‘y’) ||(Response[0] == ‘Y’); //if response starts with y then yes
}