summaryrefslogtreecommitdiff
path: root/minimax.h
diff options
context:
space:
mode:
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);