1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
|
#include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <stdio.h>
using namespace std;
class pinfo {
public:
string name, gender, age, occup;
int charchoice;
}info;
void create_char() {
cout << "******************" << endl;
cout << "Good, I'm glad you decided to continue on your adventure that \nonly fate can "
"see. But, before we continue, please tell me your name." << endl;
cout << "******************" << endl;
getline(cin, info.name);
cout << "******************" << endl;
cout <<"Now, please enter your gender(Male/Fem):" << endl;
cout << "******************" << endl;
getline(cin, info.gender);
if(info.gender == "Male" || info.gender == "male" || info.gender == "m") {
cout << "******************" << endl;
cout << "Greetings Sir " << info.name << "! I am glad to instruct you in your quest for honor." << endl;
cout << "******************" << endl;
}
else if(info.gender == "Fem" || info.gender == "fem" || info.gender == "female" || info.gender == "Female"){
cout << "******************" << endl;
cout << "Greetings Lady " << info.name << "! I am glad to instruct you in your quest for honor." << endl;
cout << "******************" << endl;
}
else {
cout << "You mispelled your answer, please try again" << endl;
}
//choosing character
cout << "Now that we know your name and gender " << info.name << ", it is time for you "
"to decide which character's role you would like to take on." << endl;
cout << "******************" << endl;
if(info.gender == "Fem" || info.gender == "fem" || info.gender == "female" || info.gender == "Female"){
cout << "Since you are a female, the only character you may play as is Queen Guenevere." << endl;
cout << "******************" << endl;
}
else if(info.gender == "Male" || info.gender == "male" || info.gender == "m") {
cout << "Would you like to play as:" << endl
<< "1) King Arthur" << endl
<< "2) Sir Lancelot" << endl;
cin >> info.charchoice;
cout << "******************" << endl;
}
if(info.charchoice == 1) {
cout << "Congragulations! You are now playing as King Arthur!" << endl;
}
}
int main() {
string choice;
cout << "--------------------------------------------------------------------" << endl
<< "| |" << endl
<< "| ###### ####### ###### ### ### ### ### ####### |" << endl
<< "| ### ### ### ### ###### ### ### ### ### ### ### |" << endl
<< "| ######## ####### ## ######## ### ### ####### |" << endl
<< "| ### ### ### ## ## ### ### ######## ### ## |" << endl
<< "| ### ### ### ### ## ### ### ######## ### ### |" << endl
<< "| |" << endl
<< "--------------------------------------------------------------------" << endl << endl << endl;
cout << "Welcome to ARTHUR" << endl << endl;
cout << "--- MENU ---" << endl;
cout << "- Enter \"Play\" to continue on the quest" << endl;
cout << "- Enter \"Quit\" to stop playing and exit" << endl;
cout << "******************" << endl;
getline(cin, choice);
if(choice == "Play" || choice == "play" || choice == "p" || choice == "P"){
create_char();
}
else {
cout << "******************" << endl << endl;
cout << "Thanks for playing! Come again!" << endl << endl;
cout << "******************" << endl;
return 0;
}
return 0;
}
/*
cout << "A long time ago, King Arthur ruled his court with justice and"
" care. \nHe was married to Queen Guinevere. However, one of "
"King Arthur's knights, \nSir Lancelot, was in love with her too. \n"
"They met secretly, until..."
<< endl << endl;
cout << "___________________" << endl;
*/
|