Ludii Forum
The sites between two sites - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Questions (https://ludii.games/forums/forumdisplay.php?fid=13)
+--- Forum: About the Ludii Grammar (https://ludii.games/forums/forumdisplay.php?fid=15)
+--- Thread: The sites between two sites (/showthread.php?tid=210)



The sites between two sites - Michael - 10-15-2020

Is there a ludeme that returns the sites that line on a straight line in between two sites?

My problem is that I want (sites Direction) to "stop" right after it has included a site that meets some criteria (by default it stops right before, so the site meeting the criteria is excluded). I thought that, if I can refer to the sites between the "from:"-value and (site), I can stop as soon as this region contains the relevant piece. I tried to see if (between) could be used for this, but it is not recognized as a region, at least not the way I was using it in the context of (sites Direction) (basically the following):

Code:
stop:(=
    (count Sites
        in:(intersection
            (sites Occupied by:P1)
            (between)
        )
    )
    1
)

Another way of achieving what I want would be to allow (sites LineOfSight) to ignore (treat as empty?) sites that meet a certain condition. Or (not as good as a ludeme that returns the sites flanked by two sites, though): An operation that adds the next site in each direction to the result of (sites Direction).


RE: The sites between two sites - Eric Piette - 10-15-2020

Hi Michael,

No we do not have a such ludeme but that sounds really useful.
I will probably add a ludeme (sites Between <IntFunction> <IntFunction>) doing that, before the next release (probably tomorrow). I will let your know.

For your comment about (sites Direction ...) I guess I can also add a BooleanFunction parameter to include the site causing the stop, that makes sense. I will also let you know tomorrow if I add that for the next release.

Regards,
Eric


RE: The sites between two sites - Michael - 10-15-2020

Great!

I was able to work around it, by the way. I had to break up the directions, doing one at the time. In the attached .lud you can drag a stack of pieces to a stack of you own pieces in line of sight seeing through everything but your pieces. But I would really love that ludeme anyway :)


RE: The sites between two sites - Eric Piette - 10-16-2020

Hi Michael,

I added the ludeme (sites Between ....) and also a parameter stopIncluded in the (sites Direction ...).

They will be in the next release during the day.

Regards,
Eric