Author: Robert Hyatt
Date: 20:19:00 12/24/03
Go up one level in this thread
On December 24, 2003 at 21:23:46, Toni wrote: >Hi all. > >I'm starting my chess engine and I'm dealing with bitboards. I find natural to >code the board as: > >a8 ... h8 >. . >. . >. . >a1 ... h1 > >so bit0 = h1 and bit 63= a8, viewing the board from white's point of view. > >In the literature and in some engines other bitboards are used. For example, >beowulf uses: > >h1 ... a1 >. . >. . >. . >h8 ... a8 > >Is there a reason for that? > >Regards > >Toni The main issue is how bits are numbered. In the Intel world, the LSB is bit 0, the MSB is bit 63. In the Cray world, using the "leading zero" makes the MSB bit 0, the LSB bit 63. I chose the latter in Crafty as it was initially targeted for the Cray. I now have to "fiddle" with my bit numbers, by continually doing 63-bit to convert Cray to Intel. If you are targeting Intel, I would use LSB=0. What you use to represent a1 or whatever is meaningless as far as performance. I personally use bit 0 = a1, bit 1 = b1, ..., bit 63 = h8, because I can visualize that easily. So as far as what means what, do what feels right. But number the bits for Intel...
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.