checkInput x player
    | x == "skip" || x == "s" = Right "skip"
    | not $ noLetters x = Left str
    | any isSpace x && not (isSpace (last x)) =
        let (sub, end) = break isSpace x
            y = read sub
            l = read end
        in
          if y > 20 && y < 25 || y < 1 || l > 3 || l < 1 
          then Left str
          else Right x
    | read x == 0 = Right x
    | otherwise = Left str
    where noLetters = all (liftM2 (||) isDigit isSpace)
          str = "Invalid input. Please try again.\n" ++ name player ++ ": " 
checkInput x player
    | x == "skip" || x == "s" = Right "skip"
    | not $ noLetters x = Left str
    | any isSpace x && not (isSpace (last x)) =
        let (sub, end) = break isSpace x
            y = read sub
            l = read end
        in
          if y > 20 && y < 25 || y < 1 || l > 3 || l < 1 
          then Left str
          else Right x
    | read x == 0 = Right x
    | otherwise = Left str
    where noLetters = all (liftM2 (||) isDigit isSpace)
          str = "Invalid input. Please try again.\n" ++ name player ++ ": " 
checkInput x player
    | x == "skip" || x == "s" = Right "skip"
    | not $ noLetters x = Left str
    | any isSpace x && not (isSpace (last x)) =
        let (sub, end) = break isSpace x
            y = read sub
            l = read end
        in
          if y > 20 && y < 25 || y < 1 || l > 3 || l < 1 
          then Left str
          else Right x
    | read x == 0 = Right x
    | otherwise = Left str
    where noLetters = all (liftM2 (||) isDigit isSpace)
          str = "Invalid input. Please try again.\n" ++ name player ++ ": " 