Computer Science Canada Weird Looping squares |
Author: | x-ecutioner [ Sat Nov 08, 2008 8:35 pm ] | ||
Post subject: | Weird Looping squares | ||
hi this script basically loops drawing squares, it creates an initial random co-ordinate and then determines the others. The issue is, occasionally, certain squares exceed the 500 by 500 square they are in and because of that or some strange reason the loop never exits.
Note: initially, the view.set was on 500 by 500 try it out and see what i mean:S any help would be greatly appreciated, thanks |
Author: | x-ecutioner [ Sat Nov 08, 2008 8:50 pm ] | ||
Post subject: | RE:Weird Looping squares | ||
okay so i fixed why it looped weird, the only issue left is that the squares still exceed the dimensions of 500:S
any ideas? |
Author: | TheGuardian001 [ Sat Nov 08, 2008 11:10 pm ] | ||
Post subject: | Re: Weird Looping squares | ||
the problem you're having is being caused by where you put your exit when line. with your current code:
you draw the box, then you check if it is too big. since you checked after drawing, you alway exceed the maximum and minimun by one repetition. simply move the exit when to before the drawing, and the problem should be fixed. |