Skip to content

Latest commit

 

History

History
9 lines (5 loc) · 658 Bytes

File metadata and controls

9 lines (5 loc) · 658 Bytes

Write a method def caesar_cipher(string, number) that takes a string and a number as an argument and returns a string based on the following requirements:

  • Shift each letter in the string number spots down the alphabet. For example, running caesar_cipher("a", 2) would return "c". caesar_cipher("z", 2) would return "b". caesar_cipher("Caesar", 2) would return "Ecguct".

  • Punctuation, capitlization and spacing should be unchanged. Numbers also remain unchanged.

Notes:

  • Do the assignment with TDD if you want some TDD practice (you likely will need another file in addition to code.rb for your test suite if you choose to do this)!