浏览代码

Implement the Cesar function

DricomDragon 5 年之前
父节点
当前提交
0ffeb4e65c
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      io_cesar.hs

+ 7 - 0
io_cesar.hs

@@ -0,0 +1,7 @@
+-- Slide 58
+
+import Data.Char
+
+cechar c = chr ((mod ((ord c) + 13 - ord 'a') ((ord 'z') - ord 'a'  + 1)) + ord 'a')
+
+cesar = map cechar