diff options
Diffstat (limited to 'include/negamax.h')
| -rw-r--r-- | include/negamax.h | 48 |
1 files changed, 35 insertions, 13 deletions
diff --git a/include/negamax.h b/include/negamax.h index b41871e..77461b8 100644 --- a/include/negamax.h +++ b/include/negamax.h @@ -1,30 +1,52 @@ +/* + 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 Takwrap. 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 <xorshift64.h> #include <zobrist.h> +// =================================================================== +// Variables +// =================================================================== + extern const float infty; extern char negamax_ptn[9]; extern uint8_t negamax_search_depth; -extern inline void -negamax_display_progress(const uint8_t, const uint32_t length); +extern void negamax_display_progress(const uint8_t cur_depth, + const uint32_t length); + +// =================================================================== +// Methods +// =================================================================== -void -negamax_init(const uint8_t new_board_size); +void negamax_init(const uint8_t new_board_size); -void -negamax_free(void); +void negamax_free(void); -// Do negamax to depth negamax_search_depth and return PTN of best move -// in negamax_ptn, along with its value as the return. The -// negamax_display_progress function is called on every new square at -// the top level. +/* + * 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); -extern uint8_t yes; |
