Ludii Forum
Leap/turtle walk asymmetry - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Suggestions (https://ludii.games/forums/forumdisplay.php?fid=10)
+--- Forum: Ludii Features / Services (https://ludii.games/forums/forumdisplay.php?fid=11)
+--- Thread: Leap/turtle walk asymmetry (/showthread.php?tid=128)



Leap/turtle walk asymmetry - ccxvii - 08-14-2020

It would be nice to have a strict/exact version of Leap and the turtle walk sites function. As it is, they always apply mirrored and rotational symmetry. Leap has a forward:true option but that doesn't prohibit reflection, but it does prevent convoluted paths that involve a step in the 'backwards' player direction from working at all. The forward:true option also prevents walks that move straight to the side.

(game "LeapTest"
        (players { (player N) (player S) })
        (equipment {
                (board (square 6))
                (piece "Pawn" Each
                        (move
                                Leap { { L F F } { R F F } }
                                forward:true
                                (to if:(is Empty (to))))
                )
        })
        (rules
                (start {
                        (place "Pawn1" {"C2"})
                        (place "Pawn2" {"D6"})
                })
                (play (forEach Piece))
                (end (if (no Moves Next) (result Mover Win)))
        )
)

I looked at the implementation of the Shogi Knight piece, and it uses a complicated chain of apply if:true to do a turtle walk. Understanding the logic of how that move is implemented requires more knowledge about how move generation works, than the documentation provides. It's too much for me to be confident enough to replicate.


RE: Leap/turtle walk asymmetry - cambolbro - 08-15-2020

Hi,

Yes, those initial L and R turns should be recognised but they are not. We'll investigate this and fix it.

Note that 'B' should take a backward step, although this is rarely used in turtle instructions unless backtracking while describing the sites visited by a pattern. 

Regards,
Cameron


RE: Leap/turtle walk asymmetry - Eric Piette - 08-16-2020

Hi,

The "forward:" parameter for the leap move is used to constraint the leap move to move the piece in the forward direction according to the facing direction of the piece (or the player in that case).

But yes we are agree with you for the rotations, so we added a parameter to the leap move in order to not use the rotation for the walk. For example in a square board to leap to the sides at a distance of two that description will do that


Code:
    (piece "Pawn" Each
        (move
            Leap { { L F F } { R F F } }
            rotations:false
        (to if:(is Empty (to))))
    )

of course, for you, that will work only when we will publish the next release.

Consequently for now you can get the same result with a hop move like that:

Code:
(piece "Pawn" Each
            (move
                Hop
                (directions {Rightward Leftward} )
                (between if:true)
                (to if:(is Empty (to)))
            )
 )

Regards,
Eric Piette


RE: Leap/turtle walk asymmetry - ccxvii - 08-17-2020

Thanks!

Please also add the "rotations:false" option to the (sites {{ <stepType> }}) ludeme.


RE: Leap/turtle walk asymmetry - Eric Piette - 08-17-2020

Hi,

Yes we did it too.

Regards,
Eric Piette