Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- 4.
- lookUp :: Char -> [(Char, Char)] -> Char
- lookup c [] = []
- lookUp c (x,y):(xs,ys) | c==x = y : lookUp c (xs,ys)
- | c/=x = lookUp c (xs,ys)
- -- 5.
- encipher :: Int -> Char -> Char
- encipher n c = lookUp c (makeKey n)
- -}
- -- 6.
- normalize :: String -> String
- normalize (xs) = [toUpper x | x <- xs, isAlpha x || isDigit x]
- -- 7.
- encipherStr :: Int -> String -> String
- encipherStr = undefined
- -- 8.
- reverseKey :: [(Char, Char)] -> [(Char, Char)]
- reverseKey (x,y):(xs,ys) = (y,x) : reverseKey [(xs,ys)]
Add Comment
Please, Sign In to add comment