Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Data.Char
- canEncrypt :: Char -> Bool
- canEncrypt c = isLower(c) && isAscii(c)
- encryptChar :: Char -> Char -> Char
- encryptChar shift c
- | canEncrypt c = chr(ord(c)+ord(shift))
- | isUpper c = c
- | isNumber c = if (c == 0) then '*'
- else if (c == 1) then ''
- else if (c == 2) then '~'
- else if (c == 3) then '!'
- else if (c == 4) then '@'
- else if (c==5) then '#'
- else if (c==6) then '$'
- else if (c==7) then '%'
- else if (c==8) then '^'
- else '&'
- |
- | lexical error in string/character literal at character ' '
- 21 | isNumber c = blah blah blah..
- |
Add Comment
Please, Sign In to add comment