Last active
July 30, 2021 05:54
-
-
Save 4hg/b0a271f5e720f7b41f1430be6b87d94e to your computer and use it in GitHub Desktop.
Terrible, uninteresting rot13 implementation in ruby.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a=->(c){((c-97+13)%26+97).chr} | |
b=->(c){((c-65+13)%26+65).chr} | |
d=->(c){c==32||c<65?(c.chr):c<97?b[c]:a[c]} | |
p gets.chomp.each_byte.map(&d).join |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment