Sierpinski triangle: Difference between revisions
Add SETL
Recombinant (talk | contribs) m (→{{header|Zig}}: writer.print() is void (no return)) |
Not a robot (talk | contribs) (Add SETL) |
||
Line 5,403:
writeln(join(sierpinski(4), "\n"));
end func;</syntaxhighlight>
=={{header|SETL}}==
<syntaxhighlight lang="setl">program sierpinski;
const size = 4;
loop for i in [0..size*4-1] do
putchar(' ' * (size*4-1-i));
c := 1;
loop for j in [0..i] do
putchar(if c mod 2=0 then " " else " *" end);
c := c*(i-j) div (j+1);
end loop;
print;
end loop;
end program;</syntaxhighlight>
{{out}}
<pre> *
* *
* *
* * * *
* *
* * * *
* * * *
* * * * * * * *
* *
* * * *
* * * *
* * * * * * * *
* * * *
* * * * * * * *
* * * * * * * *
* * * * * * * * * * * * * * * *</pre>
=={{header|Sidef}}==
|