I'm thinking about rewriting my chess engine again. Some months ago, I remember reading something about magic bitboards as an alternative to rotated bitboards. I couldn't find any detailed information about it either in this forum nor via Google though. Is there any public info available somewhere? (if yes, where? :)
I'm also interested in hearing about first hand experience with bitboards and Java. Who is using bitboards in a Java engine? (as primary board representation - not just pawns or something like that) What classes/methods did you find most useful (with respect to speed) for bitboard representation and basic operations set/clear/test?
I've not yet decided whether my next rewrite will be in C++ (again) or Java. I really like Javas portability, but I fear I will miss things like templates. (not to speak of typedef and the const modifier) The current version makes heavy use of templates in the following way:
Code: Select all
class Board
{
[...]
bitboard_t whitePieces;
bitboard_t blackPieces;
[...]
template <colour_t> struct Trait;
};
template <> struct Board::Trait<White>
{
static inline pieces(const Board& b) { return b.whitePieces; };
[...]
};
[and analog for black]
Code: Select all
if(sideToMove == White) { do_this; }
else { do_that; }
Are there any features in Java that would help me here? (v1.6 is OK)
Thanks in advance. :)
Sargon