Author: blass uri
Date: 12:16:07 08/03/00
Go up one level in this thread
On August 03, 2000 at 14:16:17, Tom Kerrigan wrote: >In TSCP's existing function, is it possible to use bitfields for piece types >instead of simply incrementing and decrementing the squares of the board? > >-Tom I do not see a way that bitfields for piece type can be used to avoid incrementing and decrementing the squares of the board. The only way that I see to avoid it is generating a 64*64 array It may be possible to use bitfields for piece and colour to avoid the array color[64] because piece[64] may include all the information for example: WHITE 1 BLACK 2 PAWN 4 KNIGHT 8 BISHOP 16 ROOK 32 QUEEN 64(maybe 48 is better because Queen can move like a rook or a bishop) KING 128 in this case I can save time by avoiding the double check if (piece[i]==piece[j]&&color[i]==color[j]) and I can check(if I want) only the original piece[i]=piece[j] by checking if piece[i]&252=piece[j]&252 or only color[i]=color[j] by piece[i]&3=piece[j]&3(0 if EMPTY,1 if WHITE and 2 if BLACK) Uri
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.