Created
October 12, 2017 11:02
-
-
Save etiago/0b5103b34f34f87267017e57ad26e95a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Hangman = Char | |
singleton :: Char -> Hangman | |
singleton c = c | |
hangmanStdio :: Hangman -> IO() | |
hangmanStdio h = do | |
putStrLn "Guess the character" | |
l <- getLine | |
let c = toLower $ head l | |
if h == c | |
then do | |
putStrLn "Won" | |
return () | |
else do | |
putStrLn "Wrong" | |
hangmanStdio h | |
main :: IO () | |
main = hangmanStdio 'b' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment