Ludii Forum
Bug related to (can Move) or (priority) - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Problems (https://ludii.games/forums/forumdisplay.php?fid=5)
+--- Forum: Grammar Problems (https://ludii.games/forums/forumdisplay.php?fid=24)
+--- Thread: Bug related to (can Move) or (priority) (/showthread.php?tid=934)



Bug related to (can Move) or (priority) - Michael - 04-21-2022

If you make a random playout of the attached game, then test the ludeme (can Move ("MyMoveHere")), it returns True. And if you print the legal moves, the list will be empty. However, the script looks like this:

Code:
(priority
    (or
        ("SomeMove")
        ("SomeOtherMove")
    )
    ("MyMoveHere")
)

Then why isn't a ("MyMoveHere") move available?

(The macros are just proxies for the real ludemes here. The script doesn't actually look exactly like this. But this is the relevant part.)

(In this script I have replaced the neutral pieces with P1 pieces, so the bug reported in the other thread should be eliminated.)


RE: Bug related to (can Move) or (priority) - Michael - 04-21-2022

I found a way to work around this. I had (priority) inside a (do ifAfterwards), but it works when I instead have (priority) as the outer ludeme and have (do ifAfterwards) around each of the arguments in (priority).