-
Notifications
You must be signed in to change notification settings - Fork 8
/
zobrist.cpp
28 lines (22 loc) · 1023 Bytes
/
zobrist.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
Fire is a freeware UCI chess playing engine authored by Norman Schmidt.
Fire utilizes many state-of-the-art chess programming ideas and techniques
which have been documented in detail at https://www.chessprogramming.org/
and demonstrated via the very strong open-source chess engine Stockfish...
https://github.com/official-stockfish/Stockfish.
Fire is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or any later version.
You should have received a copy of the GNU General Public License with
this program: copying.txt. If not, see <http://www.gnu.org/licenses/>.
*/
#include "zobrist.h"
#include "position.h"
uint64_t position::exception_key(const uint32_t move)
{
return zobrist::psq[w_king][from_square(move)] ^ zobrist::psq[b_king][to_square(move)];
}
uint64_t position::draw50_key() const
{
return zobrist::hash_50_move[st_->draw50_moves >> 2];
}