Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Idea for check function

Author: Robert Hyatt

Date: 22:08:28 11/14/02

Go up one level in this thread


On November 14, 2002 at 22:26:28, Zach Wegner wrote:

>I was thinking one day when i had free time about how to speed up my engine a
>little. I thought of an idea for my check() function, and i was wondering if
>this would work properly. In the function, it would check the to and from
>squares of the last move made, determine the position of the squares relative
>the king (this uses 0x88), and check if a)the piece moved could attack from the
>to square, or b)find a piece on the ray of the from square and see if it attacks
>the king. This would only be used if we werent seeing if a king move would be
>legal. So, are there any types of moves that would cause this to fail?


En passant captures for one.  The pawn that is removed is on a different
square than the from/to squares of the pawn making the capture.

Castling is another.



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.