-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlec8.hs
More file actions
36 lines (28 loc) · 744 Bytes
/
lec8.hs
File metadata and controls
36 lines (28 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import Control.Mond
module Main where
main = do
putStrLn "I am gonna fucking do it no matter what, you know why?"
answer <- getLine
putStrLn (if answer == "confident"
then "You the best"
else "Motherfucker, You can do it")
shit = do
putStrLn " you the best ?"
ans <- getLine
if ans /= "y" then do
putStrLn "not quitting"
shit
else return ()
another = do
putStrLn "keep your heads up!"
ans <- getLine
when (ans /= "yessir") $ do
putStrLn "I said keep your heads up!!"
another
sequence [getLine, getLine]
cal = interact countChars
countChars :: String -> String
countChars str =
let allLines = lines str
lengths = map (show.length) allLines
in unlines lengths