02-01-2022, 09:12 AM
(This post was last modified: 02-01-2022, 09:16 AM by Eric Piette.)
Hi,
One way to do this is:
This is looking for all the sites occupied by one of the pieces of the mover if this piece can step to an empty site.
Of course, you will have to adapt this part "(step (from (site)) (to if:(is Empty (to))))" to the moves you want to check for all the pieces owned by the mover.
But your question reminds me of a discussion I had with the other members of the team before which leads to adding a ludeme able to count the number of legal moves for a player, so to make this easier I will probably add this ludeme soon as a (count LegalMoves ....) and maybe a condition to (count Pieces ...) to look specific conditions as you wish.
Eric
One way to do this is:
Code:
(count Sites
in:(forEach
(sites Occupied by:Mover)
if:(can Move (step (from (site)) (to if:(is Empty (to)))))
)
)
This is looking for all the sites occupied by one of the pieces of the mover if this piece can step to an empty site.
Of course, you will have to adapt this part "(step (from (site)) (to if:(is Empty (to))))" to the moves you want to check for all the pieces owned by the mover.
But your question reminds me of a discussion I had with the other members of the team before which leads to adding a ludeme able to count the number of legal moves for a player, so to make this easier I will probably add this ludeme soon as a (count LegalMoves ....) and maybe a condition to (count Pieces ...) to look specific conditions as you wish.
Eric