Created
January 6, 2017 17:38
-
-
Save JJ/9953ba0a98800fed205eaae5b5a6410a to your computer and use it in GitHub Desktop.
Perl6 one liners vol. 3: a very simple cypher
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
# This cypher applies character displacement to a set of letters using a "cypher" both users must have | |
perl6 -e "say (<1 -1 3 -3 4> <<+<< <t h i s i s s o s 1 k r i t>.map: {.ord}).map: {.chr}" | |
# In this case, the cypher is <1 -1 3 -3 4> and will be applied to the message after <<+<< | |
# You can retrieve the original message by applying the inverse of the cypher | |
perl6 -e "say (<-1 1 -3 3 -4> <<+<< <u g l p m t r r p 5 l q l q>.map: {.ord}).map: {.chr}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment