ROT13 implementation in ruby
We can implement ROT13 using map method and String.tr method collectively.
Here is basic example
def rot13(secret_messages)
secret_messages.map { |c| c.tr("a-z", "n-za-m") }
end

Comments
Post a Comment