New paste Repaste Download
potatoFunction :: Int -> String
potatoFunction num
     | num <= 3 = "aww. I hope you have a good day!"
     | num <= 5 = "a little better. hope your days get better!"
     | num <= 10 = "nice! have an excellent day!"
     | otherwise = "please enter a number between 1 and 10"
convert :: String -> Int
convert x
    | x == "0" = 0
    | x == "1" = 1
    | x == "2" = 2
    | x == "3" = 3
    | x == "4" = 4
    | x == "5" = 5
    | x == "6" = 6
    | x == "7" = 7
    | x == "8" = 8
    | x == "9" = 9
    | x == "10" = 10
    | otherwise = 11
main :: IO ()
main = do
  putStrLn "between 1 and 10, hows your day going?"
  strn <- getLine
  print (potatoFunction (convert strn))
Filename: chicken.hs. Size: 681b. View raw, , hex, or download this file.

This paste expires on 2025-01-29 02:49:01.691239. Pasted through v1-api.