RosettaCodeData/Task/Caesar-cipher/Langur/caesar-cipher.langur

11 lines
291 B
Plaintext

val .rot = fn(.s, .key) {
cp2s map(fn(.c) rotate(rotate(.c, .key, 'a'..'z'), .key, 'A'..'Z'), s2cp .s)
}
val .s = "A quick brown fox jumped over something."
val .key = 3
writeln " original: ", .s
writeln "encrypted: ", .rot(.s, .key)
writeln "decrypted: ", .rot(.rot(.s, .key), -.key)