Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,7 +1,7 @@
|
|||
kolakoski: function [a, length][
|
||||
result: array.of: length 0
|
||||
i: new 0
|
||||
k: new 0
|
||||
i: 0
|
||||
k: 0
|
||||
|
||||
loop.forever a 'x [
|
||||
result\[i]: x
|
||||
|
|
@ -21,14 +21,14 @@ kolakoski: function [a, length][
|
|||
|
||||
possibleKolakoski?: function [seq][
|
||||
prev: seq\0
|
||||
count: new 1
|
||||
rle: new []
|
||||
count: 1
|
||||
rle: []
|
||||
|
||||
loop 1..dec size seq 'i [
|
||||
if? seq\[i] = prev -> inc 'count
|
||||
else [
|
||||
switch seq\[i] = prev -> inc 'count
|
||||
[
|
||||
'rle ++ count
|
||||
count: new 1
|
||||
count: 1
|
||||
prev: seq\[i]
|
||||
]
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue