Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
For that test case, there are three blobs of size
3
;{x:3,y:6,size:3}, {x:9,y:6,size:3}, {x:5,y:6,size:3}
. The size4
blob ({x:8,y:3,size:4}
) will move toward the blobs that are closest based on movement distance, which includes just the latter two. The[9, 6]
blob is roughly at 4 o'clock while the[5, 6]
blob is between 1 and 2 o'clock, relative to the size4
blob. This means the predatory blob moves toward the latter and ends up at[7, 4]
.EDIT: keep in mind that
x
represents the vertical position andy
represents the horizontal.Your distance assumption is correct. If those positions are correct, the
4
blob should move toward the3
blob in the 1-h position as you noted.Just a note, remember to make sure your solution is taking into account how to handle invalid inputs because that will affect the results.