I am trying to stop a failbit but at the same time stop the user from entering none related strings. The only string I wish to allow are "hp", "str" or "aff". Why does it work with one string but not other options?
I realize I could do this with an if statement but I'd rather use while loops.
If stat != "hp" is false then you can be sure stat != "str" will be true because it can't be equal to "hp" and "str" at the same time. Since you use || it's enough that one of them is true for the whole expression to be true, and that is always the case here. I think you should probably use && instead of || when testing the different string values because you want the loop to run once more if ALL of them is true, not just if ONE of them is true.