Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- main :: IO()
- main = do
- putStr "Enter number to guess: "
- line1 <- getLine
- let a = read line1 :: Int
- guessTheNum a
- guessTheNum :: Int -> IO()
- guessTheNum num = do
- input <- getLine
- let n = read input :: Int
- if num == n then
- putStrLn "Yes"
- else
- if num > n then
- do
- putStrLn "UP"
- guessTheNum num
- else
- do
- putStrLn "DOWN"
- guessTheNum num
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement