logo

Crowdly

Browser

Додати до Chrome

Given the following code, which letter should be pressed to move the circle to t...

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

Given the following code, which letter should be pressed to move the circle to the left, and how many times should it be pressed to place the circle at the centre of the canvas?

let x = 400;

function setup() {

  createCanvas(400, 400);

}

function draw() {

  background(0, 255, 255);

  fill(255, 0, 0);

  ellipse(x, 200, 50, 50);

}

function keyPressed() {

  if (key == "l") {

    x = x + 20;

  } else if (key == "j") {

    x = x - 20;

  }

}

0%
0%
0%
0%
Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на elearning.aua.am?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

Browser

Додати до Chrome