(is Loop) does not always detect it when a loop is formed. I have attached a simple example. I don't think the issue only affects shared pieces, but I don't have any trials to prove it.
06-07-2021, 07:04 AM
Hi,
The current implementation of (is Loop ...) is looking only for the colour of a specific player, so it does not look for shared pieces. I will improve that later in the same time of the BooleanFunction I talked about in your other post. Regards, Eric
06-07-2021, 05:25 PM
(06-07-2021, 07:04 AM)Eric Piette Wrote: (is Loop ...) is looking only for the colour of a specific playerThis is not my experience.. Or, it also misses loops that are exclusively by one player. In the attached .lud both players place "Disc1". Still some loops go undetected. I tested whether this means that all the pieces in the loop must be placed by the same player, but that is also irrelevant. In "undetected loop 1.trl" the undetected loop contains Disc1-pieces placed by both players, but so does the detected loop. And in "undetected loop 2.trl" there is an undetected loop consisting of only Disc1 and one player placed all those pieces.
06-07-2021, 05:39 PM
(This post was last modified: 06-07-2021, 05:40 PM by Eric Piette.)
Hi,
Unfortunately, when you use only (is Loop), the player placing the piece is relevant, because if you look at the documentation of (is Loop) when no colour has been specified the colour of the mover is taken. Consequently here, when P2 is playing, that ludeme is trying to find a loop with the pieces of P2. To do what you want with the pieces of P1, you have to use (is Loop (id P1)). But the detection of Loop is working with the correct parameters. However, I will improve that ludeme to be more generic like I said to you in my previous messages, so when I will do that, the description of (is Loop) is going to change anyway. Regards, Eric
06-07-2021, 05:46 PM
Hm. I must be misunderstanding something, because I just showed you a detected loop that consists of pieces placed by both players. It sounds like you're saying that this should not have been detected.
06-07-2021, 05:50 PM
Hi,
The components on the loop are the only factor to detect a loop. However in your description, you use (is Loop) meaning you look for a loop with the pieces of the mover and starting from the last piece placed. So when the player P1 is placing a piece which is closing a loop with the pieces of your example you detect it. And when P2 is playing you will never detect a loop because the pieces of P2 are not on the board. Regards, Eric
06-07-2021, 05:53 PM
Ah, ok. Thanks for that explanation!
06-09-2021, 10:50 PM
(This post was last modified: 06-09-2021, 10:55 PM by AlekErickson.)
This game, I made a loop, and then Ludii didn't recognize it as a loop.
Then, the computer made a loop, and it recognized it as a loop and it won. Something must still be wrong with the (is Loop), because I saw no difference between my loop and the AI's loop. EDIT: made another trl, where a bona fide loop went unrecognized for several turns.
06-10-2021, 07:02 AM
Hi,
Like I said to Michael, I will make it more general later and consequently test many more cases in doing that. So because I have to probably rewrite a lot of parts of the code of (is Loop) I am not going to look for the current implementation. Regards, Eric |
|