Variables With Circles

I want to make an X with circles every 20 pixels in a box of 300 x 300 but I only get a line of circles. That I’m failing with this one.

void setup()
{
  size(300, 300);
  strokeWeight(20);
  for (int a=0 ; a<300 ; a=a+20 )
  {
    point ( a , a );
  }
  strokeWeight(20);
  for( int a=300 ; a<300 ; a=a+20)
  {
    point ( a , a );
  }
}
1 Like

Hey there Theikercf75, welcome to the forum. If I understand correctly you want to end up with the image below. Is that correct? If so, it means you’re only one line away from victory :slight_smile: .

Untitled-1

Let’s take things one step at the time, so you’ll come to understand why things didn’t work as you intended. Start out by locating the part of the code where you think the issue takes place and try to describe why you think it isn’t working (if you’re not sure where the problem takes place, try to disable some lines of code by turning them into comments)

2 Likes