Ludii Forum
(Sites Between <moves> if:(<boolean)) - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Suggestions (https://ludii.games/forums/forumdisplay.php?fid=10)
+--- Forum: Ludii Features / Services (https://ludii.games/forums/forumdisplay.php?fid=11)
+--- Thread: (Sites Between <moves> if:(<boolean)) (/showthread.php?tid=342)



(Sites Between <moves> if:(<boolean)) - dale walton - 12-19-2020

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?


RE: (Sites Between <moves> if:(<boolean)) - dale walton - 12-20-2020

I did find that this works, but it took a couples days of trying alternatives, and a few hours debugging.

    (sites To
      (forEach
        Site
        (sites Occupied by:Next component:"Disc")
        (select
          (from
            (sites Distance from:(site) 2)
            if:(is Empty (from))
          )
          (to
            (sites Between from:(from) to:(site))
          )
        )
      )
    )

So there might still be use for the original suggestion.


RE: (Sites Between <moves> if:(<boolean)) - Eric Piette - 01-04-2021

Hi,

For such a ludeme (sites Between ....) we agree that will be useful.
In the past (more than one year), that was not possible for implementation reasons, but I think (not sure) we can do it now. I will look that, if I can do it, we will add it. If not I will come back to you.

Regards,
Eric


RE: (Sites Between <moves> if:(<boolean)) - Eric Piette - 01-04-2021

Hi,

Ok I just add it to our dev version. So it will be possible to get the between sites with (sites Between ...) and also with (last Between) the between sites of the last decision made.

Will be available on the next release.

Regards,
Eric


RE: (Sites Between <moves> if:(<boolean)) - dale walton - 01-04-2021

Great! I may use it in the future. I eventually found workarounds for most of the issues I've been posting while you were away, and will be posting a meta game for your review soon.