Time for an 2014 update…

This commit is contained in:
Ingy döt Net 2014-01-17 05:32:22 +00:00
parent 372c577f83
commit 09687c4926
2520 changed files with 34227 additions and 7318 deletions

View file

@ -0,0 +1,18 @@
function rot(s::String, key::Integer)
map(s) do c
if 'a' <= c <= 'z'
char( mod(c - 'a' + key, 26) + 'a')
elseif 'A' <= c <= 'Z'
char( mod(c - 'A' + key, 26) + 'A')
else
c
end
end
end
key = 3
txt = "The five boxing wizards jump quickly"
println("Original: ", txt);
println("Encrypted: ", rot(txt, key))
println("Decrypted: ", rot(rot(txt, key), 26 - key))