Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: 0x88 and move generator speed - My results

Author: Larry Griffiths

Date: 17:39:51 02/01/01

Go up one level in this thread


On February 01, 2001 at 15:26:43, David Rasmussen wrote:

>On February 01, 2001 at 10:37:04, Robert Hyatt wrote:
>
>>
>>You can look at my code named "GenerateCheckEvasions()" but the idea is
>>this (simplified and maybe wrong):
>>
>>1.  If I am checked by a single piece, capture it.
>>
>>2.  If I am checked by a single sliding piece, interpose.
>>
>>3.  If I am checked by either 1 or two pieces, move the king out of the check.
>>
>>for 3, you might think that I have to check for legality after generating a
>>king move, but it isn't needed.  If the checking piece is a slider, I have to
>>move in any direction but +/- the checking direction.  Bitmaps handle all of
>>this easily, so that I can produce moves that I _know_ are legal.
>
>OK, I am aware of the idea of a CheckEvasions() function. I just didn't see
>anybody talking about checking moves only. I assumed you meant you were able to
>generate _all_ moves legally, somehow.

I wrote some bitboard code that sees if the king is in check, or if any pieces
are pinned.  I had to maintain 6 more bitboards to do this.  3 bitboards for
black and 3 bitboards for white which consisted of File and diagonal bitboards.
The overhead of maintaining these bitboards was not any faster at the time I
tested it, than doing my InCheck bitboard code.  I was using the
KingInCheckOrPinnedPieces when I entered a ply to determine if I needed to do
KingInCheck when pieces moved for that ply.  I think I always had to do InCheck
when a King moved.

Larry.



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.