diff options
author | Camil Staps | 2016-02-12 15:01:00 +0100 |
---|---|---|
committer | Camil Staps | 2016-02-12 15:01:00 +0100 |
commit | efd533331d6a7f0c51ef857af448a6c84c3084ed (patch) | |
tree | 7f28f4e20a215784f27643ad49029332204528b2 /Assignment 1/CamilStaps-assignment1-shift.hs | |
parent | Makefile (diff) |
Removed spaces in path
Diffstat (limited to 'Assignment 1/CamilStaps-assignment1-shift.hs')
-rw-r--r-- | Assignment 1/CamilStaps-assignment1-shift.hs | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/Assignment 1/CamilStaps-assignment1-shift.hs b/Assignment 1/CamilStaps-assignment1-shift.hs deleted file mode 100644 index 35a34e7..0000000 --- a/Assignment 1/CamilStaps-assignment1-shift.hs +++ /dev/null @@ -1,14 +0,0 @@ -import System.Environment -import Data.String.Utils - -main = do - args <- getArgs - let input = replace " " "" (head args) - print $ map (`shiftN` (read $ args!!1)) input - --- shiftN c i: shift c i times forward (i.e. shiftN 'A' 1 == 'B') --- Only for uppercase letters -shiftN :: Char -> Int -> Char -shiftN c 0 = c -shiftN 'Z' i = shiftN 'A' (i-1) -shiftN c i = shiftN (toEnum ((fromEnum c) + 1)) (i-1)
\ No newline at end of file |