summaryrefslogtreecommitdiff
path: root/minimax.h
blob: 8c77acdb3303560a17969f843446cfcbfd80d065 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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);