Ludii Forum
Setting random state in (start) - 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: Setting random state in (start) (/showthread.php?tid=482)



Setting random state in (start) - Michael - 03-02-2021

Is there a way to set the state of a piece to a random value in the start rules? I tried the new random value ludeme, but that didn't work.


RE: Setting random state in (start) - Eric Piette - 03-03-2021

Hi,

In the current version, that's not possible because the data in the starting rules are Integer and not IntFunction.
So I just updated that in our dev version and that will be possible in the next release.
Here an example to place a ball owned by P1 on the site 1 with a random state between 3 and 300:
(place "Ball1" 1 state:(value Random (range 3 300)))

Regards,
Eric