it's not so hard. What I've done myself is, I've putted a function that make an invisible square(MinX, MinZ, MaxX, MaxZ) If the object is in the square, putt a rnd to see if it is turning, or moving. If turning, then decide, left or right. if moveing, move the object. if the object is trying to go out of the invisible square, then move him back and make him turn around so he can take another move. Maybe be a little confusing, but it work.
Windows XP,pentium IV, 3.0 MGZ, 1024 mb memory, 256 mb video card ATI Radeon XPRESS 200 'sett squadron back on the assault'