I'm using Lua. I have a hex map. It is randomly generated into an table.
hexmap[y][x].color = "red"
I wish to find each "group" of hex's. i.e. all hex's of the same color that connect to each other will belong to one group.
As an example, in the following image:
The result should be:
1 blue group (all hex's connect) 3 green groups 1 black group