Created
December 19, 2014 16:58
-
-
Save mcshakes/ef86e532a76a48269a30 to your computer and use it in GitHub Desktop.
HW Solution
This file contains hidden or 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
# 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 |
This file contains hidden or 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
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