Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Rough comparison between rotated bitboards and 0x88 -tests for check

Author: James Robertson

Date: 11:49:44 06/20/00

Go up one level in this thread


On June 20, 2000 at 07:29:12, Mike Curtis wrote:

>On June 20, 2000 at 04:51:39, Tony Werten wrote:
>
>>On June 20, 2000 at 04:48:05, James Robertson wrote:
>>
>>>On June 20, 2000 at 04:44:57, Tony Werten wrote:
>>>
>>>>On June 20, 2000 at 03:50:36, James Robertson wrote:
>>>>
>>>>>On June 20, 2000 at 03:09:49, Tony Werten wrote:
>>>>>
>>>>>>On June 19, 2000 at 19:54:39, James Robertson wrote:
>>>>>>
>>>>>>>On June 19, 2000 at 19:48:36, Larry Griffiths wrote:
>>>>>>>
>>>>>>>>I have found bitboards to be an even trade-off on my Pentium system.  I have to
>>>>>>>>update about 6 bitboards when a piece moves and this generates a lot of
>>>>>>>>instructions.  I get it back in my IsKingInCheck code so it evens out.
>>>>>>>
>>>>>>>While detecting check is faster with bitboards if you have many pieces on the
>>>>>>>board, I think it is actually slower in endgame positions. :(
>>>>>>
>>>>>>I don't understand this. I have written it before but here it is again. You only
>>>>>>have to look at the to and from square of the last move.
>>>>>
>>>>>I do not understand.... could you please elaborate?
>>>>
>>>>Sure,
>>>>
>>>>If you exclude a rochade, a check can only occur in 2 ways.
>>>>
>>>>1) The piece last moved is giving check ( on the to-square )
>>>>2) The piece just moved revealed a slider which is giving check. ( behind the
>>>>from square )
>>>>
>>>>The code should look something likes this. ( there might be some mistakes)
>>>>
>>>>if (last_move==rochade)
>>>>{
>>>>   square=king_square;
>>>>   if (possible to attack square from rook_square)
>>>>   {
>>>>     repeat
>>>>        square+=dir_of_rook;
>>>>     until (square!=empty)
>>>>   }
>>>>   return (square==rook_square)
>>>>}
>>>>
>>>>if (possible for moved_piece to attack king_square from to_square)
>>>>{
>>>>   if moved_piece==KING,KNIGHT or PAWN then return (true)
>>>>   square=king_square;
>>>>   repeat
>>>>        square+=dir_of_to_square;
>>>>   until (square!=empty)
>>>>   if (square==to_square return) (true)
>>>>}
>>>>
>>>>if (possible for BISHOP or ROOK to attack king_square from from_square)
>>>>{
>>>>    square=king_square;
>>>>    repeat
>>>>       square+=dir_of_from_square;
>>>>       if (square!=empty) then return (piece_on_square can attack king_square)
>>>>    until (square is not on board)
>>>>}
>>>>
>>>>return false;
>>>>
>>>>cheers,
>>>
>>>
>>>This idea looks nice. I think I can use it to improve my existing code....
>>>Thanks!
>>
>>You're welcome. But I prefer if you let me win on the next dutch championships.
>>
>>Tony
>>
>
>Screening for checks by examining the the previous move:
>
>http://www.icdchess.com/forums/1/message.shtml?113751
>
>posted 2 weeks ago.
>
>FathomEngine
>-Mike

Heh... I like the incheck = NOPE line. I think I will #define false NOPE in my
program. :)

James



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.