Ludii Forum
Move Stacks like in game Bashni but without Hop - 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: Move Stacks like in game Bashni but without Hop (/showthread.php?tid=1002)

Pages: 1 2


Move Stacks like in game Bashni but without Hop - noobby - 06-10-2022

Hi, 
I like the game 'Bashni' very much, the Stack-movement is really nice.

When trying to create a simple test-game where the stacks can move around freely, 
the following construction with  (move from to ) doesn't work:

Code:
(piece "Disc" Each (move (from )
                         (to (difference (sites "Board") (from)) )
                   
                         //    count:(size Stack at:(from))  // ?
                                
                         stack:True
                    )
)

The  stack:true  seems to have no effect.  Why is that ?
(I searched hours in the 'Ludii Language Reference' and many other games but with no results.)

When using the (count: ) line it moves only the disc at level:0 in the stack at first and the others follow when the moved piece is droped at another stack, for example. This kind of movement looks awkward. 
Moving the whole disc-towers around is the behavior i'm looking for.

If anybody could help with this would be really great.

Regards, 
Ben


RE: Move Stacks like in game Bashni but without Hop - noobby - 06-11-2022

.. and this is how the movement of the stacks should look like : 

1) Move as one piece.
2) Top disc defines the owner of the stack.  
(this is also wrong in the Free Discs.lud example of the first post.)

But unfortunately this 'movement as one piece' doesn't work for the Free Discs. 

attached: Nicely Hopping Stacks,
but the red points should be all over the board for free movement.
 

Regards, Ben


RE: Move Stacks like in game Bashni but without Hop - Eric Piette - 06-13-2022

Hi,

I looked at your first message and I discovered that the parameter stack:True in a (fromTo ...) or (move (from ...) (to ...)) was not checked. This explained the reason why you were not able to move a full stack from a site to another with this ludeme.

I fixed this. This will be in the next release (probably close to the end of the month).

So just to be clear, to move the full stack, you just have to specify "stack:True". The count: parameter is not for stacking game but for games with many pieces in the same site (like the Mancala games).


RE: Move Stacks like in game Bashni but without Hop - noobby - 06-14-2022

Thanks a lot for your answer, Eric !
I'm really relieved, because for days I tried zillions (sic!; ) of different syntax combinations that might work and searched & studied the LanguageReference from top to bottom and back (which can be very frustrating..) 
But since I believe that the potential of ludii is really great, I hang in there.

Many things can be done in different ways (like with stack size and count etc.), but here there is no trick to get around this basic problem, it seems.  

btw: I copied all the existing .lud files into one big textfile (~7MB), which is very good for searching for code-snippets in all the 1128 games simultaneously.

And your 'CountInStack'-answer already helped me a lot. 
I wouldn' have found this in weeks. don't understand yet, where the (to) comes from.


RE: Move Stacks like in game Bashni but without Hop - Michael - 06-14-2022

(06-14-2022, 11:10 AM)noobby Wrote: And your 'CountInStack'-answer already helped me a lot. 
I wouldn' have found this in weeks. don't understand yet, where the (to) comes from.

Code:
(define "CountInStack"
    (count Stack
        at:#1
        if:(= #2 (who at:(to) level:(level)))
    )
)

Maybe this helps to understand the "(to)". 
Consider the following paraphrase of that ludeme: Go through the pieces in the stack located at site #1 and count a piece if the owner of that piece is #2.

The "(to)" in the ludeme corresponds to the phrase "that piece" in my paraphrase.


RE: Move Stacks like in game Bashni but without Hop - noobby - 06-14-2022

Thanks Michael, (it was your answer, right!)
for the #1 I used the classic '(last To)', so I thought it has to be used in the at:(), too.
but 'at:(last To)' also compiles anyway, as I tested now.
and the second '(level)' is then like a variable in the count-loop, which goes through all levels, I guess.


RE: Move Stacks like in game Bashni but without Hop - noobby - 06-18-2022

(06-13-2022, 09:38 AM)Eric Piette Wrote: Hi,

I looked at your first message and I discovered that the parameter stack:True in a (fromTo ...) or (move (from ...) (to ...)) was not checked. This explained the reason why you were not able to move a full stack from a site to another with this ludeme.

I fixed this. This will be in the next release (probably close to the end of the month).

So just to be clear, to move the full stack, you just have to specify "stack:True". The count: parameter is not for stacking game but for games with many pieces in the same site (like the Mancala games).

Hi Eric,
I experimented with (move Leap {..}   )  now and saw that it is automatically stacking on Enemies (when nothing else is specified in apply like in the LogicGuide example), but not in a way, that the top piece defines the owner of the stack. 
maybe that's because the Leap ludeme has no stack:true  option in it, if i understood the LanguageRev correctly.

Is this the same reason like in your quote above?, and could the  stack:true  option be added to the Leap move too ?


RE: Move Stacks like in game Bashni but without Hop - Eric Piette - 06-22-2022

Hi,

I need you to provide a full .lud example to see what you mean. Could you?

Eric


RE: Move Stacks like in game Bashni but without Hop - noobby - 06-23-2022

Yes, here it is. Sorry that I did'n include an example but I thought the question was about Leap in general.
It was about leaping on an enemy-piece and if it could be useful to have a [stack:true] parameter in the Leap-move too (like in Hop).
But if it is not planned to add this for Leap its ok, not everything has to be stackable.


RE: Move Stacks like in game Bashni but without Hop - dale walton - 06-23-2022

I am running into a similar issue with push.  Documentation has it pushing rows of pieces, but I used stacking in the handsite to hold pieces for the game Bide, and the push is now just pushing the piece onto a stack on the regular board - which is NOT what I want - but there is no option for stack:False in (push

-------------------------------
I doesn't have anything to do with the use of stacking in the handsites. So I don't know if this is a bug or a compiler adaptation... but in either case a hard-core  indication of the proper behaviour  would be good.