aboutsummaryrefslogtreecommitdiff
path: root/include/negamax.h
blob: f56f4059212260cf48b6949444849c64ce2230a5 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
	This file is part of ct.

	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 ct. If not, see <https://www.gnu.org/licenses/>.
*/

#include <stdint.h>
#include <math.h>

#include <tak.h>
#include <actions.h>
#include <cnn1986.h>
#include <tt_llcht.h>
#include <zobrist.h>

// ===================================================================
// Variables
// ===================================================================

extern const float infty;
extern char negamax_ptn[9];
extern uint8_t negamax_search_depth;

extern void negamax_display_progress(const uint8_t cur_depth,
																		 const uint8_t init_depth,
																		 const uint32_t length);

// ===================================================================
// Methods
// ===================================================================

void negamax_init(const uint8_t new_board_size);

void negamax_free(void);

/*
 * Do α-β negamax with transposition tables and naïve move ordering to
 * depth `negamax_search_depth' and store the PTN of best move in
 * `negamax_ptn', and return its value. The `negamax_display_progress'
 * function is called on every new square at the top level.
 */
float negamax_generate(void);