aboutsummaryrefslogtreecommitdiff
path: root/include/zobrist.h
blob: 27053a660f02ffffa156d02acb9e4fa52544f719 (plain)
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
29
30
31
32
/*
  This file is part of ctak.

  This program 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
  (at your option) any later version.

  This program is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with ctak. If not, see <https://www.gnu.org/licenses/>.
*/

#include <actions.h>
#include <tak.h>
#include <xorshift64.h>

#define PLY_PARITY_MAGIC 0x9E3779B97F4A7C15ULL

void zobrist_free(void);

int zobrist_init(const uint8_t board_size);

// hash for whole state
uint64_t zobrist_compute(tak_state_p state);

// hash contribution from a single board cell at location l
uint64_t zobrist_cell(tak_state_p state, const uint8_t l);