I can't get a do while to work with or
I can't get this while to work with or
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
do
{
cout << "1. Attack" << endl;
cout << "2. Say Hello" << endl;
cin >> enco;
switch (enco)
{
case '1':
SwordDmg ();
OponentDmg ();
cout << "You Delt " << sDmg << " damage " << "Wolf Delt " << oDmg << " damage" << endl;
pHp=pHp-oDmg;
opoHp=opoHp-sDmg;
cout << "Your HP:" << pHp << " Wolf's HP:" << opoHp << endl << endl;
break;
case '2':
cout << "Hello Wolf" << endl;
break;
}
}
while((opoHp < 0 )||(pHp > 0));
|
it just out puts a number less than 0 -1,-2 ect i can get it to work with out or but not using or.
Any help would be much appreciated
Last edited on
I think you want while (opoHp > 0 && pHp > 0)
just because this would mean while you are both still alive, when one of you dies.. end.
Topic archived. No new replies allowed.