Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Move Generator

Author: Richard Pijl

Date: 05:32:18 12/20/02

Go up one level in this thread


On December 20, 2002 at 06:21:58, Uri Blass wrote:

>On December 20, 2002 at 06:16:52, Uri Blass wrote:
><snipped>
>>I need to check 2 bitboards(if the piece is pinned and not pinned from file
>>direction)
>>Is it faster than if pin[sq]<=0?
>
>Not exactly.
>
>It is the opposite(a pawn that is pinned and not from the file direction cannot
>move forward and if I want to say something positive I should say not pinned ot
>pinned from the file direction).
>
>Uri

For the pinned pieces in the file direction you will have a bitboard 'A'. So by
performing (Rooks | Queens) & ~A you will have a bitboard with all pieces that
can move freely on a file. Same trick can be done with bitboard B for ranks, and
bitboard C and D for the diagonals (with Bishops and Queens). Knights are always
pinned in any direction so you could use any bitboard for that.
So for each direction you only have to do this once, and then you can iterate
over the resulting bitboard to generate the moves for each piece without further
checking for pins.
This may not be faster than what you have now, but searching for pinned pieces
on the board will be much faster.



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.