To starts off, I am pretty new to C++. I am working on a project just for fun but keep running into a problem (see code below), no matter what my input word is, the code assigns the statRollArray value to the wisdom int. I have tried all of the different input methods, but it always acts as if I put in "wisdom". Why is this? Any help is appreciated!
while (charisma == 0 || strength == 0 || dexterity == 0 || intelligence == 0 || wisdom == 0 || consitution == 0) {
cout << "Where would you like to assign your roll of " << statRollArray[chooseStatNumber] << "?" << endl;
if (dexterity == 0) {
cout << "Dexterity";
}
if (intelligence == 0) {
cout << " Intelligence";
}
if (strength == 0) {
cout << " Strength";
}
if (wisdom == 0) {
cout << " Wisdom";
};
if (charisma == 0) {
cout << " Charisma";
}
if (consitution == 0) {
cout << " Constitution"
<< endl;
}
string choice = "";
cin >> choice;
if (choice == "wisdom" || "Wisdom" || "Dexterity" || "dexterity" || "Strength" || "strength" || "Intelligence" || "intelligence"
|| "Charisma" || "charisma" || "Constitution" || "constitution") {
if (choice == "wisdom" || "Wisdom") {
if (wisdom == 0) {
wisdom = statRollArray[chooseStatNumber];
chooseStatNumber += 1;
continue;
}
}
else {
cout << "Wisdom already has been assigned!" << endl;
continue;
}
if (choice == "Dexterity" || "dexterity") {
if (dexterity == 0) {
dexterity = statRollArray[chooseStatNumber];
chooseStatNumber += 1;
continue;
}
}
else {
cout << "Dexterity already has been assigned!" << endl;
continue;
}
if (choice == "strength" || "Strength") {
if (strength == 0) {
strength = statRollArray[chooseStatNumber];
chooseStatNumber += 1;
continue;
}
}
else {
cout << "Strength already has been assigned!" << endl;
continue;
}
if (choice == "intelligence" || "Intelligence") {
if (intelligence == 0) {
intelligence = statRollArray[chooseStatNumber];
chooseStatNumber += 1;
continue;
}
}
else {
cout << "Intelligence already has been assigned!" << endl;
continue;
}
if (choice == "charisma" || "Charisma") {
if (charisma == 0) {
charisma = statRollArray[chooseStatNumber];
chooseStatNumber += 1;
continue;
}
}
else {
cout << "Charisma already has been assigned!" << endl;
continue;
}
if (choice == "constitution" || "Constitution") {
if (consitution == 0) {
consitution = statRollArray[chooseStatNumber];
chooseStatNumber += 1;
continue;
}
}
else {
cout << "Constitution already has been assigned!" << endl;
continue;
}
}
else {
cout << "Please choose one of the listed stats." << endl;
continue;
}
}