// Day 4: // Example: snow removal the better way // mjh-2013 // initialize program size(600, 400); background(255); strokeWeight(10); stroke(0); // draw sidewalk and border with neighbour line(10, 100, 590, 100); line(10, 200, 590, 200); stroke(227, 0, 0); line(350, 75, 350, 225); textSize(40); fill(127); text("Your sidewalk", 20, 50); text("Neighbour", 350, 50); // let's shovel the snow fill(0); // we can declare and initialize 2 or more // varables at the same time (if they are the // same type) int x = 25, y = 125; // shovel top half of snow while ( x < 350 ){ ellipse(x,y,50,50); x = x + 50; } // shovel bottom half of snow x = x - 50; // better update x position!! y = 175; // move down to bottom half while ( x > 0 ){ ellipse(x,y,50,50); x = x - 50; }