Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
|
|
@ -1,23 +1,23 @@
|
|||
// Look and Say Sequence
|
||||
repeats = function(digit, string)
|
||||
count = 0
|
||||
for c in string
|
||||
if c != digit then break
|
||||
count = count + 1
|
||||
end for
|
||||
return str(count)
|
||||
count = 0
|
||||
for c in string
|
||||
if c != digit then break
|
||||
count = count + 1
|
||||
end for
|
||||
return str(count)
|
||||
end function
|
||||
|
||||
numbers = "1"
|
||||
print numbers
|
||||
for i in range(1,10) // warning, loop size > 15 gets long numbers very quickly
|
||||
number = ""
|
||||
position = 0
|
||||
while position < numbers.len
|
||||
repeatCount = repeats(numbers[position], numbers[position:])
|
||||
number = number + repeatCount + numbers[position]
|
||||
position = position + repeatCount.val
|
||||
end while
|
||||
print number
|
||||
numbers = number
|
||||
number = ""
|
||||
position = 0
|
||||
while position < numbers.len
|
||||
repeatCount = repeats(numbers[position], numbers[position:])
|
||||
number = number + repeatCount + numbers[position]
|
||||
position = position + repeatCount.val
|
||||
end while
|
||||
print number
|
||||
numbers = number
|
||||
end for
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue