Example of Turtle Graphics

Tree Diagram

You can change the parameter values appropriately.

Sub DrawTree()

Dim myLength, myTurn, myRatio

    myLength = 200     '  ' 0-th branch length
    myTurn = 60         ' angle of bending
    myRatio = 0.6      '  ' Ratio of branch length
    
    InitializeTurtleGraphics
    
    TreeAll myLength, myTurn, myRatio

End Sub

Sub TreeAll(myLength, myTurn, myRatio)

    If myLength < 5 Then Exit Sub
    
    TGMoveL myLength, vbGreen
    TGRightTurn myTurn
   
    TreeAll myLength * myRatio, myTurn, myRatio
    
    TGTurn myTurn
    TGTurn myTurn
    
    TreeAll myLength * myRatio, myTurn, myRatio
    TGRightTurn myTurn
    
    TGBackward myLength, vbGreen
    
End Sub

tree diagram

Download source program   tg-tree.bas