| import Text.Printf
|
|
|
| questionOne :: String -> String
|
| questionOne answer =
|
| case answer of
|
| "good" -> "thats great, "
|
| "bad" -> "aww. I hope it gets better, "
|
| "alright" -> "thats good. Glad its not worse, "
|
| "better" -> "I'm glad, "
|
| _ -> "don't wanna answer. huh, "
|
|
|
| main :: IO ()
|
| main = do
|
| printf "please enter your first name"
|
| name <- getLine
|
| printf $ "hello " ++ name ++ "! how are you todays?"
|
| answer <- getLine
|
| printf $ questionOne answer ++ name ++"."
|