11-11-2012, 01:34 AM
boriel Wrote:Update III: After some more investigation, it seems it's a bug in your code.
The While condition:
is always true for some reason. Printing these values within the loop shows they're 60 and 70 respectively. :?:Code:while tempAlienStatBlocks(0,DHP) > 0 AND tempAlienStatBlocks(1,DHP) > 0
Aha!
Sorry. That was completely my cockup in debugging. Despite thinking I'd checked for a case of attack strength=0 it was coming through with one anyway - as a result, each alien was having their hit points reduced by 0 each round. And so neither was winning!
Kludged with: IF attackStrength=0 THEN attackStrength=1 : END IF
And it doesn't get stuck.
Edit: better yet, check for >= in the initial check, not > only! doh!