Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualTournicoti

Posted 31 July 2012 - 08:31 AM

Glad I can help you Posted Image

My idea is "I assume at first there is no collision, and then if I find any positive case in the loop, there is collision (and I can exit now the loop)"
The problem is that you set collision to false in your loop when you encounter a negative case, but it must be set to false once before the loop only.

The second loop works because of the "break" statement

Even without 'break', it would work. It's just because we now know there is collision so we can skip the enumeration

#1Tournicoti

Posted 31 July 2012 - 08:29 AM

Glad I can help you Posted Image

My idea is "I assume at first there is no collision, and then if I find any positive case in the loop, there is collision (and I can exit now the loop)"
The problem is that you set collision to false in your loop when you encounter a negative case, but it must be set to false once before the loop only.

PARTNERS