YAPC::EU 2018 Glasgow Update!
This commit is contained in:
parent
22f33d4004
commit
4e2d22a71d
1170 changed files with 15042 additions and 3047 deletions
|
|
@ -1,8 +1,10 @@
|
|||
fun caesar(s, k, decode: false):
|
||||
if decode: k = 26 - k
|
||||
char({(ord(c) - 65 + k) mod 26 + 65) | c in s.upper() where "a" <= c <= "A"}).join()
|
||||
if decode:
|
||||
k = 26 - k
|
||||
char((ord(c) - 65 + k) mod 26 + 65) | c in uppercase(s) where 'a' <= c <= 'A').join()
|
||||
|
||||
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))
|
||||
print(enc), :(caesar(enc, 11, decode: true))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue