Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Movegenerator and prevent check

Author: Charles L. Williams

Date: 08:28:33 06/13/99

Go up one level in this thread


On June 13, 1999 at 09:59:20, Michel Langeveld wrote:

>I'm wondering what's the best way to write a movegenerator which prevents
>invalid moves(because of check).


I've been making the move and checking the legality afterward.  This seems to be
the way most programs do it.  Otherwise, you have to take pins into
consideration.  Not so bad for knights, but if it's a slider, then you have to
consider the direction of the pin.

For example, a rook pinned by another rook can still move two out of four
directions.  It get complicated after a while, and the overhead begans to slow
things down.  But during an alpha-beta search, many moves are never made because
of cutoffs, so the legality is never checked anyway.


Chuck



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.