Kaynağa Gözat

Implement the Cesar function

DricomDragon 5 yıl önce
ebeveyn
işleme
0ffeb4e65c
1 değiştirilmiş dosya ile 7 ekleme ve 0 silme
  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