Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,14 @@
on hailstone (n, sequenceList)
len = 1
repeat while n<>1
if listP(sequenceList) then sequenceList.add(n)
if n mod 2 = 0 then
n = n / 2
else
n = 3 * n + 1
end if
len = len + 1
end repeat
if listP(sequenceList) then sequenceList.add(n)
return len
end

View file

@ -0,0 +1,16 @@
sequenceList = []
hailstone(27, sequenceList)
put sequenceList
-- [27, 82, 41, 124, ... , 8, 4, 2, 1]
n = 0
maxLen = 0
repeat with i = 1 to 99999
len = hailstone(i)
if len>maxLen then
n = i
maxLen = len
end if
end repeat
put n, maxLen
-- 77031 351