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