Created
July 18, 2024 19:39
-
-
Save dedemenezes/c80af56a4ca8fcd7ce5dfa6e304b59d1 to your computer and use it in GitHub Desktop.
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
# 1. Define alphabet array | |
# 2. Split string into array of letters | |
# 3. Iterate over letters array | |
# For each letter | |
# 4. Shift letter three letter behind in the alphabet | |
# 4.1 Identify the letter index in the alphabet | |
# 4.2 Subtract 3 from index | |
# 4.3 Access new alphabet letter | |
# 6. Join shifted letters array into string | |
# puts encrypt("THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG") == "QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment