-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAI.hs
25 lines (22 loc) · 795 Bytes
/
AI.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module AI
( search
, module AI.Types
) where
import Types
import AI.Types
import Text.Printf
import qualified AI.API.My as My
import qualified AI.API.Tzaar as Tzaar
import qualified AI.API.GameTree as GameTree
search :: Board b => Algorithm -> Implementation -> Evaluation -> Position b -> Depth -> (PV, Score)
search Minimax My = My.minimax
search AlphaBeta My = My.alphabeta
search Negascout My = My.negascout
search Minimax GameTree = GameTree.minimax
search AlphaBeta GameTree = GameTree.alphabeta
search Negascout GameTree = GameTree.negascout
search Minimax Tzaar = Tzaar.minimax
search AlphaBeta Tzaar = Tzaar.alphabeta
search Negascout Tzaar = Tzaar.negascout
search a i = error $ printf "Unsupported algorithm-implementation pair: (%s, %s)"
(show a) (show i)