Advertisement
Coriic

Untitled

Jun 3rd, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. maxmin (Node node children) color maxLevel =
  2.     exploreTree (Node node children) color 0 maxLevel
  3.     where
  4.         exploreTree (Node _ children) color level maxLevel
  5.             | level>maxLevel = if (level `mod` 2 == 0) then minimum (rateBoards children color) else maximum (rateBoards children color)
  6.             | level `mod` 2 == 0 = maximum (Prelude.map (\board -> (exploreTree board color (level+1) maxLevel)) children)
  7.             | otherwise = minimum (Prelude.map (\board -> (exploreTree board color (level+1) maxLevel)) children)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement