I've been developing a game where a number of tiles can drag into a hexagonal grid background.
For some purpose I need to find the location of same tiles into an array and merge them.
I need to find the location of all the tiles those who have same value and connected with each other.
So I need a basic idea, how can I do that or if exists any algorithm.
Note: As3 related code will help.