maxPlay :: String -> String -> [Move] -> [Move] -> Int
maxPlay player team moves availableMoves
    | (winner moves) == Just team = 1
    | (winner moves) == Just (oponent team) = -1
    | (winner moves) == Just "0" = 0
    | otherwise =
        let
            mapped = map (\move -> minPlay (oponent player) team (makeMove player move moves) (availableMoves \\ [move])) availableMoves
        in
            maximum mapped
maxPlay :: String -> String -> [Move] -> [Move] -> Int
maxPlay player team moves availableMoves
    | (winner moves) == Just team = 1
    | (winner moves) == Just (oponent team) = -1
    | (winner moves) == Just "0" = 0
    | otherwise =
        let
            mapped = map (\move -> minPlay (oponent player) team (makeMove player move moves) (availableMoves \\ [move])) availableMoves
        in
            maximum mapped
maxPlay player team moves availableMoves
    | (winner moves) == Just team = 1
    | (winner moves) == Just (oponent team) = -1
    | (winner moves) == Just "0" = 0
    | otherwise =
        let
            mapped = map (\move -> minPlay (oponent player) team (makeMove player move moves) (availableMoves \\ [move])) availableMoves
        in
            maximum mapped