Author: David Eppstein
Date: 14:46:52 08/29/98
Go up one level in this thread
On August 29, 1998 at 14:11:07, Robert Hyatt wrote: >I hate to follow up on myself, but the above is not exactly the case you >mentioned above: > >>>>I think this power of two thing is a red herring. Even for an 8x8 board you >>>>have to mask so your pieces don't think they can wrap around from one side >>>>of the board to the other. > >When I read that, it implies (to me) that I need a *bigger* mask to handle this >"wraparound", where bigger means more bits than the basic bitboard. That is >completely wrong. No, I meant 8x8 masks, exactly like what you use in that line of code. >In the above example you gave, I generate *all* the pawn moves in one step, >which is faster than generating moves for each pawn separately. But in doing >so, I do have to prevent "wrap" when I shift the pawns diagonally forward for >capture moves, by simply eliminating pawns on the h-file before shifting diag- >onally to the right, and eliminating pawns on the a-file before shifting diag- >onally to the left. But notice both masks are 64 bit masks, and that they are >only used in pawn captures, not normal pawn moves, nor in moves by any other >piece of any type... ...because only the pawn moves really take full advantage of the parallelism available from bitboards. The piece moves are generated one piece at a time, not so differently than what you might do with any other board representation. (I don't have any ideas for how to do piece moves better, though.) >That was my point... the "red herring" caught my attention first, because I >don't have *any* masks of any kind that are longer than 64 bits... in >move generation, evaluation, or anywhere else... All I meant by the "red herring" remark was to counter some previous messages implying that bitboards were simpler for 8x8 boards than they would be for odd-sized boards that don't fit exactly into a machine word (such as in my case 5x9). As far as I can tell, there's nothing magic about powers of two here; using bitboards to implement my 5x9 board is just as easy as it would be with an 8x8 board. I have to mask occasionally to find the bits that are actually on the board, but only in the same type of situation (like pawn move generation) that you use in crafty.
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.