03-17-2021, 01:42 PM
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:
I thought: It starts counting from the top, and if it reaches a component with id 2 or less, it stops counting. But it returns 0 when I have a disc on top of a tile.
So I tried this:
I was thinking it might count all the pieces in the stack that have id 3 or more. But again it simply returns 0 when there is a tile in the stack.
I the tried:
That returns 0 no matter what I try to do. I tried "Disc1", but that didn't do anything.
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?
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
FromTop
at:<int>
stop:(> 3 (what at:(to)))
)
So I tried this:
Code:
(count Stack
at:<int>
if:(< 2 (what at:(to)))
)
I the tried:
Code:
(count Pieces
"Disc"
in:(sites {<int>})
)
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?