Example
// Learning Processing
// Daniel Shiffman
// http://www.learningprocessing.com

// Example 1-5: Zoog
size(200,200);
background(255);
smooth();
ellipseMode(CENTER);
rectMode(CENTER); 

// Body
stroke(0);
fill(150);
rect(100,100,20,100);

// Head
fill(255);
ellipse(100,70,60,60); 

// Eyes
fill(0); 
ellipse(81,70,16,32); 
ellipse(119,70,16,32);

// Legs
stroke(0);
line(90,150,80,160);
line(110,150,120,160);	
  • Anonymous

    Was it necessary to specify “stroke(0);” in the Legs section given that you had defined it the same way for the Body and never changed it?

  • Anonymous

    Yes, you are correct that technically speaking it is redundant and unnecessary.  However, I find that it is good practice to specify stroke and fill colors for each shape drawn, as it leads to fewer mistakes in larger, more complex sketches.