Ludii Forum
Bug in Reversi - Printable Version

+- Ludii Forum (
+-- Forum: Problems (
+--- Forum: Game Problems (
+--- Thread: Bug in Reversi (/showthread.php?tid=136)

Bug in Reversi - johannes - 08-16-2020

Hello everyone,

there is probably a bug in the reversi implementation that leads to the case of ludii not recognizing a game as finished.

Here are some screenshots:

1) In this case the white player won but the game is still running.
[Image: Unbenannt.png]

2) In this example I created a test double of ludiis Context class with some played moves. Ludii does realise that there aren't any possible moves that can be played correctly but not that the game is over.

[Image: Unbenannt.png]

I use the version 1.0.2

Kind regards

Edit: There is also another bug. When i load an agent from a jar in the ludii user interface it opens a dialog where i can select an agent class that extends the AI class. After selecting my desired class the dialog closes and then opens again. When i select the class a second time it usually works. Since my custom ludii agent is a wrapper that opens a file dialog to select an agent from another framework it is a time consuming task to serve four file dialogs every time instead of two.

RE: Bug in Reversi - DennisSoemers - 08-17-2020

Due to an implementation detail of Ludii, games like this (also Tic-Tac-Toe after the board got filled up) actually do not yet end until both players have also additionally made a "Pass" move afterwards. For human players, the GUI applies this automatically, but AIs are expected to create that move themselves. So that probably explains what you're observing in point 2); you'd have to append two of these pass moves at the end.

This may also explain your point 1). I see in the image that your own custom AI is the next player to move. In your implementation, how did you handle the case where there are no legal moves? This case should be handled by just creating a pass move and returning that. See lines 49 and 50 of our Example Random AI here:

The thing you mention with the dialog pop ups is an issue we did indeed have a long time ago, but that should already have been fixed (since before 1.0.0 even). Currently none of us here can replicate it either. Would you mind sharing your specific JAR file, such that I can test with that? If you prefer not to share it on a public forum like this one, you can also mail a download link for it to me personally at

RE: Bug in Reversi - johannes - 08-17-2020

Thank you! I was looking for something like this. The next days i will reach out to you with more details about the last bug.

Kind regards,

RE: Bug in Reversi - DennisSoemers - 09-01-2020

By the way, as of yesterday's 1.0.5 release it should no longer be necessary to explicitly make your own AI implementations check for the case of 0 legal moves and generate its own pass move in such a case.

Internally, those pass moves are still required to mark the end of the game though, that did not change.