Ciao 访客, welcome back to old school! :p
float xStart, yStart;float spacing;float diam;int cols, rows;void setup() { size(600, 450); smooth(); rows = 20; cols = 15; diam = 30; xStart = diam/2; yStart = diam/2; spacing = diam; noStroke();}void draw() { background(100); for (int i=0;i<cols;i++) { for (int j=0;j<rows;j++) { fill(random(255), random(255), random(255)); float xPos = xStart+j*spacing; float yPos = yStart+i*spacing; ellipse(xPos, yPos, diam, diam); float degreeStart = random(360); float degreeEnd = degreeStart + random(360); fill(random(255), random(255), random(255)); arc(xPos, yPos, diam, diam, radians(degreeStart), radians(degreeEnd)); } } noLoop();}
xPos[i]=2*i+random(2),以及point(xPos[i],yPos[j])