Author: Steffan Westcott
Date: 13:12:47 02/23/06
Go up one level in this thread
On February 23, 2006 at 15:02:25, Christopher Conkie wrote: >>>Is there a way to keep board representations entirely in hexadecimal format >>>until output of moves are required. How would one accomplish rotation for >>>diagonals without conversion. For example, is it needed to convert pieces to a >>>number if you started with something like..... >>> >>>typedef unsigned long long bitboard; >>> >>>bitboard B_Occ = 0xffff000000000000ULL; >>>bitboard W_Occ = 0x000000000000ffffULL; >>> >>>bitboard All_P = 0x00ff00000000ff00ULL; >>>bitboard All_N = 0x4200000000000042ULL; >>>bitboard All_B = 0x2400000000000024ULL; >>>bitboard All_R = 0x8100000000000081ULL; >>>bitboard All_Q = 0x1000000000000010ULL; >>>bitboard All_K = 0x0800000000000008ULL; >>> >>>I have been toying with this idea but am not quite sure of the validity of it's >>>basis. I was thinking that if less conversion took place it would improve speed >>>significantly. >>> >>>Any thoughts would be nice. [snip] >I am looking at ways to improve speed without having to use arrays to >rotate for diagonals. > >There is a max of 7 squares in any one specific horizontal, vertical or diagonal >direction for a piece to move to. If we know that, why not have a table that >looks at each of the 8 directions and subsequent squares in turn until a >friendly or opposing piece is found and deal with that accordingly. This would >require a table that is stepped through consisting of the 56 values that shift >up, down or across. Christopher, I cannot comment if the 'purist' bitboard approach is the fastest method available for typical manipulations required in a chess engine. However, I have adopted this approach to better support a 'regular' pattern matching framework, and common subexpression elimination. I postpone bit scanning/serialisation (and conversion to square co-ordinates) as much as possible. You may find an old post of mine of interest, which talks about direct generation of attack/move bitboards for sliding pieces which also takes occluders (blocking pieces) into account: http://chessprogramming.org/cccsearch/ccc.php?art_id=261956 There are no rotated bitboards nor lookup tables used. Cheers, Steffan
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.