initial checkin from subversion

This commit is contained in:
Tretter
2017-02-07 20:06:59 +00:00
commit 7ae0afbc4b
7 changed files with 59 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
ifa = do
putStr "Name: "
name <- getLine
if (name == "Koen")
then putStrLn "I think Debugging haskell is simple"

7
exs.hs Normal file
View File

@@ -0,0 +1,7 @@
ifa = do
putStr "Name: "
name <- getLine
if name == "Koen"
then putStrLn "I know you"
else return ()

4
io1.hs Normal file
View File

@@ -0,0 +1,4 @@
main = do
putStrLn "Please enter your name: "
name <- getLine
putStrLn ("Hello, " ++ name ++ ", how are you?")

12
numGuess1.hs Normal file
View File

@@ -0,0 +1,12 @@
doGuessing num = do
putStrLn "Enter your guess:"
guess <- getLine
if (read guess) < num
then do putStrLn "Too low!"
doGuessing num
else if (read guess) > num
then do putStrLn "Too high!"
doGuessing num
else do putStrLn "You Win!"

2
recurs1.hs Normal file
View File

@@ -0,0 +1,2 @@
factorial 0 = 1
factorial n = n * factorial (n-1)

11
rettest1.hs Normal file
View File

@@ -0,0 +1,11 @@
main =
do x <- getX
putStrLn x
getX =
do return "hello"
return "aren't"
return "these"
return "returns"
return "rather"
return "pointless?"

18
stringManip.hs Normal file
View File

@@ -0,0 +1,18 @@
module StringManip where
import Data.Char
uppercase, lowercase :: String -> String
uppercase = map toUpper
lowercase = map toLower
capitalise :: String -> String
capitalise x =
let capWord (x:xs) = toUpper x : xs
in unwords (map capWord (words x))
yy :: String -> String
yy a =
let capWord (a:b) = toUpper a : b
in a