Modify a text file: $/p6.pde
$/p6.pde
size( 600,400 ); background( 100,200,200 ); float ww=width*3/4; // Rectangle size float hh=height*3/4; float left= (width-ww) / 2; float top= (height-hh) / 2; float x,y; // float stripe= hh/13; // Stripe is 1/13 of rectangle height. // strokeWeight(6); stroke(255,200,0); x=left; y=top; rect( left,top, ww,hh ); strokeWeight(1); // for (int n=1; n<=13; ++n) { if (n % 2 == 0) fill(255); // White for even stripes. else fill(255,0,0); // Red for odd stripes. //-- text( y, 50, y); // rect( x,y, ww,stripe); // Draw one stripe. y += stripe; // next stripe. } float xx=ww*6/13, yy=hh*6/13; fill(0,0,255); rect( left,top, xx,yy); // STARS // float dx, dy; // Outer stars. dx= xx/6; dy= yy/5; y= top + dy/2; for (int row=1; row<=5; ++row ) { x= left + dx/2; for (int col=1; col<=6; ++col ) { fill(255); ellipse( x,y, 6,6); x += dx; } y += dy; } // Inner stars. y= top + dy; for (int row=1; row<=4; ++row ) { x= left + dx; for (int col=1; col<=5; ++col ) { fill(255); ellipse( x,y, 6,6); x += dx; } y += dy; }