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
|
|
@ -0,0 +1,21 @@
|
|||
function lookAndSay S
|
||||
put 0 into C
|
||||
put char 1 of S into lastChar
|
||||
repeat with i = 2 to length(S)
|
||||
add 1 to C
|
||||
if char i of S is lastChar then next repeat
|
||||
put C & lastChar after R
|
||||
put 0 into C
|
||||
put char i of S into lastChar
|
||||
end repeat
|
||||
return R & C + 1 & lastChar
|
||||
end lookAndSay
|
||||
|
||||
on demoLookAndSay
|
||||
put 1 into x
|
||||
repeat 10
|
||||
put x & cr after message
|
||||
put lookAndSay(x) into x
|
||||
end repeat
|
||||
put x after message
|
||||
end demoLookAndSay
|
||||
Loading…
Add table
Add a link
Reference in a new issue