Question: I add the code here if necessary HTML : Repetitions Repeat the pig First Part Second Part javascript use strict; let ctx; function setup() {

 I add the code here if necessary HTML: Repetitions Repeat thepig First Part Second Part javascript "use strict"; let ctx; function setup()

I add the code here if necessary

HTML:

Repetitions

Repeat the pig

javascript

"use strict";

let ctx;

function setup() {

let canvas = document.getElementById("myCanvas");

ctx = canvas.getContext("2d");

}

function drawPig(x,y) {

ctx.save();

ctx.translate(x,y);

ctx.fillStyle = "pink"

ctx.beginPath();

ctx.arc(25, 40, 15, 0, 2 * Math.PI);

ctx.fill();

ctx.beginPath();

ctx.arc(40, 25, 10, 0, 2 * Math.PI);

ctx.fill();

ctx.fillRect(45, 20, 10, 10);

ctx.beginPath();

ctx.arc(42, 18, 1.5, 0, 2 * Math.PI);

ctx.fill();

ctx.beginPath();

ctx.moveTo(35, 50);

ctx.lineTo(50, 60);

ctx.moveTo(35, 50);

ctx.lineTo(35, 62);

ctx.moveTo(15, 50);

ctx.lineTo(5, 60);

ctx.moveTo(15, 50);

ctx.lineTo(15, 60);

ctx.stroke();

}

Problem 1[35 points]: With the following code make loops to form the patterns shown below, add two extra functions for each button. Html 1 2 chat 3 cheta charset"utf-8"> 5

Repetitions

6 7 8 9

Repeat the pig

10 11 11

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!