ROT13 implementation in ruby

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

Popular

Direction Catastrophe