aboutsummaryrefslogtreecommitdiff
path: root/include/negamax.h
diff options
context:
space:
mode:
authortslil clingman <tslil@posteo.de>2021-01-28 21:30:30 -0500
committertslil <tslil@posteo.de>2026-08-28 19:37:41 +0100
commita77062ce3dc9a99ad0662010cc7eeb00dd5036a6 (patch)
tree6936b60eb7a8221d38886d0db11953fe6ee56f23 /include/negamax.h
parent473797d820b3b224ee1d370a50e4bcd01d09d48e (diff)
Added license information!
Diffstat (limited to 'include/negamax.h')
-rw-r--r--include/negamax.h48
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;