Ludii Forum
sites Group - 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: sites Group (/showthread.php?tid=153)



sites Group - Michael - 08-30-2020

I have tried and failed to find a way to reference the sites of a particular group of stones. I thought (sites Group …) did this but I cannot get it to work. Could someone explain to me what this ludeme does, and if there is a way get it to do what I want? It is only used in Hackenbush as far as I can see.

I would love to have a ludeme that takes in a site and returns that site together with all sites connected to it by a chain of adjacencies between sites of the same dynamic region type. Even better (this would make me very happy): It can also take in a region to work as a "pre-filter", such that only the sites of this region is taken into account when the group is computed. Sorry if I sound terribly naive. It is mostly excitement (and a dash of frustration after having been stuck for some days).


RE: sites Group - cambolbro - 08-31-2020

Hi,

(sites Group ...) should do what you are asking for, i.e. it should return the sites occupied by components connected to a component at a specified site, according to a specified connection relation.

To check why you're not getting the result you want, we really need to see the full .lud.

Regards,
Cameron


RE: sites Group - Michael - 08-31-2020

I'm using it inside (sites Around …):

(sites Around (sites Group Cell of:Cell at:(last To)) Orthogonal if:(is Empty (to)))

I've attached a file that runs if you replace this line with

(sites Around (last To) Orthogonal if:(is Empty (to)))

As is it gives an error message starting with "<html><h2>Syntax error: Could not create "game" ludeme from description.</h2><br/><p>(<font color=red>game</font>&nbsp;&quot;Less&nbsp;Trivial&quot;<br/>&nbsp; …"


RE: sites Group - Eric Piette - 09-06-2020

Hi Michael,

I just replaced the line you said by the line with only (sites Around ...) and that compiles in our current version.
Can you try again with the latest version of Ludii? (see attachment)

Regards,
Eric


RE: sites Group - Michael - 09-06-2020

(09-06-2020, 07:48 AM)Eric Piette Wrote: I just replaced the line you said by the line with only (sites Around ...) and that compiles in our current version.
Can you try again with the latest version of Ludii? (see attachment)
I know it compiles. That's what I said. The file I attached does not compile as is. I'm asking why. I take it I am misunderstanding the syntax of (sites Group …). Is there anything ungrammatical in the following:

(sites Around (sites Group Cell of:Cell at:(last To)) Orthogonal if:(is Empty (to)))

I want it to pick out the empty sites that are orthogonally adjacent to the group that the last placed stone belongs to, but it returns the error message I quoted the beginning of.


RE: sites Group - Eric Piette - 09-06-2020

Hi,

Ok I just looked the code inside the ludeme (sites Group ...) and some parts are not implemented on it.
I will let you know when we will publish another version of Ludii with these missing parts implementing.

But speaking of the description here for what you try to do that seems correct. But unfortunately, that's not currently working in the current version.

I will come back to you when that will be published.

Regards,
Eric Piette


RE: sites Group - Eric Piette - 09-07-2020

Hi,

That is now fixed in our dev version and will be published in the next release.

Regards,
Eric Piette