Computer Chess Club Archives


Search

Terms

Messages

Subject: check detection

Author: Scott Gasch

Date: 16:26:30 08/20/99



Hi,

I've been profiling my program and it looks like the InCheck routine is taking
up most of the processor cycles.  The way I currently do InCheck is by examining
possible threats to a square -- i.e. shoot out vertically and look for
rooks/queens or until I hit a blocking piece/go off the board.  Diagonal for
bishops... pawns, knight and other king... etc.  Of course I stop as soon as any
check is found.

I run InCheck at the end of MakeMove to make sure the side to move didn't expose
himself to check by moving.  I run it again after MakeMove to see if the move
checked the opponent.  These are the only times it ever gets called.

I thought about not checking it at all and just seeing if any move generated
captured a king.  If so then we know the node above us in the tree is illegal
and we are in a non-existent position.  In this case I guess I could just return
beta and get out?

Does anyone have any other ways of handling this?  Is there any faster way to
calculate or deal with check?

Thanks again,
Scott



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.