Author: Tony Werten
Date: 08:50:40 05/08/01
Go up one level in this thread
On May 08, 2001 at 01:58:00, Alex Boby wrote: > >This has probably been asked a thousand times in the past so sorry for asking >but I grep'd the archives and didn't find anything satisfying so here goes... > >How do most people deal with hash key collisions (2 positions, same key)? These >cause problems for me currently because of illegal moves. I figure that there >are 2 solutions... > >1) store the actual unique board position in the hash record for comparision. >2) check the moves stored in the hash table to see if they are valid before >using them. > >1 doesn't seem like a plausible solution (gigantic hash records) and 2 seems >like it would be slow unless I could find a trick to do it easily. > >Is there a standard solution to this problem? Check the move. Normally move has a fromsquare, tosquare, frompiece and topiece. First check if frompiece is on fromsquare and topiece is on toquare and if the color of topiece is different from frompiece. Then I have an attacktable (works great in 0x88) where I can lookup if piece a on square b can attack square c. When these conditions are met I accept the move. Not only because it's likeliy the move is ok, but mainly because it won't make my engine crash anymore. ( I do the left_my_own_king_in_check check when I make the move) Tony > >Alex
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.