Ludii Forum
Interface for deciding to add a number of pieces - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Problems (https://ludii.games/forums/forumdisplay.php?fid=5)
+--- Forum: Ludii Player Problems (https://ludii.games/forums/forumdisplay.php?fid=6)
+--- Thread: Interface for deciding to add a number of pieces (/showthread.php?tid=256)

Pages: 1 2


Interface for deciding to add a number of pieces - Michael - 11-14-2020

This might be just as much a grammar problem. I'm not sure. But there seems to be no way of choosing to add one rather than another number of pieces. 

What I was originally thinking about was how to implement a decision move where one must decide how many of the top pieces of a stack to move. I began by testing something much simpler, and (as I suspected) the player doesn't have an interface for something like the following:
Code:
        (play
            (or
                (move Add
                    (to (sites Empty))
                    count:1
                )
                (move Add
                    (to (sites Empty))
                    count:2
                )
            )
        )

I have attached an example.


RE: Interface for deciding to add a number of pieces - AlekErickson - 11-15-2020

Then MoveAgain or pass?


RE: Interface for deciding to add a number of pieces - Michael - 11-15-2020

(11-15-2020, 01:49 AM)AlekErickson Wrote: Then MoveAgain or pass?
Yes, that would work. But my point is that what I have written above also should work. As long as it is grammatically correct Ludii should have some way of implementing it. The attached file does compile without any error messages or warnings, but there is no way of making a move.


RE: Interface for deciding to add a number of pieces - Eric Piette - 11-16-2020

Hi,

Yes I agree the GUI should handle that.
I tried and the GUI seems to break on that example.
I am going to look that and ask Matthew to look at it too for the GUI.

Regards,
Eric


RE: Interface for deciding to add a number of pieces - Michael - 11-16-2020

(11-16-2020, 09:16 AM)Eric Piette Wrote: Hi,

Yes I agree the GUI should hangle that.
I tried and the GUI seems to break on that example.
I am going to look that and ask Matthew to look at it too for the GUI.

Regards,
Eric

Great to hear!
Maybe it goes without saying, but I'd love this for (move Remove) and (move <from> <to>) as well.

And the numbers to choose from might be variable. Say you are allowed to move any number of pieces from a stack, from 1 up to (size Stack at:(from)). This sort of case should be handled as well.


RE: Interface for deciding to add a number of pieces - Michael - 11-17-2020

This problem seems to be a bit more general than I thought. Here is a different case that seems to break down:
Code:
(or
    (move Add (to (sites Board)) stack:true)
    (move Remove (sites Board))
)
I can find no way of choosing whether I want to add a piece to the top of a stack or remove one. I hope there is a systematic way of tackling these issues.

(Edit: I forgot to add "count:1" to (move Remove), but it doesn't change the problem.)


RE: Interface for deciding to add a number of pieces - Eric Piette - 11-17-2020

Hi,

Yes that was the same GUI problem, Matthew fixed it with a new dialog to select the decision you want to do.

Regards,
Eric


RE: Interface for deciding to add a number of pieces - Michael - 11-17-2020

Wonderful! I’m guessing that when you move or remove several pieces from a stack the default is to take pieces from the top?


RE: Interface for deciding to add a number of pieces - Eric Piette - 11-17-2020

yes.

Regards,
Eric


RE: Interface for deciding to add a number of pieces - Michael - 11-20-2020

I am very grateful that this has been fixed! Thanks!
I wonder, however, if it would be possible to represent the options graphically (like in the attached mock-up) where this makes sense?