Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Fractal-tree/Icon/fractal-tree.icon
Normal file
18
Task/Fractal-tree/Icon/fractal-tree.icon
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
procedure main()
|
||||
WOpen("size=800,600", "bg=black", "fg=white") | stop("*** cannot open window")
|
||||
drawtree(400,500,-90,9)
|
||||
WDone()
|
||||
end
|
||||
|
||||
link WOpen
|
||||
|
||||
procedure drawtree(x,y,angle,depth)
|
||||
if depth > 0 then {
|
||||
x2 := integer(x + cos(dtor(angle)) * depth * 10)
|
||||
y2 := integer(y + sin(dtor(angle)) * depth * 10)
|
||||
DrawLine(x,y,x2,y2)
|
||||
drawtree(x2,y2,angle-20, depth-1)
|
||||
drawtree(x2,y2,angle+20, depth-1)
|
||||
}
|
||||
return
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue