Code:
#include <cstdlib>
#include <iostream>
using namespace std;
//Data Structure
struct enemy{
string name;
int level;
int hp;
int fullhp;
int str;
int def;
int equipstr;
int equipdef;
};
int xp;
int lvlxp;
int hp;
int fullhp;
int level;
int main(int argc, char *argv[])
{
//Variables
char charName[21];
char race[6];
//Intro
/* Notice how long lines can be wrapped, and still count as one string */
cout << "In a land where dragons roam and cows are plentiful. \n"
"You find yourself on a ranch with a dragon eclipsing the sun. \n"
"The smell of blood and cow dung fills the air, its just another day in paridise."
"Or is it? \n";
//Character Information
//Name
cout << "Enter a Name:\n" ;
cin.get(charName,21);
cin.ignore(100,'\n');
cout << "Good Morrow, " << charName << '\n';
//Race
cout << "Race: \n";
cin.get(race, 6);
cin.ignore(100, '\n');
if(!(race=="human" || race=="elf")) //if race does not = human or elf "YOU FAIL"
//if race = human or elf go to else
{
cout << "YOU FAIL! \n...Race: \n"; //if not =
cin.get(race, 11);
cin.ignore(100, '\n');
if(!(race=="human" || race=="elf")) //if not =, again
{
cout<< "YOU are a moron! \nRace: Human\n";
strcpy(race, "human"); //default to human
}
}
else
{
cout << "Name: " << charName << "\n" << "Race: " << race << "\n"; //displays Name and Race if "if statement" is true
}
system("PAUSE");
return EXIT_SUCCESS;
}
here is the whole program so far, its a work in progress... sorry about spaceing i do not know the correct way to indent it. any help with that is great as well