04-21-2021, 12:38 PM
Hi,
The ludeme (is Blocked ...) is to detect if that's impossible to connect a set of regions with the pieces owned by a player.
The ludeme (is Connected ...) is to detect if a set of regions are connected by pieces owned by a player.
Here what you are trying to do ("to allow placement iff the placed piece has an open path to any empty perimeter cell") is different and should not used these ludemes.
The easiest way is that one:
Unfortunately, that code requires the next release, but it works here (I just tried to be sure).
We still hope to do a release Friday, if the code is enough stable.
Regards,
Eric
The ludeme (is Blocked ...) is to detect if that's impossible to connect a set of regions with the pieces owned by a player.
The ludeme (is Connected ...) is to detect if a set of regions are connected by pieces owned by a player.
Here what you are trying to do ("to allow placement iff the placed piece has an open path to any empty perimeter cell") is different and should not used these ludemes.
The easiest way is that one:
Code:
(forEach Site (sites Empty)
(if (!= Infinity (count Steps (step (to if:(is Empty (to)))) (site) (sites Outer)))
(move Add
(to
(site)
)
)
)
)
Unfortunately, that code requires the next release, but it works here (I just tried to be sure).
We still hope to do a release Friday, if the code is enough stable.
Regards,
Eric