If you mean recursion here is an example that draws a fractal tree
// set window properties
SetWindowTitle( "Fractal Math" )
SetWindowSize( 1024, 768, 0 )
SetSyncRate(30,0) `
// set display properties
SetVirtualResolution( 1024, 768 )
length#=1
do
if length#<250 then length#=length#+.25 //grows at the rate of.25 increase the number to grow faster
cantor2(512,768,length#,270) //draws a growing tree
Sync()
loop
function cantor2(x as float,y as float,length as float,ang as integer)
local x2 as float
local y2 as float
if length>1
x2= length * cos(ang) + x //calculate endx point given length and angle
y2= length * sin(ang) + y //calculate endy point given length and angle
DrawLine(x,y,x2,y2,MakeColor(255,255,255),MakeColor(255,255,255))
cantor2(x2,y2,length/1.5,ang+15)
cantor2(x2,y2,length/1.5,ang-15)
//if you change the above to this it will add some randomness but if you
//try to draw gradually with the draw command it will appear as if there is wind
//cantor2(x2,y2,length/1.5,ang+random(10,15))
//cantor2(x2,y2,length/1.5,ang-random(10,15))
endif
endfunction
copied from my thread
https://forum.thegamecreators.com/thread/222027
fubar