Ludii Forum
level analog of the (where ....) ludeme - Printable Version

+- Ludii Forum (
+-- Forum: Suggestions (
+--- Forum: Ludii Features / Services (
+--- Thread: level analog of the (where ....) ludeme (/showthread.php?tid=368)

level analog of the (where ....) ludeme - slimy_asparagus - 01-15-2021

In section 8.1.12 there is a where ludeme:

(where <string> (<int> | <roleType>) [state:<int>] [<siteType>])
(where <int> [<siteType>])

So assuming each player only has one piece of the sought for type this can be used to locate it. However if this is a stacking game it will not tell you the level, which is a problem. 

How difficult would it be to add a corresponding level ludeme in some future release? 

I did try to work out a way to track site and level data myself, but it can't work because the map/mapEntry constructs are read-only. That would work if they were, but would be I believe less efficient, require more code and possibly be more of a departure from existing Ludii. 


RE: level analog of the (where ....) ludeme - slimy_asparagus - 01-20-2021

I would really appreciate a response on this.

I don't know how Ludii is implemented internally. However it has occurred to me that the (where) ludeme might be searching the board space. If so a naive implementation of a level equivalent would repeat the search which would be inefficient.

Maybe the (where) ludeme could stash the level. And the (level) iterator could retrieve it. Obviously if the program needed it, it would have to be retrieved before any other sort of iteration over levels was done.

RE: level analog of the (where ....) ludeme - Eric Piette - 01-21-2021


We added to the ludeme where a way to work also for level.
It will be possible to call it with (where Level ....)

That ludeme can tell you the first level where a specific piece is in a stack (placed at a specific site) in starting to look from the bottom or the top.

That ludeme will be available in the next release.


RE: level analog of the (where ....) ludeme - slimy_asparagus - 01-21-2021

Thanks Eric