You are viewing a single comment's thread. Return to all comments →
def rot13(secret_messages) secret_messages.map { |msg| decipher_message(msg) } end def decipher_message(msg) msg.chars.map { |c| case c when 'a'..'m', 'A'..'M' (c.ord + 13).chr when 'n'..'z', 'N'..'Z' (c.ord - 13).chr else c end }.join end
Seems like cookies are disabled on this browser, please enable them to open this website
Ruby - Enumerable - collect
You are viewing a single comment's thread. Return to all comments →