Last active
December 27, 2015 19:49
-
-
Save xander-miller/7380332 to your computer and use it in GitHub Desktop.
Shopify asked me to send them a message so I created the best cover letter ever!!!
This file contains 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
quote = 'The last ever dolphin message was misinterpreted as a surprisingly sophisticated attempt to do a double-backwards-somersault through a hoop whilst whistling the ‘Star Spangled Banner’, but in fact the message was this: So long and thanks for all the fish.' | |
alphabet = ('a'..'z').to_a | |
offset = 5 | |
result_quote = '' | |
quote.each_char do |char| | |
if alphabet.include?(char) | |
char = alphabet.rotate(alphabet.index(char))[offset] | |
elsif alphabet.include?(char.downcase) | |
char = alphabet.rotate(alphabet.index(char.downcase))[offset].upcase | |
end | |
result_quote << char | |
end | |
puts quote | |
puts result_quote |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment