Skip to content

Instantly share code, notes, and snippets.

@xander-miller
Last active December 27, 2015 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xander-miller/7380332 to your computer and use it in GitHub Desktop.
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!!!
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