Ludii Forum
addState - Printable Version

+- Ludii Forum (
+-- Forum: Questions (
+--- Forum: About the Ludii Grammar (
+--- 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


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.