Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
20
Task/Caesar-cipher/11l/caesar-cipher.11l
Normal file
20
Task/Caesar-cipher/11l/caesar-cipher.11l
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
F caesar(string, =key, decode = 0B)
|
||||
I decode
|
||||
key = 26 - key
|
||||
|
||||
V r = ‘ ’ * string.len
|
||||
L(c) string
|
||||
r[L.index] = S c
|
||||
‘a’..‘z’
|
||||
Char(code' (c.code - ‘a’.code + key) % 26 + ‘a’.code)
|
||||
‘A’..‘Z’
|
||||
Char(code' (c.code - ‘A’.code + key) % 26 + ‘A’.code)
|
||||
E
|
||||
c
|
||||
R r
|
||||
|
||||
V msg = ‘The quick brown fox jumped over the lazy dogs’
|
||||
print(msg)
|
||||
V enc = caesar(msg, 11)
|
||||
print(enc)
|
||||
print(caesar(enc, 11, decode' 1B))
|
||||
Loading…
Add table
Add a link
Reference in a new issue