Tracing the position actually drawn

A Processing Java-mode sketch animates a marker using the following complete code:


Java
float x = 24;

void setup() {
  size(320, 160);
  noStroke();
  ellipseMode(CENTER);
}

void draw() {
  background(255);
  ellipse(x, 80, 10, 10);
  x += 3;
}


Count the first execution of draw() as call 1. Immediately after call 8 returns, before call 9 begins, what is the horizontal screen coordinate of the marker's centre in the displayed image?


A flow diagram shows each draw call clearing the canvas, drawing the marker, and then updating x.


Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Processing Language Programming Questions: