Counting instances of "Disc" at a site - Printable Version +- Ludii Forum (https://ludii.games/forums) +-- Forum: Questions (https://ludii.games/forums/forumdisplay.php?fid=13) +--- Forum: About the Ludii Grammar (https://ludii.games/forums/forumdisplay.php?fid=15) +--- Thread: Counting instances of "Disc" at a site (/showthread.php?tid=510) |
Counting instances of "Disc" at a site - Michael - 03-17-2021 I have been trying to figure out how to count the number of discs in a stack that may (or may not) have a tile at the bottom (level 0). Given that I have made sure that the tiles have component id 1 and 2, and the discs 3 and 4, it seems like the following should work: Code: (count Stack So I tried this: Code: (count Stack I the tried: Code: (count Pieces So now I'm asking: How do I count the number of discs in a stack that may or may not have a tile at level 0? RE: Counting instances of "Disc" at a site - Eric Piette - 03-18-2021 Hi, That code here is counting the number of Disc owned by the mover in the stack at site 0. I think that's what you are looking for. Code: (count Stack Regards, Eric |