Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Must I do KingInCheck after every move when using BitBoards ?

Author: Dann Corbit

Date: 16:48:37 07/24/00

Go up one level in this thread


On July 24, 2000 at 19:16:01, Larry Griffiths wrote:
>On July 24, 2000 at 17:51:37, Robert Hyatt wrote:
>>
>>Think about this:  99%+ of all moves are perfectly legal.  Do you want to
>>do the incheck test on them to make sure they are legal, which means you do
>>the incheck test for 100% of your moves.  Or do you want to do the "I capture
>>a king to prove your last move was illegal" which only happens 1% of the
>>time.
>>
>>_that_ is the efficiency issue I mentioned.
>>
>>If you use null move you have to be careful, because null move will certainly
>>fail high if you are mated. :)
>>
>
>What I see Bob, is spinning through a piece list at the ply following a move
>generating all capture moves and then searching to see if one of the pieces
>captured was a King, and if so returning the move is illegal.
>
>My current method does not go to the next ply if the king is in check and is
>done after each move is made.
>
>If I move my incheck routine to the next ply and say "is the opponents king in
>check" then return your last move is illegal, then it is only a matter of the
>efficiency of spinning thru a piece list generating all capture moves and
>searching for a king capture VS. using bitboards to see if the king is in check.
>
>Am I still missing something here ?

Check something that happens only very rarely for every move verses return error
status when rare thing happens.  Suppose, naively, that the cost of both
operations is the same, and that 1/100 moves is illegal.

Cost of method 1:
brute cost + 100 * test cost

Cost of method 2:
brute cost + 1/100 * test cost

Which one looks cheaper?




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.