06-14-2022, 11:49 AM
(06-14-2022, 11:10 AM)noobby Wrote: And your 'CountInStack'-answer already helped me a lot.
I wouldn' have found this in weeks. don't understand yet, where the (to) comes from.
Code:
(define "CountInStack"
(count Stack
at:#1
if:(= #2 (who at:(to) level:(level)))
)
)
Maybe this helps to understand the "(to)".
Consider the following paraphrase of that ludeme: Go through the pieces in the stack located at site #1 and count a piece if the owner of that piece is #2.
The "(to)" in the ludeme corresponds to the phrase "that piece" in my paraphrase.