10-02-2020, 09:14 AM
(10-02-2020, 09:02 AM)Eric Piette Wrote: Ok I looked but I am still not sure what is the expected result (Sorry I work on many stuff in the same time and I have a bit forget here).The score should be the sum of the values of all his groups. The value of a group is based on the number of 2-stacks in it. A group with one 2-stack is worth 1, a group with two is worth 3, a group with three is worth 6. The general formula for n 2-stacks in a group is (n(n+1))/2.
When a player pass, you want to add to his score a score equals to the number of stacks of size 2 in each group?
Or that's more complex?
But the more underlying issue is howto change a variable or state in between iterations. Post #2 shows the problem a bit cleaner, I think. And my hypothesis (to repeat) is that
Code:
(forEach Site
<region>
(and <moves1> <moves2>)
)
Code:
(and
(forEach Site <region> <moves1>)
(forEach Site <region> <moves2>)
)
Is this correct? And if it is, does it mean I cannot change a state or variable in between iterations?