Look-and-say sequence: Difference between revisions

add SETL
imported>Maxima enthusiast
(add SETL)
Line 5,065:
</pre>
 
=={{header|SETL}}==
<syntaxhighlight lang="setl">program looksay;
s := "1";
loop for i in [1..10] do
print(s);
s := looksay(s);
end loop;
 
proc looksay(s);
loop for c in s do;
if cur /= c then
if count /= om then
r +:= count + cur;
end if;
cur := c;
count := 1;
else
count +:= 1;
end if;
end loop;
r +:= count + cur;
return r;
end proc;
end looksay;</syntaxhighlight>
{{out}}
<pre>1
11
21
1211
111221
312211
13112221
1113213211
31131211131221
13211311123113112211</pre>
=={{header|Sidef}}==
{{trans|Perl}}
2,094

edits