Reply
 
LinkBack Thread Tools Display Modes
  #1   Report Post  
Old December 6th 04, 10:20 AM
Simon Krahnke
 
Posts: n/a
Default 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 off-by-one-error?

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   Report Post  
Old December 6th 04, 11:18 AM
David Richerby
 
Posts: n/a
Default

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 off-by-one-error?


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   Report Post  
Old December 6th 04, 11:42 AM
Simon Krahnke
 
Posts: n/a
Default

* 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 off-by-one-error?


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   Report Post  
Old December 6th 04, 12:41 PM
David Richerby
 
Posts: n/a
Default

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 off-by-one-error?


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 off-by-one error. If the counter is = 100, at
least 100 half-moves 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   Report Post  
Old December 6th 04, 01:02 PM
Guy Macon
 
Posts: n/a
Default


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   Report Post  
Old December 6th 04, 09:40 PM
Simon Krahnke
 
Posts: n/a
Default

* (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   Report Post  
Old December 7th 04, 05:41 PM
David Richerby
 
Posts: n/a
Default

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 64-bit 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 Old-Fashioned 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   Report Post  
Old December 7th 04, 10:09 PM
Quantum Anenome
 
Posts: n/a
Default

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   Report Post  
Old December 8th 04, 05:04 AM
Simon Krahnke
 
Posts: n/a
Default

* 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
12 (9?) bits for a move, 276 (274?) bits for a board Guy Macon rec.games.chess.computer (Computer Chess) 0 August 16th 04 12:49 AM
3-move repetition and FEN notation Spur rec.games.chess.computer (Computer Chess) 29 February 24th 04 03:52 PM
Kaspy vs X3D Fritz PGN NetSock rec.games.chess.misc (Chess General) 5 December 17th 03 03:10 AM
Kaspy vs X3D Fritz PGN NetSock rec.games.chess.computer (Computer Chess) 4 December 16th 03 01:07 PM
Can Shredder evaluate a drawn position without triple repetition? Dalghetti rec.games.chess.analysis (Chess Analysis) 1 December 1st 03 02:08 PM


All times are GMT +1. The time now is 01:14 PM.

Powered by vBulletin® Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright 2004-2018 ChessBanter.
The comments are property of their posters.
 

About Us

"It's about Chess"

 

Copyright © 2017