getValidInput :: Player -> IO String
getValidInput player = helper 0 ""
    where helper 1 s = return s
          helper 0 s = do
            x <- getLine
            case checkInput x player of
              Right y -> helper 1 y
              Left  y -> putStr y >> hFlush stdout >> helper 0 ""
getValidInput :: Player -> IO String
getValidInput player = helper 0 ""
    where helper 1 s = return s
          helper 0 s = do
            x <- getLine
            case checkInput x player of
              Right y -> helper 1 y
              Left  y -> putStr y >> hFlush stdout >> helper 0 ""
getValidInput player = helper 0 ""
    where helper 1 s = return s
          helper 0 s = do
            x <- getLine
            case checkInput x player of
              Right y -> helper 1 y
              Left  y -> putStr y >> hFlush stdout >> helper 0 ""