Ludii Forum
Issue with count-parameter in (add) - 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: Issue with count-parameter in (add) (/showthread.php?tid=392)

Pages: 1 2


RE: Issue with count-parameter in (add) - Michael - 01-31-2021

I just changed function in the "count:" parameter to
Code:
(-
    (count Steps
        (last To)
        (centrePoint)
    )
    (count Steps
        (last From)
        (centrePoint)
    )
)
and now I'm back at not being able to make moves.. I can't even get the legal moves dots to show up.


RE: Issue with count-parameter in (add) - Eric Piette - 02-01-2021

Hi,

Thanks for reporting that :)

That was simply because the count parameter in add was not pre-processed.
I have now fixing that. Will be available in the next release, sorry for that error ;)

Regards,
Eric


RE: Issue with count-parameter in (add) - Michael - 02-03-2021

(02-01-2021, 08:45 AM)Eric Piette Wrote: Hi,

Thanks for reporting that :)

That was simply because the count parameter in add was not pre-processed.
I have now fixing that. Will be available in the next release, sorry for that error ;)

Regards,
Eric
Thanks, Eric! To be clear: Is both the issue with (apply) affecting "count" (as reported in post 10 of this thread) and the problem of not being able to make moves (as reported in post 11 of this thread) fixed by this?


RE: Issue with count-parameter in (add) - Eric Piette - 02-03-2021

Hi,

That's my hope, I will need you to check when the next release will be available.

Regards,
Eric


RE: Issue with count-parameter in (add) - Michael - 02-12-2021

(01-30-2021, 06:35 PM)Michael Wrote: New issue:
When I have (apply (remove (last From))) in (to) in (add), the evaluation of the function in "count:" changes. I don't understand how that can be. The function, again, is this:
Code:
(-
    (min
        (count Sites
            in:(sites Direction
                from:(last From)
                #1
            )
        )
        (count Sites
            in:(sites Direction
                from:(last From)
                #2
            )
        )
    )
    (min
        (count Sites
            in:(sites Direction
                from:(last To)
                #1
            )
        )
        (count Sites
            in:(sites Direction
                from:(last To)
                #2
            )
        )
    )
)
If I simply have (add (to (last To)) count:("MyFunction") stack:True), then selecting the center cell, then a cell 2 steps away will result in a stack of size 2 at the destination. This is what the function is supposed to do.

But if I have (add (to (last To) (apply (remove (last From)))) count:("MyFunction") stack:True), then the same selection results in a stack of size 4 at the destination. What is happening here?

I have attached a version where the (apply) ludeme is added.
This issue is still there, I'm afraid.


RE: Issue with count-parameter in (add) - Eric Piette - 02-12-2021

Hi,

Ok I just looked to that other bug you mentioned in that message and I found that the actions of an add move were duplicated if the (apply ...) in (to ...) of the (add ...) move is used (a line of code was just written twice).
Anyway I fixed it and it will be in the next release.

However, to help us to see all the bugs mentioned and be more sure that we are looking to each of them, it is always better to create a different post for each bug and not many in the same message. Thanks for that :)

Regards,
Eric


RE: Issue with count-parameter in (add) - Michael - 02-13-2021

Thank you!
I'm a bit confused, though. Post #10 does report exactly one issue. Did you mean that I should have started a new thread?


RE: Issue with count-parameter in (add) - Eric Piette - 02-13-2021

Hi,

Yes I mean a new thread.

Regards,
Eric