From a77062ce3dc9a99ad0662010cc7eeb00dd5036a6 Mon Sep 17 00:00:00 2001 From: tslil clingman Date: Thu, 28 Jan 2021 21:30:30 -0500 Subject: Added license information! --- include/negamax.h | 48 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 13 deletions(-) (limited to 'include/negamax.h') 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 . +*/ + #include #include #include - #include #include #include -#include #include +// =================================================================== +// 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; -- cgit v1.2.3