Can't resist.

Code:

' at 6 minutes, the fly has a half-building lead on the mosquito. that is, the fly has completed one turn, the mosquito has
' completed 1 1/2 turns. the mosquito now has to catch up with the fly. at this point it doesn't matter that the
' course is circular. all that matters is that the fly is now ahead of the mosquito.
' if the fly's speed is x meters/min., then if y=time in mins when the mosquito reaches the fly, the fly will have moved x*y meters.
' but the fly has a head start of 3*x meters.
' the mosquito reaches the fly when
' y*1.5*x = 3*x + x*y
' dividing by x
' 1.5*y=3+y
' .5y = 3
' y = 6 minutes (or 12 minutes from the start)
' now, to program it:
' mosquito's position on circle, each second, is 1/(60*4) of the distance around the circle
' fly's position each second is 1/(60*6) of the way around the circle
circFly=0
circMos=0
for i=1 to 10000 ' each second
circFly=1/360+circFly
if circFly>1 then ' making the second round
circFly=circFly-1
end if
circMos=1/240+circMos
if circMos>1 then 'yep, the mosquito also rounds the building
circMos=circMos-1
end if
if circFly=circMos then
ui_msg_box("Eureka","The mosquito catches the fly at "+i+" seconds.")
exit for
end if
next

## Bookmarks