Hi iam new with c++ i started 2 days ago and in order to learn some basic stuff i decided to make a text game.
My problem is that at (He>0 or Hp>0) the program only uses the one i give the larger value in order to end the loop, the other can go negative and the program will still continue.
Thank you very much it works!
Question though doesnt 'and' mean both of them have to be true, in this case doesnt it mean both 'Hp' and 'He' have to become 0 or less in order to end the loop?
Im confused when i run the program only one of them have to become 0 or less with 'and' in order to end the loop (thats what i wanted though thanks again!).
Question though doesnt 'and' mean both of them have to be true, in this case doesnt it mean both 'Hp' and 'He' have to become 0 or less in order to end the loop?
No. It means both conditions have to be true for the loop to keep looping.
If either one of those conditions stops being true, then your loop condition (He>0 or Hp>0) stops being true, and the loop will stop looping.
Sure. For an "and" condition to be true, both the conditions need to be true.
The problem with the statement was to do with what happens to the loop when the condition is true, and what happens when it's false. That's what I was correcting.