This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I really love working these out on my own and then looking at how others handled the problem to see new approaches.
My first take at this was a little clunky but worked by generating a row for each letter in the original message and then applying the rotation, then using the crosstab to put the rows back into a column.
After looking at some of the other responses I realized that the regexp -tokenize was a more efficient approach with summary to pull everything back together.
Here is my solution, used Join+Union (to bring back spaces & punctuation etc) rather than Find & Replace used in other solutions. Preferred to use a Letter mapping rather than Char to Int as you also need to account for the Unicode integer.
Thanks!
These cryptography challenges are so much fun! This one reminded me of having a "secret language" with my friends in middle school, so we could write notes in class (it was just a simple substitution cipher).