simpliest decoding
This commit is contained in:
parent
3ef907f3e3
commit
2876af419e
@ -32,12 +32,16 @@ simpliestEnc :: String -> String
|
|||||||
simpliestEnc input =
|
simpliestEnc input =
|
||||||
map (\x -> chr(ord(x) + 1)) input
|
map (\x -> chr(ord(x) + 1)) input
|
||||||
|
|
||||||
|
simpliestDec :: String -> String
|
||||||
|
simpliestDec input =
|
||||||
|
map (\x -> chr(ord(x) - 1)) input
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = do
|
main = do
|
||||||
putStrLn "Simpliest encoding, just +1 to each letter:"
|
putStrLn "Simpliest encoding, just +1 to each letter:"
|
||||||
print (simpliestEnc "abcdefz")
|
print (simpliestEnc "abcdefz")
|
||||||
putStrLn "atbash Encryption:"
|
print . simpliestDec $ "bcdefg{"
|
||||||
|
putStrLn "atbash Encryption, changing 1 alphabet to another:"
|
||||||
print . atbashEnc $ "test"
|
print . atbashEnc $ "test"
|
||||||
print . atbashDec $ ( atbashEnc "test" )
|
print . atbashDec $ ( atbashEnc "test" )
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user