Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
rot13 in Perl 6
sub rot13($s) {
join "", map { chr(do given ord($_) {
when ord('A')..ord('Z') { ($_ - ord('A') + 13) % 26 + ord('A') }
when ord('a')..ord('z') { ($_ - ord('a') + 13) % 26 + ord('a') }
default { $_ } })
}, $s.comb
}
say(rot13($_)) for
q[V'ir zrnfherq vg sebz fvqr gb fvqr:],
q['Gvf guerr srrg ybat, naq gjb srrg jvqr.]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.