Guest User

Untitled

a guest
Nov 21st, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. import Data.Char
  2.  
  3. canEncrypt :: Char -> Bool
  4. canEncrypt c = isLower(c) && isAscii(c)
  5.  
  6. encryptChar :: Char -> Char -> Char
  7. encryptChar shift c
  8. | canEncrypt c = chr(ord(c)+ord(shift))
  9. | isUpper c = c
  10. | isNumber c = if (c == 0) then '*'
  11. else if (c == 1) then ''
  12. else if (c == 2) then '~'
  13. else if (c == 3) then '!'
  14. else if (c == 4) then '@'
  15. else if (c==5) then '#'
  16. else if (c==6) then '$'
  17. else if (c==7) then '%'
  18. else if (c==8) then '^'
  19. else '&'
  20.  
  21. |
  22. | lexical error in string/character literal at character ' '
  23. 21 | isNumber c = blah blah blah..
  24. |
Add Comment
Please, Sign In to add comment