Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
49
Task/Fusc-sequence/CLU/fusc-sequence.clu
Normal file
49
Task/Fusc-sequence/CLU/fusc-sequence.clu
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
fusc = iter () yields (int)
|
||||
q: array[int] := array[int]$[1]
|
||||
yield(0)
|
||||
yield(1)
|
||||
|
||||
while true do
|
||||
x: int := array[int]$reml(q)
|
||||
array[int]$addh(q,x)
|
||||
yield(x)
|
||||
|
||||
x := x + array[int]$bottom(q)
|
||||
array[int]$addh(q,x)
|
||||
yield(x)
|
||||
end
|
||||
end fusc
|
||||
|
||||
longest_fusc = iter () yields (int,int)
|
||||
sofar: int := 0
|
||||
count: int := 0
|
||||
|
||||
for f: int in fusc() do
|
||||
if f >= sofar then
|
||||
yield (count,f)
|
||||
sofar := 10*sofar
|
||||
if sofar=0 then sofar:=10 end
|
||||
end
|
||||
count := count + 1
|
||||
end
|
||||
end longest_fusc
|
||||
|
||||
start_up = proc ()
|
||||
po: stream := stream$primary_output()
|
||||
|
||||
stream$putl(po, "First 61:")
|
||||
n: int := 0
|
||||
for f: int in fusc() do
|
||||
stream$puts(po, int$unparse(f) || " ")
|
||||
n := n + 1
|
||||
if n = 61 then break end
|
||||
end
|
||||
|
||||
stream$putl(po, "\nLength records:")
|
||||
n := 0
|
||||
for i, f: int in longest_fusc() do
|
||||
stream$putl(po, "fusc(" || int$unparse(i) || ") = " || int$unparse(f))
|
||||
n := n + 1
|
||||
if n = 5 then break end
|
||||
end
|
||||
end start_up
|
||||
Loading…
Add table
Add a link
Reference in a new issue