bool replayGame ()
{
int iteration = 0;
char replayResponse;
bool result,keepAsking = false;
cout << endl;
cout << " ================================" << endl;
cout << " | |" << endl;
cout << " | o : rejouer |" << endl;
cout << " | n : Arreter |" << endl;
cout << " | |" << endl;
cout << " ================================" << endl;
cout << endl;
cin >> replayResponse;
do
{
if (iteration>0)
{
cout << "Vous avez entre un caractere incorrect, recommencez" << endl;
}
if (replayResponse == 'o')
{
result = true;
}
else if (replayResponse == 'n')
{
result = false;
}
else
{
keepAsking = true;
}
iteration ++;
}
while (keepAsking);
return result;
}