This article walks through the code used to animate a tree fractal.
Feel like exercising your brain? Have a go at one of the problems I have for you.