05-27-2022, 07:50 PM
(05-27-2022, 04:27 PM)dale walton Wrote: ForEach Piece is referring only to the mover's pieces. so try:
(and
(forEach Piece
...
("UpdateKing" Mover)
Mover
)
(forEach Piece
...
("UpdateKing" Next)
Next
)
)
Thank you so much for your help, Dale! I'm a bit confused, though.. Either I'm not understanding your suggestion, or you misread the script.
I use (forEach Piece) two places:
(1) inside the definition of ("UpdateKing") and
(2) as the outermost ludeme in (play).
In (1) it iterates only over the mover's pieces, but here it does not make sense to put your suggestion.
In (2) it does not iterate only over the mover's pieces, but rather depends on what is put in the place of #1. So in ("UpdateKing" Mover), it should iterate over the mover's pieces, but in ("UpdateKing" Next) it should iterate over the next player's pieces.