I am trying to get a while loop with an OR statement in it. I want it to end when either the player or the enemy hp reaches 0, but it won't end for the enemy hp hitting zero or for the player hp hitting zero. here is a sample that should simulate the code.
I end up just getting infinite loops. How do I get it to read the OR statment?
enemyhp=32;playerhp=32;while ((playerhp > 0) || (enemyhp > 0)) playerhp = playerhp - 4 %enemyhp = enemyhp - 4
end
Best Answer