flok wrote:I get a lot of "3-fold repetition" endings.
What are ways to prevent this?
If you are talking about repetitions in won positions then I think there might be a bug in the repetition detection itself, since a correct search should not allow the opponent to repeat.
Another question: During search, do you consider the first repetition (= second occurrence) as a draw, or only the second repetition (= third occurrence)? The former is much better.
flok wrote:I get a lot of "3-fold repetition" endings.
What are ways to prevent this?
If you are talking about repetitions in won positions then I think there might be a bug in the repetition detection itself, since a correct search should not allow the opponent to repeat.
That's an interesting point. How can I prevent what the other guy does?
Another question: During search, do you consider the first repetition (= second occurrence) as a draw, or only the second repetition (= third occurrence)? The former is much better.
The fist. I have a std::unordered_map in which I store the hashes of each position. Then if there's a hit, I use a score 0 instead of doing a search().
flok wrote:
That's an interesting point. How can I prevent what the other guy does?
If you don't make a move that is a second repeat, then your opponent can't either.
No, I don't think that's the point. First thing is, positions are repeated, not moves. And my point was, if the (first) repetition of a position X (after 4 or more plies) is detected correctly and the side that is to move in X has a way to avoid the repetition (i.e., can play a better move that leads to a positive score) then the search should be able to find it.
Also "allowing the opponent to repeat" can mean at least two different things:
a) making a move after which my opponent can create a repetition directly with his reply, or
b) making a move after which my opponent can force me to make a move that repeats the position.
Robert Pope wrote:If you don't make a move that is a second repeat, then your opponent can't either.
Actually that is not true. We just had a case with that with Sjaak II in mini-Shogi. There the rule is that a 4-fold repeat is a loss for white. Because such a color asymmetry is not in Sjaaks configurability options, it was set to think any (first) repeat would lose for the player causing the repeat. The idea was that this would then always avoid the loss with white, but perhaps sometimes (against an opponent that did not know the rules) would fail to collect a win by repetition when it played black.
But that was not the case. Sjaak was playing white avoiding all repetitions with its own move. But the opponent, who was aware that black would win on repetition, nevertheless was able to visit the same position 4 times, reaching it from 4 different positions. Sjaak of course had seen that the opponent could repeat, but thought that would be losing for himthe latter, and thus was not afraid to offer the opportunity to do so.