Data update
This commit is contained in:
parent
8e4e15fa56
commit
72eb4943cb
1853 changed files with 35514 additions and 9441 deletions
|
|
@ -0,0 +1,26 @@
|
|||
##
|
||||
function lookAndSay(): sequence of string;
|
||||
begin
|
||||
var current: string := '1';
|
||||
yield current;
|
||||
|
||||
while true do
|
||||
begin
|
||||
var ch := current[1];
|
||||
var count := 1;
|
||||
var next := '';
|
||||
foreach var i in 2..current.Length do
|
||||
if current[i] = ch then
|
||||
inc(count)
|
||||
else begin
|
||||
next += count.ToString + ch;
|
||||
ch := current[i];
|
||||
count := 1;
|
||||
end;
|
||||
current := next + count.ToString + ch;
|
||||
yield current;
|
||||
end;
|
||||
end;
|
||||
|
||||
foreach var s in lookandsay.Take(12) do
|
||||
s.Println;
|
||||
Loading…
Add table
Add a link
Reference in a new issue