Computer Chess Club Archives


Search

Terms

Messages

Subject: Should I test for hash move legality?

Author: Steve Maughan

Date: 03:52:51 12/29/00


Currently in my program I generate all of the moves then loop through looking
for the hash move, giving it a 'high' move order score went found.  This works
well and is simple to implement.  It would be (much) better to not generate all
of the other maoves and simply take the hash move and play it first, generating
all the other moves if a cutoff is not forthcoming.

This give rise to a problem - how can I be sure that the hash move is legal?

It could be the case that I have a hash collision - yes I use a 64 bit key but
it's still possible - and no doubt it would happen in the final round of the
World Championships just as I was about to slaughter Shredder 8 (;-)) yes in my
dreams I know!!).

I guess I have a series of options:

1) Ignore the possibility and realise that I'll never get to the last round of
the WMCCC.
2) Perform a full legal move check (expensive!)
3) Check that the piece to move is on the expected square
4) Do (3) and check that the destination square is reasonable for the piece to
move but don't bother about checking for sliding peices being blocked.

At the moment I'm favouring (4) as this could be accomplished with a simple
lookup table.

What do others do?  Any advice appreciated!

Regards,

Steve Maughan

PS I use a x88 structure.



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.