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 AlligatorTeeth extends PApplet { public void setup() { //program to draw an alligator, uses simple shapes and loops for teeth //set up the drawing size(300, 310); smooth(); background(0xff29A78F); strokeWeight(2); //loops to draw the rows of teeth int i; i=0; fill(0xffF2E92A); stroke(255); while (i < 140) { triangle(i+120, 212, i+130, 212, i+125, 220); i = i+10; } i=0; while (i < 140) { triangle(i+120, 245, i+122, 235, i+125, 245); i = i+10; } //alligator body fill(0xff1A5808); beginShape(); vertex(-1, 120); vertex(50, 100); vertex(80, 130); vertex(90, 140); vertex(270, 185); vertex(285, 210); vertex(120, 210); vertex(120, 245); vertex(270, 245); vertex(275, 280); vertex(-1, 280); endShape(CLOSE); //eye fill(0); ellipse(50, 125, 30, 16); saveFrame("alligator.jpg"); noLoop(); } static public void main(String[] passedArgs) { String[] appletArgs = new String[] { "AlligatorTeeth" }; if (passedArgs != null) { PApplet.main(concat(appletArgs, passedArgs)); } else { PApplet.main(appletArgs); } } }