12-19-2020, 07:08 AM
(This post was last modified: 12-19-2020, 07:18 AM by dale walton.)
You have (sites To <moves>) and (sites From <moves>) would a (sites Between <moves>) be possible, or is there a better way to do:
(sites Between (forEach Piece "Disc" (hop (between (exact 1) if:(is Empty (between)) (to if:(sites Empty)) Next)))
My purpose is to avoid selecting the above sites for placement, as they could be captured by hopping.
Using ifAfterwards:(not (can Move (hop ... works for human play, but is hanging the AI, and if the above can be made reasonably efficient it might be faster bvecause it can be used to eliminate the sites under consideration for all the possible moves at once rather than move by move filtering.
PS your documentation is not clear that (is Threatened ... doesn't apply to hopping. However even if it did and would make the script clear, I would be afraid it would be testing more conditions than the can move, and thus slower still. - But maybe I'm wrong of both these points?
(sites Between (forEach Piece "Disc" (hop (between (exact 1) if:(is Empty (between)) (to if:(sites Empty)) Next)))
My purpose is to avoid selecting the above sites for placement, as they could be captured by hopping.
Using ifAfterwards:(not (can Move (hop ... works for human play, but is hanging the AI, and if the above can be made reasonably efficient it might be faster bvecause it can be used to eliminate the sites under consideration for all the possible moves at once rather than move by move filtering.
PS your documentation is not clear that (is Threatened ... doesn't apply to hopping. However even if it did and would make the script clear, I would be afraid it would be testing more conditions than the can move, and thus slower still. - But maybe I'm wrong of both these points?