Solve this entire Processing exercise with no aditional comments or explanations, simply…
- User
Solve this entire Processing exercise with no aditional comments or explanations, simply give me the altered code already solved: {```java color white = color(251); color black = color(4); color blue = color(1, 54, 154); color brightGreen = color (14, 154, 71); color darkGreen = color(74, 114, 54); color leafGreen = color (104, 154, 94);
int size = 2; int xFrog = 70; int yFrog = 400; int xSpeed = -1; int ySpeed = -1; int stepSize = 1; int jump = 180;
boolean showLeaves = true;
void setup() size(800, 800);
void draw() { background(blue);
if(showLeaves) drawLeaves();
drawFrog();
if(xFrog > width) xFrog = 70;
}
void keyPressed() { if (key == 'g' || key == 'G') xFrog += jump;
}
void mousePressed() showLeaves = false; yFrog = 700;
void mouseReleased() showLeaves = true; yFrog = 400;
void drawFrog() pushMatrix(); translate(xFrog-750, yFrog-550);
noStroke(); fill (brightGreen); ellipse(750, 550, 100, 75); ellipse(775, 510, 40, 40); ellipse(725, 510, 40, 40); fill(white); ellipse(775, 510, 24, 24); ellipse(725, 510, 24, 24); fill(black); ellipse(775, 510, 12, 12); ellipse(725, 510, 12, 12); fill(white); ellipse(772, 512, 2, 2); ellipse(728, 512, 2, 2); fill (darkGreen); ellipse(762, 550, 8, 8); ellipse(738, 550, 8, 8); stroke(black); noFill(); strokeWeight(size); arc(750, 556, 60, 40, radians(45), radians(135)); popMatrix();
void drawLeaves() pushMatrix(); translate(0, -100); fill(leafGreen); stroke(5, 75, 38); strokeWeight(2); arc(330, 420, 180, 120, radians(130), radians(360+110), PIE); arc(560, 400, 180, 120, radians(140), radians(360+120), PIE); arc(70, 550, 180, 120, radians(120), radians(360+100), PIE); arc(250, 530, 180, 120, radians(135), radians(360+115), PIE); arc(430, 550, 180, 120, radians(160), radians(360+140), PIE); arc(610, 530, 180, 120, radians(180), radians(360+160), PIE); arc(790, 550, 180, 120, radians(170), radians(360+150), PIE); arc(330, 660, 180, 120, radians(130), radians(360+110), PIE); arc(560, 680, 180, 120, radians(140), radians(360+120), PIE); popMatrix();
// last name: // first name: // class: // student number: /* 3a) Use a for loop to draw a row with 9 eggs inside the picture frame. Spread the 9 eggs horizontally evenly. 3b) Use another for loop to repeat the drawing of a row 6 times. Spread the 6 rows vertically evenly. Show cracked eggs (isEggCracked = true) on the following locations 3rd row 7th column 4th row 3rd column Check the image for a visual representation. Check which eggs should be cracked. Make sure things are only drawn once in the loop. You don't have to save 3a separately if you have b solved also. */ color black = color (4); color yellow = color(251, 224, 54); color offWhite = color(251, 241, 231); color orange = color(244, 131, 24); color green = color(104, 154, 94); color brown = color (84, 54, 4); int size = 5; int eggHeight = 0; int eggWidth = 130; int x = width/2; int y = height/2; boolean isEggCracked = false; void setup() size (900, 900); void draw() background(green); isEggCracked = false; x = width/2; y = height/2; isEggCracked = true; drawEgg(); println(width/10 + " /" + height / 7); // code below draws the picture frame (border). noFill(); stroke(brown); rectMode(CORNER); strokeWeight(40); rect(0, 0, width, height); noLoop(); void drawEgg() { //code below draws the egg with the current value of the variables x,y and eggCracked //see it as a black box. Don't change it. You don't have to understand everything to use it. pushMatrix(); translate(x-150, y- 140); noStroke(); //feathers on head stroke(yellow); strokeWeight(5); line(150, 110, 146, 106); line(150, 110, 153, 108); noStroke(); //head fill(yellow); ellipse(150, 135, 50, 50); //beak fill(orange); triangle(140, 135, 160, 135, 150, 145); //eyes fill(0); ellipse(138, 125, 5, 5); ellipse(162, 125, 5, 5); noStroke(); fill(offWhite); arc(150, 150, 80, 80, 0 - 0.3, PI + 0.3, PIE); if (!isEggCracked) fill(offWhite); arc(150, 150, 80, 120, PI, TWO_PI, PIE); popMatrix(); } } - Assistant
color black = color (4); color yellow = color(251, 224, 54); color offWhite = color(251, 241, 231); color orange = color(244, 131, 24); color green = color(104, 154, 94); color brown = color (84, 54, 4); int size = 5; int eggHeight = 0; int eggWidth = 130; int xStart; int yStart; boolean isEggCracked = false; void setup() { size (900, 900); xStart = width/10; yStart = height/7; } void draw() { background(green); noFill(); stroke(brown); rectMode(CORNER); strokeWeight(40); rect(0, 0, width, height); for (int row = 1; row <= 6; row++) { for (int col = 1; col <= 9; col++) { xStart = (width / 10) * col; yStart = (height / 7) * row; // cracked eggs at 3rd row 7th column and 4th row 3rd column if ((row == 3 && col == 7) || (row == 4 && col == 3)) { isEggCracked = true; } else { isEggCracked = false; } drawEgg(xStart, yStart, isEggCracked); } } noLoop(); } void drawEgg(int x, int y, boolean cracked) { pushMatrix(); translate(x-150, y-140); noStroke(); //feathers on head stroke(yellow); strokeWeight(5); line(150, 110, 146, 106); line(150, 110, 153, 108); noStroke(); //head fill(yellow); ellipse(150, 135, 50, 50); //beak fill(orange); triangle(140, 135, 160, 135, 150, 145); //eyes fill(0); ellipse(138, 125, 5, 5); ellipse(162, 125, 5, 5); noStroke(); fill(offWhite); arc(150, 150, 80, 80, 0 - 0.3, PI + 0.3, PIE); if (!cracked) { fill(offWhite); arc(150, 150, 80, 120, PI, TWO_PI, PIE); } popMatrix(); }