Computer Science Canada Need Help Urgently |
Author: | CyCLoBoT [ Fri Mar 21, 2003 7:49 am ] | ||
Post subject: | Need Help Urgently | ||
I would like to find the coordinates(I have showed in the picture) when there is one space between the circles. The two circles have to be on the same x-axis or the y-axis
Here is a picture that shows what I want: http://funware.topcities.com/info.htm Thanks |
Author: | Delta [ Fri Mar 21, 2003 9:50 am ] |
Post subject: | |
I'm a little confuse as to what you are trying to do. Maybe you could explain in a little more detail as to what you are trying to do. Then it will be easier to help you. |
Author: | CyCLoBoT [ Fri Mar 21, 2003 11:21 am ] |
Post subject: | |
Everytime the program runs, it generates 5 random circles. So when any two of the circles are beside each other seperated by 1 box in between, I want to find the cordinate between those two circles. |
Author: | Tony [ Fri Mar 21, 2003 11:57 am ] |
Post subject: | |
cant you just check for each of circles if there's another one nearby? for i:1..5 for i2:1..5 if ballX(i)+2 = ballX(i2) then match elsif ballY(i)+2 = ballY(i2) then match etc... for each of the balls, it checks its location to each of the other balls. once you get a match, then the square in between is the coordinates you're looking for. Such as for the first match, it would be (ballX(i)+1, ballY(i)) |