summaryrefslogtreecommitdiff
path: root/minimax.h
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2019-08-08 13:38:09 +0200
committerTom Smeding <tom.smeding@gmail.com>2019-08-08 13:38:09 +0200
commit9badf6db10f02bebb3e72af98d8d86ca9aec59a3 (patch)
treed5f278b5f7d1d339dce0dd13f839d827ed5e2ee0 /minimax.h
parent363d8ea45c53591bda14c6bd9fa8ddfcd47eb487 (diff)
C++; experimenting with pn-searchHEADmaster
Diffstat (limited to 'minimax.h')
-rw-r--r--minimax.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/minimax.h b/minimax.h
new file mode 100644
index 0000000..8c77acd
--- /dev/null
+++ b/minimax.h
@@ -0,0 +1,13 @@
+#pragma once
+
+#include "board.h"
+
+#define MINIMAX_LARGE 10000
+
+
+// Returns:
+// - 1 if player 0 wins
+// - -1 if player 1 wins or can force a draw
+// - 0 if neither player can force a win within the given depth
+template <int player>
+int minimax(const Board &B, int alpha, int beta, int depth);