Home 
Search 
Today's Posts 
#1




Repetition and 5 moves
It's time my lame engine learns how to detect draws that are not stalemates. 50 Move Rule: That's 100 plies, that are not pawn moves or captures, right? So I just check if board.halfmoveClock = 100 and return DRAW. Any offbyoneerror? Repetition: That's the same position for the third time, right? So I keep a history of hashes, and search it each node for 2 hits. Any positions to test this stuff? mfg, simon .... tia 
#2




Simon Krahnke wrote:
It's time my lame engine learns how to detect draws that are not stalemates. 50 Move Rule: That's 100 plies, that are not pawn moves or captures, right? So I just check if board.halfmoveClock = 100 and return DRAW. Any offbyoneerror? I don't know. Are you counting from zero or one? Dave.  David Richerby Cheese Laser (TM): it's like an www.chiark.greenend.org.uk/~davidr/ intense beam of light that's made of cheese! 
#3




* David Richerby (12:18) schrieb:
Simon Krahnke wrote: It's time my lame engine learns how to detect draws that are not stalemates. 50 Move Rule: That's 100 plies, that are not pawn moves or captures, right? So I just check if board.halfmoveCount = 100 and return DRAW. Any offbyoneerror? I don't know. Are you counting from zero or one? It starts at zero and is reseted to zero after every capture or pawn move. That's "number of plies since last capture or pawn move." That should be like the FEN definition says. mfg, simon .... l 
#4




Simon Krahnke wrote:
David Richerby (12:18) schrieb: Simon Krahnke wrote: 50 Move Rule: That's 100 plies, that are not pawn moves or captures, right? So I just check if board.halfmoveCount = 100 and return DRAW. Any offbyoneerror? I don't know. Are you counting from zero or one? It starts at zero and is reseted to zero after every capture or pawn move. That's "number of plies since last capture or pawn move." That should be like the FEN definition says. In that case, you have no offbyone error. If the counter is = 100, at least 100 halfmoves have been made without a capture or pawn move. Dave.  David Richerby Slimy Voodoo Spoon (TM): it's like www.chiark.greenend.org.uk/~davidr/ a piece of cutlery that has mystical powers but it's covered in goo! 
#5




Simon Krahnke wrote: Repetition: That's the same position for the third time, right? So I keep a history of hashes, and search it each node for 2 hits. What is the probability of a hash collision? 
#6




* (14:02) schrieb:
Simon Krahnke wrote: Repetition: That's the same position for the third time, right? So I keep a history of hashes, and search it each node for 2 hits. What is the probability of a hash collision? I want to keep a list of hashes, not a hash table where different hash values share a single position. mfg, simon .... l 
#7




Simon Krahnke wrote:
(14:02) schrieb: Simon Krahnke wrote: Repetition: That's the same position for the third time, right? So I keep a history of hashes, and search it each node for 2 hits. What is the probability of a hash collision? I want to keep a list of hashes, not a hash table where different hash values share a single position. Yes but if you have a hash collision (in the sense of two positions having the same hash code), your list will think that a position has been repeated when, in reality, it hasn't. However, the Birthday Theorem says that you need about sqrt(n) different positions in your list before the probability of two of them have the same hash exceeds 1/2. Since you're using 64bit hashes (I hope!), this means you need about 2^32 entries in your list before bad things are likely to happen. Since games of chess are considerably shorter than this, the collision probability is negligible. Dave.  David Richerby OldFashioned Adult Spoon (TM): it's www.chiark.greenend.org.uk/~davidr/ like a piece of cutlery that you won't want the children to see but it's perfect for your grandparents! 
#8




On Mon, 06 Dec 2004 11:20:21 +0100, Simon Krahnke
wrote: It's time my lame engine learns how to detect draws that are not stalemates. Repetition: That's the same position for the third time, right? So I keep a history of hashes, and search it each node for 2 hits. I believe you only need to test for a single repetition to count it as a draw. Even though the rule states a third identical position, in a search tree a single repetition produces the same result. 
#9




* Quantum Anenome (23:09) wrote:
I believe you only need to test for a single repetition to count it as a draw. Even though the rule states a third identical position, in a search tree a single repetition produces the same result. Hm, I think I once read (IIRC Bruce Moreland's site) that this might lead to trouble. But now I think of it, I can't tell why. mfg, simon .... l 
Reply 
Thread Tools  
Display Modes  


Similar Threads  
Thread  Forum  
12 (9?) bits for a move, 276 (274?) bits for a board  rec.games.chess.computer (Computer Chess)  
3move repetition and FEN notation  rec.games.chess.computer (Computer Chess)  
Kaspy vs X3D Fritz PGN  rec.games.chess.misc (Chess General)  
Kaspy vs X3D Fritz PGN  rec.games.chess.computer (Computer Chess)  
Can Shredder evaluate a drawn position without triple repetition?  rec.games.chess.analysis (Chess Analysis) 