If I have a randomly generated array with 60 items (represented as 6x10) of 6 types (represented as integers 0-5), how can I search for groups of the same type within the array? (Vertically/horizontally connected groups of at least 3.)
I'm working in a scripting environment (LSL) similar to C++ and C.
Here is a parametrized working javascript example with comments, the trick is to use an array to denote the cells / nodes you have already visited.