my do-while loop won't exit
I'm trying to make a very basic text-based pokemon RPG type battle program for fun, but for right now my do-while loop condition isn't working. Do I have to add an incrementer or decrementer at the end?
Code:
do {
cout << "1. Scratch" << endl;
cout << "2. Fly" << endl;
cout << "3. Flamethrower" << endl;
cout << "4. Wing Attack" << endl << endl;
cout << "Attack number -> ";
cin >> move;
switch (move)
{
case 1:
cout << "Your " << pk1 << " does scratch!" << endl;
damage = ((((2 * level / 5 + 2) * e_atk * scratch / def) / 50) + 2) * stab * weak * randnum / 100;
e_hp = e_hp - damage;
cout << pk2 << " is inflicted with " << damage << " damage!" << endl;
cout << pk2 << " has " << e_hp << " left!" << endl << endl;
break;
}
} while ( (hp > 0) || (e_hp > 0) );