09-23-2020, 09:18 AM

Is there a way of iterating over groups?

I have made a game where your score is the sum of the values of all your groups, and the value of a group is (n(n+1)/2)-1, where n is the number of a kind of stone in the group.

I'm pretty sure I can do this by iterating over stones and removing a group after I have calculated its value in order not to count the same group over again, but I would like to not have to do it that way.

I have made a game where your score is the sum of the values of all your groups, and the value of a group is (n(n+1)/2)-1, where n is the number of a kind of stone in the group.

I'm pretty sure I can do this by iterating over stones and removing a group after I have calculated its value in order not to count the same group over again, but I would like to not have to do it that way.