Author: Uri Blass
Date: 00:26:36 04/16/03
Go up one level in this thread
On April 16, 2003 at 00:00:07, Mike Siler wrote: >Up until recently, my chess program generated all pseudo-legal moves, made each >move, checked to see if it's in check and unmakes the move if so. This annoyed >me a bit because my attack function that sees if the program is in check was not >too quick. So I came up with a method of avoiding calling the attack function as >often. Assuming the program is not in check at this particular node, we know >that there are only 2 ways the program can enter check: either the program moves >a piece and discovers a check on itself (it was pinned to the king by a sliding >piece) or the king moves into check. I wrote a function to determine which (if >any) of the program's pieces are pinned to its king. Then if a pseudo-legal move >involves the pinned piece, we know already that the movement will cause the king >to be in check, so we don't have to call the time-consuming make_move function, >attack function, or unmake_move function. No, We only know about pinned knight that it cannot move. another pinned piece can capture the pinner or move in the same direction of the pin in part of the cases. There are also other cases that you need to care about illegal enpassant captures. I am not aware to other problems at this moment. > >Of course if the move involves the king, we can't skip the attack function. >Using this method, I experienced a very nice speed-up: from about 300knps to >about 375-400 knps. > >I've never seen another program that uses this. I'm just curious if there is >some down side I don't see or if programs do use this and I just didn't notice. > >Michael The fact that you do not know does not mean that there are not. I use a legal move generator and I use many similiar ideas in updating my attack tables. I will be surprised if most of the top programs without legal move generator do not use that idea. Uri
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.