/* Adam Murray, 2009 http://compusition.com */ int MAX_DEPTH = 1; float SIZE_DELTA = 1.04; float SCALE = 1/2.0; float rotation = 0; float rotDelta = 0.02; boolean autoAdvance = true; void setup() { size(450,450); noFill(); strokeJoin(ROUND); stroke(0,255,0,60); strokeWeight(130.0); } void draw() { background(0); scale(0.45); translate(width*0.8, height*0.8); subsqr(width, height, SCALE); rotation += rotDelta; if(rotation > 2*PI) { rotation -= 2*PI; if(MAX_DEPTH<5 && autoAdvance) { MAX_DEPTH++; } } } void subsqr(int w, int h, float scale) { subsqr(w,h,scale,1); } void subsqr(float w, float h, float scale, int depth) { float xinc = scale*w; float yinc = scale*h; for(float x=0; x= '1' && key <= '7') { MAX_DEPTH = key-'0'; autoAdvance = false; } }