Think of a bitboard version of TCSP

Having a busy full-time dayjob, and more hobbies, this is going to be a long-term project (months, maybe years).
http://www.sluijten.com/winglet/
Moderator: Ras
Thanks, looking forward to following this!sluijten wrote:I started a website on writing a bitboard engine, step-by-step.
Think of a bitboard version of TCSP, with Winboard support.
Having a busy full-time dayjob, and more hobbies, this is going to be a long-term project (months, maybe years).
http://www.sluijten.com/winglet/
Code: Select all
if (GEN_SLIDING_ATTACKS[(RANKS[square]-1) < (FILES[square]-1) ? (RANKS[square]-1) : (FILES[square]-1)][state6Bit] & CHARBITSET[attackbit])
Code: Select all
// DIAGA1H8_ATTACKS attacks (BISHOPS and QUEENS):
for (square = 0; square < 64; square++)
{
for (state6Bit = 0; state6Bit < 64; state6Bit++)
{
DIAGA1H8_ATTACKS[square][state6Bit] = 0x0;
for (attackbit = 0; attackbit < 8; attackbit++) // from LSB to MSB
{
// conversion from 64 board squares to the 8 corresponding positions in the GEN_SLIDING_ATTACKS array: MIN((8-RANKS[square]),(FILES[square]-1))
if (GEN_SLIDING_ATTACKS[(RANKS[square]-1) < (FILES[square]-1) ? (RANKS[square]-1) : (FILES[square]-1)][state6Bit] & CHARBITSET[attackbit])
{
// the bit is set, so we need to update FILE_ATTACKS accordingly:
// conversion of square/attackbit to the corresponding 64 board file and rank:
diaga1h8 = FILES[square] - RANKS[square]; // from -7 to 7, longest diagonal = 0
if (diaga1h8 < 0)
{
file = attackbit + 1;
rank = file - diaga1h8;
}
else
{
rank = attackbit + 1;
file = diaga1h8 + rank;
}
if ((file > 0) && (file < 9) && (rank > 0) && (rank < 9))
{
DIAGA1H8_ATTACKS[square][state6Bit] |= BITSET[BOARDINDEX[file][rank]];
}
}
}
}
}
Don't forget to put lots of assert, and to check that your perft values are correct. This part can be a real nightmare, but you cannot skip itsluijten wrote:Current functionality of winglet is:
read a FEN string from a file & setting up the board manually
bitboard move generator
evaluation function
alpha-beta pvs search
mate, draw and repetition detection (using hash keys)
iterative deepening and move ordering
Next on the list will be:
quiescence and SEE
Null move pruning
Time control and running test suites
Connecting to Winboard