Ludii Forum
count Liberties if: - 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: count Liberties if: (/showthread.php?tid=418)



count Liberties if: - slimy_asparagus - 02-04-2021

So I started looking at Blooms (one of my top three favourite abstract games).

I think for this I need to be able to use the "if:" clause of the (count Liberties) ludeme. I have tried (using the test dialog) both

Code:
(count Liberties at:18 Adjacent if:(= 0 (state at:(to))))


and

Code:
(count Liberties at:18 Adjacent if:(= 0 (state at:(site))))
The latter one makes more sense to me, but the former seems suggested by the documentation.
This is the game state:
[Image: pic5962464.png]
I would expect the Liberties to come out as 4 in this case, but instead I get 0.


RE: count Liberties if: - Eric Piette - 02-05-2021

Hi,

Yes with

Code:
(count Liberties at:18 Adjacent if:(= 0 (state at:(to))))


in your example you should get 4.
That was apparently a bad way to handle the condition.
After a small fix I just did the same example and I get 4 for that case.
Will be there in the next release.

Regards,
Eric


RE: count Liberties if: - slimy_asparagus - 02-13-2021

(02-05-2021, 09:11 AM)Eric Piette Wrote: Hi,

Yes with

Code:
(count Liberties at:18 Adjacent if:(= 0 (state at:(to))))


in your example you should get 4.
That was apparently a bad way to handle the condition.
After a small fix I just did the same example and I get 4 for that case.
Will be there in the next release.

Regards,
Eric

Eric,

Thanks. This seems to work so I should be able to make progress on this one.