September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
8
Task/Caesar-cipher/Astro/caesar-cipher.astro
Normal file
8
Task/Caesar-cipher/Astro/caesar-cipher.astro
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fun caesar(s, k, decode: false):
|
||||
if decode: k = 26 - k
|
||||
join(char((ord(c) - 65 + k) % 26 + 65) | c in s.upper() where "a" <= c <= "A")
|
||||
|
||||
let msg = "The quick brown fox jumped over the lazy dogs"
|
||||
print msg
|
||||
let enc = caesar(msg, 11)
|
||||
print ..(enc) ..(caesar(enc, 11, decode: true))
|
||||
Loading…
Add table
Add a link
Reference in a new issue