int x = 150; int y = 150; int d = 150; //diameter int n = 10; //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; float a = random(0, PI); float newx = x + cos(a) * 4.0 * num; float newy = y + sin(a) * 4.0 * num; Curlicue (newx, newy, d/a, num); } }