Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Move Generator

Author: Gerd Isenberg

Date: 03:59:07 12/20/02

Go up one level in this thread


On December 20, 2002 at 06:40:08, Russell Reagan wrote:

>On December 20, 2002 at 03:37:09, Gerd Isenberg wrote:
>
>>I do it in IsiChess and i guess a lot of bitboarders too.
>
>Hi Gerd,
>
>What method do you use to accomplish this? I have always had problems when I
>tried to generate only legal moves. How do you handle positions with pinned
>pieces? And, how do you handle a position like the following?
>
>[D]8/8/8/k1K5/8/8/8/R7 w - - 0 1
>
>When I tried to write a legal move generator I had a problem with these kinds of
>positions. Instead of declaring checkmate, the black king would move to a6,
>because in the position in the diagram, the square a6 is not attacked, so my
>program thought it was safe to move there.
>
>Are there more cases than the two I mentioned?
>
>1. Pinned pieces
>2. King moving to an unattacked, but unavailable square.
>
>Russell

Hi Russell,

For pinned pieces see:
http://www.talkchess.com/forums/1/message.html?271932

For king move generation (not only if king in check):

I use a special (mmx) fill routine, to get all attacks from all enemy pieces.
Two Kogge-Stone fills for rooks/queens, bishop/queens, single fills for knights,
pawns and king. During this routine i temporary remove the (checked) king from
the occupied bitboard, so checking sliders x-ray the checked king square.

Gerd






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.