Ludii Forum
Cannot even get "StepToEmpty" to work - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Questions (https://ludii.games/forums/forumdisplay.php?fid=13)
+--- Forum: About Ludii (https://ludii.games/forums/forumdisplay.php?fid=14)
+--- Thread: Cannot even get "StepToEmpty" to work (/showthread.php?tid=225)



Cannot even get "StepToEmpty" to work - slimy_asparagus - 10-30-2020

I worked out that my "Edge" is already defined as "Outer".

Just as an experiment I tried:

Code:
(define "MoveOntoBoard"
    (move
         (from (sites Hand Mover))
         (to (sites Outer))
    )
)

(define "MoveWithinBoard"
    ("StepToEmpty")
)

(game "Hermaphrodites"
    (players 2)
    (equipment
        {
            (board (rectangle 4 3))
        (piece "Cross" Each )
        (hand Each size:1)
        }
    )
    (rules
    (start     {
            (place "Cross1" (handSite 1))
            (place "Cross2" (handSite 2))
        }
    )
        (play
        (or
                ("MoveOntoBoard")
                ("MoveWithinBoard")
        )
        )
    (end (if (no Moves Next) (result Mover Win)))
    )
)
However it is not even recognising the "MoveWithinBoard". I cannot understand what is going on.


RE: Cannot even get "StepToEmpty" to work - Eric Piette - 10-30-2020

Hi,

"StepToEmpty" is a ludemeplex working as a generator of moves for a piece. Then you need to use (forEach Piece) in the playing rules to call it.

So for example here your piece definition should be

Code:
(piece "Cross" Each "StepToEmpty")


and your playing rules should be


Code:
(play
        (or
                ("MoveOntoBoard")
                (forEach Piece)
        )
)


Regards,
Eric


RE: Cannot even get "StepToEmpty" to work - slimy_asparagus - 10-30-2020

Thanks. That starts to make more sense and explains a lot of things I was struggling with. I should probably try to reflect on what I have learnt before proceeding.