Computer Chess Club Archives




Subject: An idea to generate rook moves without rotated BBs

Author: Severi Salminen

Date: 08:26:58 10/22/00


I have started again from scratch to program a chess engine, now with C. I came
to this solution to generate rook moves without rotated bitboards:

I wont show you everything :) but here is some code from my mov_gen routine. E
holds all the pieces on board, j is the position of our Rook (0=H1 and 63=A8). F
is an empty bitboard and D holds the horizontal squares which we can move to
(calculated before this)

// Aligning the file info to right corner of bitboard and clearing all other
// bits:

        for(k=0, F=0;k<8;k++)

//After the loop F holds the file info and we can fetch the squares from
//a pre-compiled table and OR them with the horizontal destination squares


What I'd like to know if anyone has tried to compare this method with rotated
bitboards and I'd like to know if this is a lot slower (or faster;). I _must_ do
this loop (which can be optimized a little...) for every rook but I don't have
to update rotated bitboards at all after I make moves. Maybe the net speed is
quite equal and depends on move ordering and so on...Opinions?


This page took 0.04 seconds to execute

Last modified: Thu, 07 Jul 11 08:48:38 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.