Ludii Forum
Error in shobu - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Problems (https://ludii.games/forums/forumdisplay.php?fid=5)
+--- Forum: Game Problems (https://ludii.games/forums/forumdisplay.php?fid=17)
+--- Thread: Error in shobu (/showthread.php?tid=676)



Error in shobu - fbarbe - 08-16-2021

Hi,

As posted here, I managed to find a case where Ludii allowed to push two opponent pieces in the aggressive move. This is not allowed by the rules.
I originally wrote that this only happens in diagonal moves, but that it not the case. I have attached another trial with this issue. The issue is in the second option of the "or" statement in the aggressive move. It only checks if the spot two pieces ahead is empty, but it should in fact check for three.

Code:
(and {
    (= ("LastDistance") 2)
    (is Enemy (who at:(ahead (from) "LastDirection")))
    (is Empty (ahead (from) steps:2 "LastDirection"))
    (is Empty (ahead (from) steps:3 "LastDirection"))
})
(I added that last line, which is not there in the original code).

This however doesn't let the aggressive move simply push the stone to the boarder, as ahead of 3 can be out of the 4x4 board grid.

I am not sure how to make it check ahead of 3 only if ahead of three exists.

Best,
Fabio


RE: Error in shobu - Eric Piette - 08-18-2021

Hi Fabio,

Thanks for that :)
I fixed it as you suggested + the check if step 3 is existing.
The file will be updated with the next release. However, here is the file, just in case you want to test it before.


Regards,
Eric