Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not sure what's going on here
#4
boriel Wrote:Update III: After some more investigation, it seems it's a bug in your code.
The While condition:
Code:
while tempAlienStatBlocks(0,DHP) > 0 AND tempAlienStatBlocks(1,DHP) > 0
is always true for some reason. Printing these values within the loop shows they're 60 and 70 respectively. :?:

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!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)