I want to know how to make a choose your own path game. I am relatively new to c++. HTML got boring so I am here now. I want to know how to make it so you can press 1 and enter for the first choice/path. Or press 2 and enter for the second path/choice without the program just closing or having to link 100 other programs to it. I just want it to be in command prompt. No GUI. Not that good yet.
I will have to try it out. I am not currently at a computer but I will be around 9:00. I will test it and tell you how it goes. Also one more question. How do I get it to go to the next page for different options?
It looks like program programmer's code worked best for me. But i'm still not understanding how to make it so that when they pick option 1 or 2 it goes to the next question on a fresh cmd screen?
#include <iostream>
usingnamespace std;
int main ()
{
int choice;
cout << "Male or Female?\n\n> 1 = Male\n\n 2= Female\n\n";
cin >> choice;
if (choice == 1)
{
cout << "<You have selected Male!>\n\n";
}
if (choice == 2)
{
cout << "You have selected female!\n\n";
}
if (choice > 2)
{
cout << "ERROR INVALID SELECTION\n\n\n\n";
}
return 0;
}
This is my modified version of "program programmer's" code! although this is a test and not a part of my game. This seems to work i just need help with what i have posted above!^^