Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
4
Task/Caesar-cipher/Groovy/caesar-cipher-4.groovy
Normal file
4
Task/Caesar-cipher/Groovy/caesar-cipher-4.groovy
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
def caesarEncode(k, text) {
|
||||
text.tr('a-zA-Z', ((('a'..'z')*2)[k..(k+25)] + (('A'..'Z')*2)[k..(k+25)]).join())
|
||||
}
|
||||
def caesarDecode(cipherKey, text) { caesarEncode(26 - cipherKey, text) }
|
||||
Loading…
Add table
Add a link
Reference in a new issue