Pārlūkot izejas kodu

Implement the Cesar function

DricomDragon 5 gadi atpakaļ
vecāks
revīzija
0ffeb4e65c
1 mainītis faili ar 7 papildinājumiem un 0 dzēšanām
  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