Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/Caesar-cipher/LiveCode/caesar-cipher.livecode
Normal file
16
Task/Caesar-cipher/LiveCode/caesar-cipher.livecode
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
function caesarCipher rot phrase
|
||||
local rotPhrase, lowerLetters, upperLetters
|
||||
put "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz" into lowerLetters
|
||||
put "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" into upperLetters
|
||||
repeat for each char letter in phrase
|
||||
get charTonum(letter)
|
||||
if it >= 65 and it <= 90 then
|
||||
put char ((it + rot) - 64) of upperLetters after rotPhrase
|
||||
else if it >= 97 and it <= 122 then
|
||||
put char ((it + rot) - 96) of lowerLetters after rotPhrase
|
||||
else
|
||||
put letter after rotPhrase
|
||||
end if
|
||||
end repeat
|
||||
return rotPhrase
|
||||
end caesarCipher
|
||||
Loading…
Add table
Add a link
Reference in a new issue