beginfig(1) u := 2cm; offset := 120; def drawgreen(expr p, linethick) = draw p withpen pencircle scaled linethick withcolor 0.5green enddef; def drawpink(expr p, linethick) = draw p withpen pencircle scaled linethick withcolor red+0.6green+0.6blue enddef; vardef tree(expr A, B, n, size) = save C, D, thick; pair C, D; thick := size; C := 0.8[B, A rotatedaround(B, offset+uniformdeviate(60))]; D := 0.8[B, A rotatedaround(B, -offset-uniformdeviate(60))]; if n > 0: drawgreen(A--B, thick); thick := 0.7*thick; tree(B, C, n-1, thick); tree(B, D, n-1, thick); else: drawgreen(A--B,thick); thick := 0.7*thick; drawpink(B--C, thick); drawpink(B--D, thick); fi; enddef; tree((0,0), (0,u), 10, 3mm); endfig; bye