21 lines
488 B
Text
21 lines
488 B
Text
clear screen
|
|
width = 512 : height = 512 : crad = 0.01745329
|
|
open window width, height
|
|
window origin "cc"
|
|
|
|
sub drawTree(x, y, deg, n)
|
|
local x2, y2
|
|
|
|
if n then
|
|
x2 = x + cos(deg * crad) * n * 15 * ran(.5)
|
|
y2 = y + sin(deg * crad) * n * 15 * ran(.5)
|
|
line x, y, x2, y2
|
|
drawTree(x2, y2, deg - 20, n - 1)
|
|
drawTree(x2, y2, deg + 20, n - 1)
|
|
endif
|
|
end sub
|
|
|
|
repeat
|
|
clear window
|
|
drawTree(0, height/3, -90, 10)
|
|
until upper$(inkey$(1)) = "Q"
|