all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
22
Task/Vigen-re-cipher/PicoLisp/vigen-re-cipher.l
Normal file
22
Task/Vigen-re-cipher/PicoLisp/vigen-re-cipher.l
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
(de vigenereKey (Str)
|
||||
(extract
|
||||
'((C)
|
||||
(when (>= "Z" (uppc C) "A")
|
||||
(- (char (uppc C)) 65) ) )
|
||||
(chop Str) ) )
|
||||
|
||||
(de vigenereEncrypt (Str Key)
|
||||
(pack
|
||||
(mapcar
|
||||
'((C K)
|
||||
(char (+ 65 (% (+ C K) 26))) )
|
||||
(vigenereKey Str)
|
||||
(apply circ (vigenereKey Key)) ) ) )
|
||||
|
||||
(de vigenereDecrypt (Str Key)
|
||||
(pack
|
||||
(mapcar
|
||||
'((C K)
|
||||
(char (+ 65 (% (+ 26 (- C K)) 26))) )
|
||||
(vigenereKey Str)
|
||||
(apply circ (vigenereKey Key)) ) ) )
|
||||
Loading…
Add table
Add a link
Reference in a new issue