Interactive fractal tree
Recursion you can bend. A fractal tree in Unity, with sliders for every part of it.
A fractal tree is one rule applied over and over: draw a branch, then draw two smaller branches from its tip, each turned by some angle. Stop when the branches get too small.
I built an interactive version in the Unity game engine. Sliders set the starting length and thickness, how much each level shrinks, the branching angle, the shortest branch, and where and how big the leaves are. Its simple look makes it a nice way to teach recursion and fractals.
The tree above bends the same way: move across it to change the angle. Below is a fuller version for the browser: the original app’s sliders, plus more branches per fork, lean, randomness and wind. The Original preset is styled after the Unity app.
Grow your own
Drag across the tree to bend it: sideways changes the angle, up and down the length.