loop :: String -> Int -> [Move] -> [Move] -> [Move]
loop player pos moves available
    | pos < 9 && (moveExistAtPos pos moves) == False  = 
        let
            (x, y) = posToCoords pos
        in
            loop player (pos + 1) moves (available ++ [(Move x y player)])
    | pos < 9  = (loop player (pos + 1) moves available)
    | otherwise = available
loop :: String -> Int -> [Move] -> [Move] -> [Move]
loop player pos moves available
    | pos < 9 && (moveExistAtPos pos moves) == False  = 
        let
            (x, y) = posToCoords pos
        in
            loop player (pos + 1) moves (available ++ [(Move x y player)])
    | pos < 9  = (loop player (pos + 1) moves available)
    | otherwise = available
loop player pos moves available
    | pos < 9 && (moveExistAtPos pos moves) == False  = 
        let
            (x, y) = posToCoords pos
        in
            loop player (pos + 1) moves (available ++ [(Move x y player)])
    | pos < 9  = (loop player (pos + 1) moves available)
    | otherwise = available