Ludii Forum
Counting perimeter cells adjacent to a group - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Problems (https://ludii.games/forums/forumdisplay.php?fid=5)
+--- Forum: Grammar Problems (https://ludii.games/forums/forumdisplay.php?fid=24)
+--- Thread: Counting perimeter cells adjacent to a group (/showthread.php?tid=466)



Counting perimeter cells adjacent to a group - thorsilver - 02-26-2021

I'm trying to implement Star, but I'm stumped as to how to implement the score calculations.

In Star, groups are scored according to how many outer edge hexagons they touch.  So I've created a 'Limping Hex' board and forbidden placements on the outer rim of the board, thinking I could use those as the outer edge hexagons, then for each group total up the number of those perimeter hexagons they touch:

[Image: image.png]

However, I can't find a way to total these scores for each group.  Using 'forEach Group' and attempting to total up sites in adjacent sites in Outer doesn't work.  I can't go by pieces, because then the outer hexagons would get counted multiple times.  I'd welcome any ideas :)