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



addState - Michael - 03-08-2021

Is there a way to add and integer a piece's state, like one does with score in addScore?

I take it that (set State at:(site) (+ <int> (state at:(site)))) inside an iterator in a consequence would only set the state to the same value over and over. But and add function could increase it every iteration, right?

I'm sorry if this is confused.


RE: addState - Eric Piette - 03-09-2021

Hi,

That's possible yes to add it, but I am not sure we want to add that for every setter (included that one).
I think it will be better if you compute the sum of this integer in a define, then set that result to the state.

Regards,
Eric