Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 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