Example of Turtle Graphics

Tree Diagram

You can change the parameter values appropriately.

Sub DrawTree()
' Get device context handle
    monhdc = GetForegroundWindow()
    myhdc = GetDC(monhdc)
    If myhdc = 0 Then Exit Sub

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-gdi32.bas