int x = 150; int y = 150; int d = 500; //diameter int n = 7; //recursions void setup() { size(300,300); background(0); noFill(); stroke(255); smooth(); noLoop(); } void draw() { Curlicue (x, y, d, n); } void Curlicue(float x, float y, float d, int num) { ellipse(x, y, d, d); if (num > 1) { num = num - 1; int branches = 3; for (int i = 0; i < branches; i++) { float a = random(0, TWO_PI); float newx = x + cos(a) * 6.0 * num; float newy = y + sin(a) * 6.0 * num; Curlicue (newx, newy, d/2, num); } } }