minPlay :: String -> String-> [Move] -> [Move] -> Int
minPlay 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 -> maxPlay (oponent player) team (makeMove player move moves) (availableMoves \\ [move])) availableMoves
        in
            minimum mapped
minPlay :: String -> String-> [Move] -> [Move] -> Int
minPlay 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 -> maxPlay (oponent player) team (makeMove player move moves) (availableMoves \\ [move])) availableMoves
        in
            minimum mapped
minPlay 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 -> maxPlay (oponent player) team (makeMove player move moves) (availableMoves \\ [move])) availableMoves
        in
            minimum mapped