diff options
author | Camil Staps | 2016-02-02 19:24:50 +0100 |
---|---|---|
committer | Camil Staps | 2016-02-02 19:24:50 +0100 |
commit | a7d7542dc646a5fd124ef71e71ce260889f1701b (patch) | |
tree | 04ed89503bbb3cc9933273a1326a53ca724c3492 /fp1/week1/mart | |
parent | week6 camil: working positioning of lines by putting empties at left and righ... (diff) |
Diffstat (limited to 'fp1/week1/mart')
-rw-r--r-- | fp1/week1/mart/1.txt | 3 | ||||
-rw-r--r-- | fp1/week1/mart/MatchStrings.dcl | 8 | ||||
-rw-r--r-- | fp1/week1/mart/MatchStrings.icl | 54 |
3 files changed, 0 insertions, 65 deletions
diff --git a/fp1/week1/mart/1.txt b/fp1/week1/mart/1.txt deleted file mode 100644 index 7ac4230..0000000 --- a/fp1/week1/mart/1.txt +++ /dev/null @@ -1,3 +0,0 @@ -1.1: -1.2: -Beide niet mogelijk zonder IDE(linux) diff --git a/fp1/week1/mart/MatchStrings.dcl b/fp1/week1/mart/MatchStrings.dcl deleted file mode 100644 index 527447c..0000000 --- a/fp1/week1/mart/MatchStrings.dcl +++ /dev/null @@ -1,8 +0,0 @@ -definition module MatchStrings
-
-head :: String -> Char
-tail :: String -> String
-is_gelijk :: String String -> Bool
-is_deelstring :: String String -> Bool
-is_deel :: String String -> Bool
-is_match :: String String -> Bool
diff --git a/fp1/week1/mart/MatchStrings.icl b/fp1/week1/mart/MatchStrings.icl deleted file mode 100644 index f10df45..0000000 --- a/fp1/week1/mart/MatchStrings.icl +++ /dev/null @@ -1,54 +0,0 @@ -implementation module MatchStrings
-
-import StdEnv
-
-head :: String -> Char
-head "" = abort "Empty String"
-head s = s.[0]
-
-tail :: String -> String
-tail "" = abort "Empty String"
-tail s = s % (1, size s - 1)
-
-is_gelijk :: String String -> Bool
-is_gelijk "" "" = True
-is_gelijk a b = (size a == size b) && (head a == head b) && is_gelijk (tail a) (tail b)
-
-is_deelstring :: String String -> Bool
-is_deelstring _ "" = False
-is_deelstring a b = is_begin a b || is_deelstring a (tail b)
-
-is_begin :: String String -> Bool
-is_begin "" _ = True
-is_begin _ "" = False
-is_begin a b = head a == head b && is_begin (tail a) (tail b)
-
-is_deel :: String String -> Bool
-is_deel "" _ = True
-is_deel _ "" = False
-is_deel a b = head a == head b && is_deel (tail a) (tail b) || is_deel a (tail b)
-
-is_match :: String String -> Bool
-is_match a b = is_begin_match a b || size b > 0 && is_begin_match a (tail b)
-
-is_begin_match :: String String -> Bool
-is_begin_match "" _ = True
-is_begin_match a "" = head a == '*' && size a == 1
-is_begin_match a b
-| head a == '.' || head a == head b = is_begin_match (tail a) (tail b)
-| head a == '*' = is_begin_match a (tail b) || is_begin_match (tail a) b
-| otherwise = False
-
-//Start= (head pink_floyd, tail pink_floyd)
-//Start= is_gelijk "" " "
-//Start= is_deelstring "there" pink_floyd
-//Start= is_deelstring "there" marillion
-//Start= is_deel "there" marillion
-//Start= is_deel "she and her" pink_floyd
-//Start= is_deel radiohead pink_floyd
-//Start= is_match "*.here*.here*." pink_floyd
-//Start= is_match ".here.here." pink_floyd
-
-pink_floyd= "Is there anybody in there?"
-marillion= "Just for the record"
-radiohead= "There there"
|