xxxxxxxxxx
49
// This sketch creates a Jack-o'-Lantern
// by drawing a pumpkin, and then drawing eyes and
// a mouth on top of the pumpkin. Try carving
// your own digital Jack-o'-Lantern!
function setup() {
createCanvas(500, 500);
}
function draw() {
// gray background
background(100);
// stem
stroke(0, 160, 0);
strokeWeight(20);
line(250, 150, 225, 100);
// orange
fill(255, 100, 0);
stroke(120, 60, 0);
strokeWeight(3);
// pumpkin is made up of circles
ellipse(250, 250, 400, 200);
ellipse(250, 250, 300, 200);
ellipse(250, 250, 200, 200);
ellipse(250, 250, 100, 200);
fill(0);
noStroke();
// eyes
triangle(
175, 200,
150, 225,
200, 225);
triangle(
325, 200,
300, 225,
350, 225);
// mouth
arc(
250, 275,
250, 75,
radians(0), radians(180));
}