Ludii Forum
(is Loop) - 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: (is Loop) (/showthread.php?tid=326)

Pages: 1 2


(is Loop) - Michael - 12-09-2020

I don't understand how this works. It's detecting loops that aren't closed. What is the definition of a loop here?


RE: (is Loop) - Eric Piette - 12-14-2020

Hi,

I guess you want a loop with adjacent connection here? (so using also the diagonal?)
For the empty site in the loop detected, that's a bug I am going to fix it.

Regards,
Eric


RE: (is Loop) - Michael - 12-14-2020

(12-14-2020, 07:48 AM)Eric Piette Wrote: I guess you want a loop with adjacent connection here? (so using also the diagonal?)
Yes :) (There also has to be at least one enemy piece inside.)
(12-14-2020, 07:48 AM)Eric Piette Wrote: For the empty site in the loop detected, that's a bug I am going to fix it.
Thank you, that's great!


RE: (is Loop) - Eric Piette - 12-14-2020

Hi,

Ok I fixed it. That will be published with the next release.

Regards,
Eric


RE: (is Loop) - Michael - 12-14-2020

Thanks! Seems like there's still an issue, though. This black loop is not detected.. Shouldn't it?

Edit: It seems it doesn't count loops around enemy pieces if not all sites inside the loop are occupied på the enemy. Is this intended? If so, how do I detect loops around at least one piece belonging to the other player?


RE: (is Loop) - Eric Piette - 12-15-2020

Hi,

Yes you get it yourself. All the sites have to be of the types of the surrounding ones. No mechanism is implemented to count the number of each type in them. I can probably implement that but I have to check if the current code can do that and also we have to decide for a syntax for that.

Regards,
Eric


RE: (is Loop) - Michael - 12-15-2020

That would be great!

I should probably mention that this game also needs to be able to detect whether there is a piece of the same color as the loop inside the loop that is not orthogonally adjacent to a piece belonging to the loop.


RE: (is Loop) - Eric Piette - 12-15-2020

Hi,

Can you send me an example of what is a correct loop for this game?

Regards,
Eric


RE: (is Loop) - Michael - 12-15-2020

I can send examples when I get time with my computer. Here is a (uncomputable) definition in the meantime: 

If we think of the playing area as an infinite group of orthognally connected empty sites, a piece is inside a loop if it is not part of a unicolored orthogonally connected group that includes a piece that is adjacent to an empty site belonging to an infinite orthognally connected group of empty sites :) 

Or slightly differently put: A piece is inside a loop if you can't trace a unicolored orthogonal path from it to a piece orthogonally adjacent to an empty site belonging to an infinite orthogonally connected group of empty sites.


RE: (is Loop) - Eric Piette - 12-15-2020

Hi Michael,

We discussed about your issue and we decide to add a ludeme (sites Loop ...) to return all the sites inside the loop or all the sites making the loop (according to a parameter). With that, you should be able to make any test you want on them.

Regards,
Eric