For some reason the loop won't stop when the playerHP < zero, however. The loop does stop when the dragonHP < zero. Why is this happening?

 ``12345678910111213141516171819202122232425262728293031323334353637383940414243`` `````` #include #include #include using namespace std; string name; int playerHP = 20; int dragonHP = 30; string choice; int main(){ srand(time(NULL)); cout << "Hello wanderer, what is your name?" << endl; cin >> name; cout << "Welcome " << name <<". Kill the fucking dragon." << endl; do{ int Attack = rand() % 10 + 1; int Heal = rand() % 10 + 1; int dragonAttack = rand() % 15 + 1; cout << "Attack - Heal" << endl; cin >> choice; if(choice == "Attack" || choice == "attack"){ dragonHP = dragonHP - Attack; cout << "You attacked the dragon! It has " << dragonHP << " left!" << endl; } else{ playerHP = playerHP + Heal; cout << "You healed yourself for " << Heal << " ! Your current HP is" << playerHP << endl; } playerHP = playerHP - dragonAttack; cout << "The dragon attacked you for " << dragonAttack << " damage! You have " << playerHP << " left!" << endl; }while(dragonHP > 0 || playerHP > 0); cout << "Game over" << endl; return 0; }``````

Output:

http://prntscr.com/2eg2b7

Help is MUCH appreciated! Also an explaination please.
1- indent you code properly
a- || means or (truth table http://en.wikipedia.org/wiki/Truth_table#Logical_disjunction )
If the dragonHP is lower than 0 why wouldn't it trigger the truth table then?
`while(dragonHP > 0 || playerHP > 0);`
`while (dragonHP > 0 && playerHP > 0);`