xxxxxxxxxx
59
function setup() {
createCanvas(2000, 400);
}
function draw() {
background(220);
for (let x = 0; x <= width; x += 350) {
let r = random(255);
let g = random(255);
let b = random(255);
fill(r,g,b);
strokeWeight(2);
fill('sienna')
ellipse(x -150,200,200,300);//face
fill("white")
arc(x - 150,300,100,40,PI,-PI);//lips
fill("white")
line(x - 150,280,x - 150,320);//teeth
line(x - 125,285,x - 125,315);//teeth
line(x - 175,285,x - 176,315);//teeth
line(x - 200,300,x - 100,300);//teeth
arc(x - 100,200,50,80, -PI,PI*2,CHORD);//outer eye
arc(x - 200,200,50,80,-PI,PI*2,CHORD); //outer eye
fill("black")
arc(x - 100,200,25,40,-PI,PI*2,CHORD);//pupil right
arc(x - 200,200,25,40,-PI,PI*2,CHORD);//pupil left
fill("sienna")
arc(x - 55,215,50,50,-PI/2,PI/2);//right ear
arc(x - 150,245,50,50,PI/2,-PI/2);//nose
arc(x - 245,215,50,50,PI/2,-PI/2);//left ear
fill(r,g,b)
arc(x - 150,150,210,210,-PI,PI/100,CHORD);//hat
arc(x - 200,152,260,45,-PI,PI*2,CHORD);//hat bill
circle(x - 150,40,20)//hat button
}
noLoop();
console.log(random(1));
console.log(random(100));
console.log(round(random(200,255)));
console.log(random(-10));
console.log(random(-10,10));
console.log(random(['blue','green','red']))
}