Author: KarinsDad
Date: 10:37:49 12/23/03
Go up one level in this thread
On December 23, 2003 at 11:24:43, Robert Hyatt wrote: >>>An array of 64 elements (or more) one for each square. >> >>Each element would need the 4 bit piece (e.p. pawn, castle rook, side to move >>king, empty, and white and black for 6 piece types). 64 elements * 4 bits = 32 >>bytes > >I don't quite follow. You need _one_ side to move bit, wtm=1, btm=0, for >the _entire_ position, not for each square. It _really_ sounds like we >are talking about two different kinds of "positions"... I was talking about replacing the white king with a "side to move" king when it is whites turn to move and the black king with a "side to move" king when it is whites turn to move. So, the following position: ........ ...k.... ........ ........ ........ ........ ........ .RK..... would be stored as: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0100 0011 0000 0000 0000 0000 0000 if it was white to move (where an empty space is 0000, a white rook is 0100, a white king is 0010, a black king is 0001, and a side to move king is 0011, spaces added for ease of readability). It would be stored as: 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0011 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0100 0010 0000 0000 0000 0000 0000 if it was black to move. But, now that people have refreshed my mind a little more about hashing (it's been over 3 years since I've thought about this stuff and I'm not getting any younger :) ), this type of data structure might be used to store a position in a file, but not in memory while searching.
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.