import processing.core.*; import processing.data.*; import processing.event.*; import processing.opengl.*; import java.util.HashMap; import java.util.ArrayList; import java.io.File; import java.io.BufferedReader; import java.io.PrintWriter; import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; public class LoopsForTeeth extends PApplet { public void setup() { //program to draw a pumpkin face, uses simple shapes and loops for teeth //set up the drawing size(300, 280); smooth(); background(0xffFC6C12); //set up the eye colors fill(0xff9B1B1B); strokeWeight(2); ellipse(80, 50, 50, 20); ellipse(220, 50, 50, 20); //the nose triangle(150, 100, 150, 120, 120, 120); //the mouth (background) fill(0xff714123); beginShape(); vertex(95, 147); vertex(195, 147); vertex(225, 130); vertex(198, 213); vertex(99, 213); vertex(60, 130); endShape(CLOSE); //loops to draw the rows of teeth int i; i=0; fill(0xffF2E92A); stroke(255); while (i < 100) { rect(i+100, 150, 7, 20); i = i+10; } i=0; while (i < 100) { rect(i+100, 190, 7, 20); i = i+10; } saveFrame("pumpkin.jpg"); noLoop(); } static public void main(String[] passedArgs) { String[] appletArgs = new String[] { "LoopsForTeeth" }; if (passedArgs != null) { PApplet.main(concat(appletArgs, passedArgs)); } else { PApplet.main(appletArgs); } } }