Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Sierpinski-triangle/Icon/sierpinski-triangle.icon
Normal file
15
Task/Sierpinski-triangle/Icon/sierpinski-triangle.icon
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# text based adaptaion of
|
||||
|
||||
procedure main(A)
|
||||
|
||||
width := 2 ^ ( 1 + (order := 0 < integer(\A[1]) | 4)) # order of arg[1] or 4
|
||||
write("Triangle order= ",order)
|
||||
|
||||
every !(canvas := list(width)) := list(width," ") # prime the canvas
|
||||
every y := 1 to width & x := 1 to width do # traverse it
|
||||
if iand(x - 1, y - 1) = 0 then canvas[x,y] := "*" # fill
|
||||
|
||||
every x := 1 to width & y := 1 to width do
|
||||
writes((y=1,"\n")|"",canvas[x,y]," ") # print
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue