simpliest decoding

This commit is contained in:
lulzette 2021-05-19 11:57:14 +03:00
parent 3ef907f3e3
commit 2876af419e

View File

@ -32,12 +32,16 @@ simpliestEnc :: String -> String
simpliestEnc input =
map (\x -> chr(ord(x) + 1)) input
simpliestDec :: String -> String
simpliestDec input =
map (\x -> chr(ord(x) - 1)) input
main :: IO ()
main = do
putStrLn "Simpliest encoding, just +1 to each letter:"
print (simpliestEnc "abcdefz")
putStrLn "atbash Encryption:"
print . simpliestDec $ "bcdefg{"
putStrLn "atbash Encryption, changing 1 alphabet to another:"
print . atbashEnc $ "test"
print . atbashDec $ ( atbashEnc "test" )