mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Better self-document init_zobrist()
No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
47959c56fd
commit
b3a0b389d2
2 changed files with 9 additions and 8 deletions
|
@ -212,8 +212,8 @@ void init_bitboards() {
|
|||
{}, {}, {}, { 9, 7, -7, -9, 8, 1, -1, -8 } };
|
||||
|
||||
for (Color c = WHITE; c <= BLACK; c++)
|
||||
for (Square s = SQ_A1; s <= SQ_H8; s++)
|
||||
for (PieceType pt = PAWN; pt <= KING; pt++)
|
||||
for (PieceType pt = PAWN; pt <= KING; pt++)
|
||||
for (Square s = SQ_A1; s <= SQ_H8; s++)
|
||||
for (int k = 0; steps[pt][k]; k++)
|
||||
{
|
||||
Square to = s + Square(c == WHITE ? steps[pt][k] : -steps[pt][k]);
|
||||
|
|
|
@ -1793,16 +1793,17 @@ bool Position::is_mate() const {
|
|||
|
||||
void Position::init_zobrist() {
|
||||
|
||||
int i,j, k;
|
||||
RKISS rk;
|
||||
|
||||
for (i = 0; i < 2; i++) for (j = 0; j < 8; j++) for (k = 0; k < 64; k++)
|
||||
zobrist[i][j][k] = rk.rand<Key>();
|
||||
for (Color c = WHITE; c <= BLACK; c++)
|
||||
for (PieceType pt = PAWN; pt <= KING; pt++)
|
||||
for (Square s = SQ_A1; s <= SQ_H8; s++)
|
||||
zobrist[c][pt][s] = rk.rand<Key>();
|
||||
|
||||
for (i = 0; i < 64; i++)
|
||||
zobEp[i] = rk.rand<Key>();
|
||||
for (Square s = SQ_A1; s <= SQ_H8; s++)
|
||||
zobEp[s] = rk.rand<Key>();
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
for (int i = 0; i < 16; i++)
|
||||
zobCastle[i] = rk.rand<Key>();
|
||||
|
||||
zobSideToMove = rk.rand<Key>();
|
||||
|
|
Loading…
Add table
Reference in a new issue