Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
12
Task/Caesar-cipher/MiniScript/caesar-cipher.mini
Normal file
12
Task/Caesar-cipher/MiniScript/caesar-cipher.mini
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
caesar = function(s, key)
|
||||
chars = s.values
|
||||
for i in chars.indexes
|
||||
c = chars[i]
|
||||
if c >= "a" and c <= "z" then chars[i] = char(97 + (code(c)-97+key)%26)
|
||||
if c >= "A" and c <= "Z" then chars[i] = char(65 + (code(c)-65+key)%26)
|
||||
end for
|
||||
return chars.join("")
|
||||
end function
|
||||
|
||||
print caesar("Hello world!", 7)
|
||||
print caesar("Olssv dvysk!", 26-7)
|
||||
Loading…
Add table
Add a link
Reference in a new issue