// Hangman Redo Program
#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
#include <string>
#include <algorithm>
using namespace std;
//Functions
void welcome();
void instructions();
void game();
// Types and Arrays
string choice;
string inst;
int main()
{
welcome();
return 0;
}
void welcome()
{
cout << "\tWelcome to Hangman 2.0 By Khoanyneosr!" << endl;
cout << "Would you like to see the instructions?";
cout << endl << "Yes - Y" << endl;
cout << endl << "No - N\n- ";
cin >> choice;
transform(choice.begin(), choice.end(), choice.begin(), toupper); // toupper algorithm
cin.ignore ( std::numeric_limits<std::streamsize>::max(), '\n' ); // limit cin
bool done = false;
while (done = false)
{
if (choice == "Y")
{
instructions();
done = true;
break;
}
else if (choice == "N")
{
game();
done = true;
break;
}
else
{
cout << endl << "Invalid input.\n- ";
done = true;
continue;
}
};
}
void instructions()
{
cout << endl << "Instructions()" << endl;
}
void game()
{
cout << endl << "Game();" << endl;
}
That's my code. For some reason when i try to enter either Y or N it just ends the loop then shuts down and doesn't continue to where i want it to go. What am i doing wrong here? thanks in advance.