Skip to content

Instantly share code, notes, and snippets.

@mcshakes
Created December 19, 2014 16:58
Show Gist options
  • Save mcshakes/ef86e532a76a48269a30 to your computer and use it in GitHub Desktop.
Save mcshakes/ef86e532a76a48269a30 to your computer and use it in GitHub Desktop.
HW Solution
# key = 13
encrypted_message = "guvf vf zl frperg"
result = encrypted_message.tr('a-z', 'n-za-m')
result.capitalize
puts result.capitalize
## Result returns: This is my secret
key = 13
message = "This is my secret"
encrypted_message = message.downcase.tr('a-z', 'n-za-m')
puts encrypted_message.capitalize
### Returns Guvf vf zl frperg
### This is a lame solution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment