Caesar cipher: Difference between revisions
→{{header|langur}}
m (fixed header) |
Langurmonkey (talk | contribs) |
||
Line 4,403:
Using the built-in rotate() function on a number over a range, a number outside of the range will pass through unaltered.
<syntaxhighlight lang="langur">val
cp2s map(fn(
}
▲val .s = "A quick brown fox jumped over something."
▲val .key = 3
</syntaxhighlight>
▲writeln " original: ", .s
▲writeln "encrypted: ", .rot(.s, .key)
▲writeln "decrypted: ", .rot(.rot(.s, .key), -.key)</syntaxhighlight>
{{out}}
|